* moved zeroradiant (1.6) into trunk

git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@262 8a3a26a2-13c4-0310-b231-cf6edde360e5
This commit is contained in:
mattn 2008-06-26 06:52:09 +00:00
commit 5265d3cc15
1941 changed files with 258043 additions and 238956 deletions

View file

@ -1,4 +1,3 @@
/*
Copyright (c) 2001, Loki software, inc. Copyright (c) 2001, Loki software, inc.
All rights reserved. All rights reserved.
@ -14,7 +13,7 @@ other materials provided with the distribution.
Neither the name of Loki software nor the names of its contributors may be used 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 to endorse or promote products derived from this software without specific prior
written permission. written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@ -26,6 +25,4 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 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 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "str.h"

8216
CHANGES

File diff suppressed because it is too large Load diff

11
CHANGES-MACOS Normal file
View file

@ -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)

View file

@ -1,5 +1,5 @@
developer documentation for GtkRadiant 1.5.0 developer documentation for GtkRadiant 1.6.0 (Zeroradiant)
============================================ ==========================================================
getting the source 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: To get a copy of the source using the commandline Subversion client:
Change the current directory to the desired location for the source. 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/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) Linux/OSX(using X-windows)
@ -46,7 +45,6 @@ run:
Execute './GtkRadiant/install/radiant.x86' (or './GtkRadiant/install/radiant.ppc' on osx) Execute './GtkRadiant/install/radiant.x86' (or './GtkRadiant/install/radiant.ppc' on osx)
Win32 (2000, XP or Vista) Win32 (2000, XP or Vista)
================== ==================

View file

@ -1,19 +1,7 @@
GtkRadiant CONTRIBUTORS and CREDITS 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 Loki
---- ----
Leonardo Zide leo@lokigames.com Leonardo Zide leo@lokigames.com
@ -22,15 +10,15 @@ Bernd Kreimeier (overall coordination)
QER.com QER.com
------- -------
TTimo timo@idsoftware.com TTimo timo@qeradiant.com
^Fishman (Pablo Zurita) fish@gamedesign.net ^Fishman (Pablo Zurita) fish@gamedesign.net
RR2DO2 rr2do2@q3f.com RR2DO2 rr2do2@q3f.com
SmallPileofGibs spog@planetquake.com
Curry plugin Curry plugin
------------ ------------
Mike "mickey" Jackman Mike "mickey" Jackman
Tim "Maj" Rennie Tim "Maj" Rennie
William "SmallPileOfGibs" Joseph
PrtView plugin, various bug fixes and q3map guru PrtView plugin, various bug fixes and q3map guru
------------------------------------------------ ------------------------------------------------
@ -57,19 +45,10 @@ Improvements and bug fixing
--------------------------- ---------------------------
Jan Paul "MrElusive" van Waveren Jan Paul "MrElusive" van Waveren
Robert Duffy Robert Duffy
Forest "LordHavoc" Wroncy-Hale
Nurail
AcidDeath
Chronos
Michael Schlueter
Jamie Wilkinson
Robert "Tr3B" Beckebans
Web Web
--- ---
Dave "Bargle" Koenig Dave "Bargle" Koenig and Jason "Wolfen" Spencer
Jason "Wolfen" Spencer
Shawn "EvilTypeGuy" Walker
Thanks to John Hutton, AstroCreep and W2k for web help Thanks to John Hutton, AstroCreep and W2k for web help
@ -77,18 +56,10 @@ FAQ
--- ---
Equim and Wex 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 Misc
---- ----
Thanks to everyone on the beta mailing list and Thanks to everyone on the beta mailing list and
irc.telefragged.com #qeradiant for testing and feedback. irc.telefragged.com #qeradiant for testing and feedback.
Updated icons by AstroCreep! Updated icons by AstroCreep!
Bitch-slapping by RaYGunn! Bitch-slapping by RaYGunn!
Last minute bugs by SPoG! (SPoG--) Last minute bugs by SpoG! (SpoG--)

2
ChangeLog Normal file
View file

@ -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

55
DarwinCompileInfo.rtf Normal file
View file

@ -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 )\
\
}

View file

@ -30,7 +30,7 @@ OUTPUT_DIRECTORY = ../GtkRadiant-doxygen
# eg: To document just include, if the current directory is ../GtkRadiant/ # eg: To document just include, if the current directory is ../GtkRadiant/
# then... # then...
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
INPUT = radiant/ INPUT = GtkRadiant/include/
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Misc settings # Misc settings

1093
Doxyfile

File diff suppressed because it is too large Load diff

62
GPL
View file

@ -2,7 +2,7 @@
Version 2, June 1991 Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc. 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 Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed. 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. POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS 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.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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.
<signature of Ty Coon>, 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.

View file

@ -1,4 +1,4 @@
# Anjuta Version 1.0.2 # Anjuta Version 1.1.97
Compatibility Level: 1 Compatibility Level: 1
<PROJECT_DESCRIPTION_START> <PROJECT_DESCRIPTION_START>
@ -23,7 +23,7 @@ level editor for Id technology games
props.file.type=project props.file.type=project
anjuta.version=1.0.2 anjuta.version=1.1.97
anjuta.compatibility.level=1 anjuta.compatibility.level=1
project.name=GtkRadiant project.name=GtkRadiant
@ -33,6 +33,7 @@ project.version=changesallthetime
project.author=qeradiant.com dev team project.author=qeradiant.com dev team
project.source.target=install/radiant.x86 project.source.target=install/radiant.x86
project.has.gettext=0 project.has.gettext=0
project.gui.command=
project.programming.language=C_C++ project.programming.language=C_C++
project.excluded.modules= intl project.excluded.modules= intl
@ -49,19 +50,26 @@ project.menu.need.terminal=0
project.configure.options= project.configure.options=
anjuta.program.arguments= 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.indent.automatic=1
preferences.use.tabs=0 preferences.use.tabs=0
preferences.indent.opening=0
preferences.indent.closing=0
preferences.tabsize=2
preferences.indent.size=2 preferences.indent.size=2
preferences.autoformat.style=Style of Kangleipak preferences.tabsize=2
preferences.autoformat.custom.style= -i8 -sc -bli0 -bl0 -cbi0 -ss preferences.indent.closing=0
preferences.autoformat.disable=0
module.include.name=. module.include.name=.
module.include.type= module.include.type=
module.include.expanded=1
module.include.files=\ module.include.files=\
Doxygen_files/doxy_mainpage.h\ Doxygen_files/doxy_mainpage.h\
contrib/bobtoolz/CPortals.h\ contrib/bobtoolz/CPortals.h\
@ -260,14 +268,10 @@ module.include.files=\
tools/quake3/q3map/mesh.h\ tools/quake3/q3map/mesh.h\
tools/quake3/q3map/qbsp.h\ tools/quake3/q3map/qbsp.h\
tools/quake3/q3map/shaders.h\ tools/quake3/q3map/shaders.h\
tools/quake3/q3map/vis.h\ tools/quake3/q3map/vis.h
libs/function.h\
include/iarchive.h\
libs/filestream.h
module.source.name=. module.source.name=.
module.source.type= module.source.type=
module.source.expanded=1
module.source.files=\ module.source.files=\
contrib/bobtoolz/DBobView.cpp\ contrib/bobtoolz/DBobView.cpp\
contrib/bobtoolz/DBrush.cpp\ contrib/bobtoolz/DBrush.cpp\
@ -506,13 +510,10 @@ module.source.files=\
tools/quake3/q3map/vis.c\ tools/quake3/q3map/vis.c\
tools/quake3/q3map/visflow.c\ tools/quake3/q3map/visflow.c\
tools/quake3/q3map/writebsp.c\ tools/quake3/q3map/writebsp.c\
tools/quake3/q3map/NetTest/main.c\ tools/quake3/q3map/NetTest/main.c
plugins/archivepak/archive.cpp\
plugins/archivepak/plugin.cpp
module.pixmap.name=. module.pixmap.name=.
module.pixmap.type= module.pixmap.type=
module.pixmap.expanded=0
module.pixmap.files=\ module.pixmap.files=\
Doxygen_files/example/doxygen.gif\ Doxygen_files/example/doxygen.gif\
Doxygen_files/example/graph_legend.gif\ Doxygen_files/example/graph_legend.gif\
@ -579,17 +580,14 @@ module.pixmap.files=\
module.data.name=. module.data.name=.
module.data.type= module.data.type=
module.data.expanded=0
module.data.files= module.data.files=
module.help.name=. module.help.name=.
module.help.type= module.help.type=
module.help.expanded=0
module.help.files= module.help.files=
module.doc.name=. module.doc.name=.
module.doc.type= module.doc.type=
module.doc.expanded=0
module.doc.files=\ module.doc.files=\
INSTALL\ INSTALL\
README\ README\
@ -668,7 +666,6 @@ module.doc.files=\
www/index.html\ www/index.html\
www/reviews.html www/reviews.html
module.po.expanded=0
module.po.files= module.po.files=
compiler.options.supports= compiler.options.supports=
@ -680,11 +677,12 @@ compiler.options.libraries=
compiler.options.libraries.selected= compiler.options.libraries.selected=
compiler.options.defines=\ compiler.options.defines=\
HAVE_CONFIG_H 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.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.optimize.buttons=0 0 1 0
compiler.options.other.buttons=1 0 compiler.options.other.buttons=1 0
compiler.options.other.c.flags= compiler.options.other.c.flags=
compiler.options.other.l.flags= compiler.options.other.l.flags=
compiler.options.other.l.libs= compiler.options.other.l.libs=
project.source.paths=
project.src.paths=

View file

@ -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

7
INSTALL.txt Normal file
View file

@ -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

0
LICENSE_ID Normal file
View file

49
README Normal file
View file

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

View file

@ -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 ---------------------------------------------------------------------------------------

34
SConscript.lib Normal file
View file

@ -0,0 +1,34 @@
# -*- mode: python -*-
# ZeroRadiant build scripts
# TTimo <ttimo@idsoftware.com>
# 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' )

60
SConscript.module Normal file
View file

@ -0,0 +1,60 @@
# -*- mode: python -*-
# ZeroRadiant build scripts
# TTimo <ttimo@idsoftware.com>
# 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' )

19
SConscript.q3map2 Normal file
View file

@ -0,0 +1,19 @@
# -*- mode: python -*-
# ZeroRadiant build scripts
# TTimo <ttimo@idsoftware.com>
# 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' )

18
SConscript.radiant Normal file
View file

@ -0,0 +1,18 @@
# -*- mode: python -*-
# ZeroRadiant build scripts
# TTimo <ttimo@idsoftware.com>
# 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' )

View file

@ -1,338 +1,59 @@
# scons build script # -*- mode: python -*-
# ZeroRadiant build scripts
# TTimo <ttimo@idsoftware.com>
# http://scons.sourceforge.net # http://scons.sourceforge.net
import commands, re, sys, os, pickle, string, popen2 import sys, os, platform, cPickle
from makeversion import radiant_makeversion, get_version
# to access some internal stuff import utils, config
import SCons
conf_filename='site.conf' conf_filename = 'site.sconf'
# 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 ------------------------------------------- try:
sys.argv.index( '-h' )
Help(""" except:
Usage: scons [OPTIONS] [TARGET] [CONFIG] pass
else:
[OPTIONS] and [TARGET] are covered in command line options, use scons -H Help(
[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
""" """
) ======================================================================
ZeroRadiant build system quick help
# end help --------------------------------------- You need scons v0.97.0d20070918.r2446 or newer
# sanity ----------------------------------------- Default build (release), just run scons at the toplevel
# get a recent python release debug build:
# that is broken in current version: $ scons config=debug
# http://sourceforge.net/tracker/index.php?func=detail&aid=794145&group_id=30337&atid=398971 ======================================================================
#EnsurePythonVersion(2,1) """ )
# above 0.90 Return()
EnsureSConsVersion( 0, 96 )
print 'SCons ' + SCons.__version__
# end sanity ------------------------------------- active_configs = []
# system detection ------------------------------- # load up configurations from the save file
if ( os.path.exists( conf_filename ) ):
# TODO: detect Darwin / OSX f = open( conf_filename )
print 'reading saved configuration from site.conf'
# 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: try:
env['ALLOWED_SYMBOLS'].index(symbol) while ( True ):
c = cPickle.load( f )
active_configs.append( c )
except: except:
have_undef = 1 pass
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='.'): # read the command line and build configs
result = self.SharedLibrary(target, source, LIBS=LIBS, LIBPATH=LIBPATH) config_statements = sys.argv[1:]
if (OS != 'Darwin'): active_configs = config.ConfigParser().parseStatements( active_configs, config_statements )
AddPostAction(target + '.so', self.CheckLDD) assert( len( active_configs ) >= 1 )
return result
g_env = idEnvironment() # save the config
print 'saving updated configuration'
f = open( conf_filename, 'wb' )
for c in active_configs:
cPickle.dump( c, f, -1 )
# export the globals print 'emit build rules'
GLOBALS = 'g_env INSTALL g_cpu' for c in active_configs:
print 'emit configuration: %s' % repr( c )
radiant_makeversion('\\ngcc version: %s.%s.%s' % ( ver_cc[0], ver_cc[1], ver_cc[2] ) ) c.emit()
# end general configuration ----------------------
# targets ----------------------------------------
Default('.')
Export('GLOBALS ' + GLOBALS)
BuildDir(g_build, '.', duplicate = 0)
SConscript(g_build + '/SConscript')
# end targets ------------------------------------

150
TODO
View file

@ -1,148 +1,10 @@
- add browse buttons to CGameInstall dialog for engine folder
- copy content, only generating the .game atm
- delete .game files? should we also delete files that were copied?
BUGS - when doing Q3 + mod, the mod has to be setup in the preferences
(that's a bit awkward)
MSI: installer bug with new folders? : create custom dir, click New Folder icon, type "FOLDER\" - gets stuck - the game list reload doesn't work right, the entries in the combo probably need to be initialized again
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)
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:
<pre>[q2map] -bsp "[MapFile]"</pre>
becomes:
<pre>"C:\Program Files\GtkRadiant 1.5.0\q2map" -fs_basepath "c:\quake2" -bsp "c:\quake2\baseq2\maps\blah.map"</pre>
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:
<pre><var name="arghrad">"[RadiantPath]arghrad"</var></pre>
This variable could then be used in a command like this:
<pre>[arghrad] "[MapFile]"</pre>
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?

BIN
bin/Linux/x64/modules/PrtView.so Executable file

Binary file not shown.

BIN
bin/Linux/x64/modules/TexTool.so Executable file

Binary file not shown.

BIN
bin/Linux/x64/modules/bkgrnd2d.so Executable file

Binary file not shown.

Binary file not shown.

BIN
bin/Linux/x64/modules/entity.so Executable file

Binary file not shown.

BIN
bin/Linux/x64/modules/fgd.so Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
bin/Linux/x64/modules/image.so Executable file

Binary file not shown.

BIN
bin/Linux/x64/modules/imagem8.so Executable file

Binary file not shown.

BIN
bin/Linux/x64/modules/imagepng.so Executable file

Binary file not shown.

BIN
bin/Linux/x64/modules/imagewal.so Executable file

Binary file not shown.

BIN
bin/Linux/x64/modules/map.so Executable file

Binary file not shown.

BIN
bin/Linux/x64/modules/mapxml.so Executable file

Binary file not shown.

BIN
bin/Linux/x64/modules/model.so Executable file

Binary file not shown.

BIN
bin/Linux/x64/modules/shaders.so Executable file

Binary file not shown.

Binary file not shown.

BIN
bin/Linux/x64/modules/surface.so Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
bin/Linux/x64/modules/ufoai.so Executable file

Binary file not shown.

BIN
bin/Linux/x64/modules/vfspak.so Executable file

Binary file not shown.

BIN
bin/Linux/x64/modules/vfspk3.so Executable file

Binary file not shown.

BIN
bin/Linux/x64/modules/vfswad.so Executable file

Binary file not shown.

BIN
bin/Linux/x64/q3map2 Executable file

Binary file not shown.

BIN
bin/Linux/x64/radiant.bin Executable file

Binary file not shown.

BIN
bin/Linux/x86/modules/PrtView.so Executable file

Binary file not shown.

BIN
bin/Linux/x86/modules/TexTool.so Executable file

Binary file not shown.

BIN
bin/Linux/x86/modules/bkgrnd2d.so Executable file

Binary file not shown.

Binary file not shown.

BIN
bin/Linux/x86/modules/entity.so Executable file

Binary file not shown.

BIN
bin/Linux/x86/modules/fgd.so Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
bin/Linux/x86/modules/image.so Executable file

Binary file not shown.

BIN
bin/Linux/x86/modules/imagem8.so Executable file

Binary file not shown.

BIN
bin/Linux/x86/modules/imagepng.so Executable file

Binary file not shown.

BIN
bin/Linux/x86/modules/imagewal.so Executable file

Binary file not shown.

BIN
bin/Linux/x86/modules/map.so Executable file

Binary file not shown.

BIN
bin/Linux/x86/modules/mapxml.so Executable file

Binary file not shown.

BIN
bin/Linux/x86/modules/model.so Executable file

Binary file not shown.

BIN
bin/Linux/x86/modules/shaders.so Executable file

Binary file not shown.

Binary file not shown.

BIN
bin/Linux/x86/modules/surface.so Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
bin/Linux/x86/modules/ufoai.so Executable file

Binary file not shown.

BIN
bin/Linux/x86/modules/vfspak.so Executable file

Binary file not shown.

BIN
bin/Linux/x86/modules/vfspk3.so Executable file

Binary file not shown.

BIN
bin/Linux/x86/modules/vfswad.so Executable file

Binary file not shown.

BIN
bin/Linux/x86/q3map2 Executable file

Binary file not shown.

BIN
bin/Linux/x86/radiant.bin Executable file

Binary file not shown.

5
compile_ibuild_win32.bat Normal file
View file

@ -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"

389
config.py Normal file
View file

@ -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()

View file

@ -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. This file is part of GtkRadiant.

View file

@ -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. This file is part of GtkRadiant.

View file

@ -1,169 +1,73 @@
<?xml version="1.0" encoding = "Windows-1252"?> <?xml version="1.0" ?><VisualStudioProject Name="bkgrnd2d" ProjectGUID="{65D02375-63EE-4A8A-9F8E-504B1D5A1D02}" ProjectType="Visual C++" RootNamespace="bkgrnd2d" Version="8.00">
<VisualStudioProject
ProjectType="Visual C++"
Version="7.00"
Name="bkgrnd2d"
ProjectGUID="{356A36AA-1F10-48A0-BF63-227DFB46F208}"
>
<Platforms> <Platforms>
<Platform <Platform Name="Win32"/>
Name="Win32"/>
</Platforms> </Platforms>
<ToolFiles>
</ToolFiles>
<Configurations> <Configurations>
<Configuration <Configuration CharacterSet="2" ConfigurationType="1" IntermediateDirectory="$(ConfigurationName)" Name="Debug|Win32" OutputDirectory="$(SolutionDir)\install\modules">
Name="Release|Win32" <Tool Name="VCPreBuildEventTool"/>
OutputDirectory=".\Release" <Tool Name="VCCustomBuildTool"/>
IntermediateDirectory=".\Release" <Tool Name="VCXMLDataGeneratorTool"/>
ConfigurationType="2" <Tool Name="VCWebServiceProxyGeneratorTool"/>
UseOfMFC="0" <Tool Name="VCMIDLTool"/>
ATLMinimizesCRunTimeLibraryUsage="FALSE" <Tool AdditionalIncludeDirectories="&quot;$(SolutionDir)\include&quot;;&quot;$(SolutionDir)\libs&quot;;&quot;$(SolutionDir)\..\STLPort\stlport&quot;;&quot;$(SolutionDir)\..\gtk2\include&quot;;&quot;$(SolutionDir)\..\gtk2\include\glib-2.0&quot;;&quot;$(SolutionDir)\..\gtk2\lib\glib-2.0\include&quot;;&quot;$(SolutionDir)\..\libxml2\include&quot;" BasicRuntimeChecks="3" DebugInformationFormat="4" Detect64BitPortabilityProblems="true" DisableSpecificWarnings="4996;4244;4267" MinimalRebuild="true" Name="VCCLCompilerTool" Optimization="0" PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS" RuntimeLibrary="3" WarningLevel="3"/>
CharacterSet="2"> <Tool Name="VCManagedResourceCompilerTool"/>
<Tool <Tool Name="VCResourceCompilerTool"/>
Name="VCCLCompilerTool" <Tool Name="VCPreLinkEventTool"/>
InlineFunctionExpansion="1" <Tool GenerateDebugInformation="true" Name="VCLinkerTool" TargetMachine="1"/>
AdditionalIncludeDirectories="..\..\shared,..\..\..\libxml2\include,..\..\..\gtk2-win32\include\glib-2.0,..\..\..\gtk2-win32\lib\glib-2.0\include,..\..\..\gtk2-win32\lib\gtk-2.0\include,..\..\..\gtk2-win32\include\gtk-2.0,..\..\..\gtk2-win32\include\gtk-2.0\gdk,..\..\..\gtk2-win32\include\pango-1.0,..\..\..\gtk2-win32\include\atk-1.0,..\..\include,..\common,..\..\libs,..\..\libs\nvtristrip,..\..\..\STLPort\stlport" <Tool Name="VCALinkTool"/>
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;BKGRND2D_EXPORTS" <Tool Name="VCManifestTool"/>
StringPooling="TRUE" <Tool Name="VCXDCMakeTool"/>
RuntimeLibrary="2" <Tool Name="VCBscMakeTool"/>
EnableFunctionLevelLinking="TRUE" <Tool Name="VCFxCopTool"/>
UsePrecompiledHeader="2" <Tool Name="VCAppVerifierTool"/>
PrecompiledHeaderFile=".\Release/bkgrnd2d.pch" <Tool Name="VCWebDeploymentTool"/>
AssemblerListingLocation=".\Release/" <Tool Name="VCPostBuildEventTool"/>
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="gobject-2.0.lib gdk-win32-2.0.lib gtk-win32-2.0.lib pango-1.0.lib glib-2.0.lib synapse.lib"
OutputFile=".\Release/bkgrnd2d.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\..\libs\synapse\release,..\..\..\gtk2-win32\lib\"
ModuleDefinitionFile=".\bkgrnd2d.def"
ProgramDatabaseFile=".\Release/bkgrnd2d.pdb"
ImportLibrary=".\Release/bkgrnd2d.lib"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Release/bkgrnd2d.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
</Configuration> </Configuration>
<Configuration <Configuration CharacterSet="2" ConfigurationType="1" IntermediateDirectory="$(ConfigurationName)" Name="Release|Win32" OutputDirectory="$(SolutionDir)\install\modules">
Name="Debug|Win32" <Tool Name="VCPreBuildEventTool"/>
OutputDirectory=".\Debug" <Tool Name="VCCustomBuildTool"/>
IntermediateDirectory=".\Debug" <Tool Name="VCXMLDataGeneratorTool"/>
ConfigurationType="2" <Tool Name="VCWebServiceProxyGeneratorTool"/>
UseOfMFC="0" <Tool Name="VCMIDLTool"/>
ATLMinimizesCRunTimeLibraryUsage="FALSE" <Tool AdditionalIncludeDirectories="&quot;$(SolutionDir)\include&quot;;&quot;$(SolutionDir)\libs&quot;;&quot;$(SolutionDir)\..\STLPort\stlport&quot;;&quot;$(SolutionDir)\..\gtk2\include&quot;;&quot;$(SolutionDir)\..\gtk2\include\glib-2.0&quot;;&quot;$(SolutionDir)\..\gtk2\lib\glib-2.0\include&quot;;&quot;$(SolutionDir)\..\libxml2\include&quot;" DebugInformationFormat="3" Detect64BitPortabilityProblems="true" DisableSpecificWarnings="4996;4244;4267" Name="VCCLCompilerTool" PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS" RuntimeLibrary="2" WarningLevel="3"/>
CharacterSet="2"> <Tool Name="VCManagedResourceCompilerTool"/>
<Tool <Tool Name="VCResourceCompilerTool"/>
Name="VCCLCompilerTool" <Tool Name="VCPreLinkEventTool"/>
Optimization="0" <Tool EnableCOMDATFolding="2" GenerateDebugInformation="true" Name="VCLinkerTool" OptimizeReferences="2" TargetMachine="1"/>
AdditionalIncludeDirectories="..\..\shared,..\..\..\libxml2\include,..\..\..\gtk2-win32\include\glib-2.0,..\..\..\gtk2-win32\lib\glib-2.0\include,..\..\..\gtk2-win32\lib\gtk-2.0\include,..\..\..\gtk2-win32\include\gtk-2.0,..\..\..\gtk2-win32\include\gtk-2.0\gdk,..\..\..\gtk2-win32\include\pango-1.0,..\..\..\gtk2-win32\include\atk-1.0,..\..\include,..\common,..\..\libs,..\..\libs\nvtristrip,..\..\..\STLPort\stlport" <Tool Name="VCALinkTool"/>
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;BKGRND2D_EXPORTS" <Tool Name="VCManifestTool"/>
BasicRuntimeChecks="3" <Tool Name="VCXDCMakeTool"/>
RuntimeLibrary="3" <Tool Name="VCBscMakeTool"/>
UsePrecompiledHeader="2" <Tool Name="VCFxCopTool"/>
PrecompiledHeaderFile=".\Debug/bkgrnd2d.pch" <Tool Name="VCAppVerifierTool"/>
AssemblerListingLocation=".\Debug/" <Tool Name="VCWebDeploymentTool"/>
ObjectFile=".\Debug/" <Tool Name="VCPostBuildEventTool"/>
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="gobject-2.0.lib gdk-win32-2.0.lib gtk-win32-2.0.lib pango-1.0.lib glib-2.0.lib synapse.lib"
OutputFile=".\Debug/bkgrnd2d.dll"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\..\libs\synapse\debug,..\..\..\gtk2-win32\lib\"
ModuleDefinitionFile=".\bkgrnd2d.def"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug/bkgrnd2d.pdb"
ImportLibrary=".\Debug/bkgrnd2d.lib"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Debug/bkgrnd2d.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
</Configuration> </Configuration>
</Configurations> </Configurations>
<References>
</References>
<Files> <Files>
<Filter <Filter Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" Name="Source Files">
Name="Source Files" <File RelativePath=".\bkgrnd2d.cpp">
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath=".\bkgrnd2d.cpp">
</File> </File>
<File <File RelativePath=".\bkgrnd2d.def">
RelativePath=".\bkgrnd2d.def">
</File> </File>
<File <File RelativePath=".\dialog.cpp">
RelativePath=".\dialog.cpp">
</File> </File>
<File <File RelativePath=".\plugin.cpp">
RelativePath=".\plugin.cpp">
</File> </File>
</Filter> </Filter>
<Filter <Filter Filter="h;hpp;hxx;hm;inl" Name="Header Files">
Name="Header Files" <File RelativePath=".\bkgrnd2d.h">
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath=".\bkgrnd2d.h">
</File> </File>
<File <File RelativePath=".\dialog.h">
RelativePath=".\dialog.h">
</File> </File>
<File <File RelativePath=".\plugin.h">
RelativePath=".\plugin.h">
</File> </File>
</Filter> </Filter>
<Filter <Filter Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" Name="Resource Files">
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
</Filter> </Filter>
</Files> </Files>
<Globals> <Globals>

View file

@ -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. This file is part of GtkRadiant.

View file

@ -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. This file is part of GtkRadiant.

View file

@ -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. This file is part of GtkRadiant.
@ -253,8 +254,13 @@ void DoBkgrndToggleYZ()
CSynapseServer* g_pSynapseServer = NULL; CSynapseServer* g_pSynapseServer = NULL;
CSynapseClientBkgrnd2d g_SynapseClient; 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)) if (strcmp(version, SYNAPSE_VERSION))
{ {
Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version); Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version);

View file

@ -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. This file is part of GtkRadiant.

View file

@ -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 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "StdAfx.h" // Added by ClassView
class CBspPoint { class CBspPoint {
public: public:
float p[3]; float p[3];
@ -45,8 +47,6 @@ public:
}; };
#define NAME_MAX 255
class CPortals { class CPortals {
public: public:
@ -56,7 +56,7 @@ public:
void Load(); // use filename in fn void Load(); // use filename in fn
void Purge(); void Purge();
char fn[NAME_MAX]; char fn[PATH_MAX];
CBspNode *node; CBspNode *node;
unsigned int node_count; unsigned int node_count;

View file

@ -21,21 +21,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#include "StdAfx.h"
#include "DBobView.h" #include "DBobView.h"
//#include "misc.h" #include "DListener.h"
#include "funchandlers.h"
#include <list>
#include "iglrender.h"
#include "qerplugin.h"
#include "str.h"
#include "math/matrix.h"
#include "DEntity.h"
#include "DEPair.h"
#include "misc.h" #include "misc.h"
#include "dialogs/dialogs-gtk.h" #include "funchandlers.h"
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// Construction/Destruction // Construction/Destruction
@ -44,23 +34,29 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
DBobView::DBobView() DBobView::DBobView()
{ {
nPathCount = 0; nPathCount = 0;
refCount = 1;
m_bHooked = FALSE;
path = NULL; path = NULL;
eyes = NULL;
boundingShow = BOUNDS_APEX; boundingShow = BOUNDS_APEX;
constructShaders();
GlobalShaderCache().attachRenderable(*this);
} }
DBobView::~DBobView() DBobView::~DBobView()
{ {
GlobalShaderCache().detachRenderable(*this);
destroyShaders();
if(path) if(path)
delete[] 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; g_PathView = NULL;
} }
@ -68,77 +64,201 @@ DBobView::~DBobView()
// Implementation // Implementation
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
void DBobView::render(RenderStateFlags state) const void DBobView::Draw2D(VIEWTYPE vt)
{
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
{ {
if(!path) if(!path)
return; return;
renderer.SetState(m_shader_line, Renderer::eWireframeOnly); g_QglTable.m_pfn_qglPushAttrib(GL_ALL_ATTRIB_BITS);
renderer.SetState(m_shader_line, Renderer::eFullMaterials);
renderer.addRenderable(*this, g_matrix4_identity); 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) if(m_bShowExtra)
{ {
renderer.SetState(m_shader_box, Renderer::eWireframeOnly); // +mars
renderer.SetState(m_shader_box, Renderer::eFullMaterials); // for the bounding box stuff
renderer.addRenderable(*this, g_transform_box1); g_QglTable.m_pfn_qglColor4f(0.25f, 0.75f, 0.75f, 1.0f);
renderer.addRenderable(*this, g_transform_box2);
renderer.addRenderable(*this, g_transform_box3); g_QglTable.m_pfn_qglTranslatef( 16.0f, 16.0f, 28.0f );
renderer.addRenderable(*this, g_transform_box4);
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) 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]) if(apex[2] <= start[2])
{ {
SetPath(NULL); SetPath(NULL);
return false; return FALSE;
} }
// ----think q3a actually would allow these // ----think q3a actually would allow these
//scrub that, coz the plugin wont :] //scrub that, coz the plugin wont :]
@ -194,7 +314,7 @@ bool DBobView::CalculateTrajectory(vec3_t start, vec3_t apex, float multiplier,
} }
SetPath(pPath); 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) 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; nPathCount = points;
m_bShowExtra = bShowExtra; 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; delete this;
} }
} }
@ -223,55 +354,8 @@ bool DBobView::UpdatePath()
if(GetEntityCentre(entTarget, apex)) if(GetEntityCentre(entTarget, apex))
{ {
CalculateTrajectory(start, apex, fMultiplier, nPathCount, fVarGravity); 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);
} }

View file

@ -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_) #if !defined(AFX_BOBVIEW_H__6E36062A_EF0B_11D4_ACF7_004095A18133__INCLUDED_)
#define 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 DListener;
class Shader;
#define BOUNDS_ALL 0 #define BOUNDS_ALL 0
#define BOUNDS_APEX 1 #define BOUNDS_APEX 1
@ -39,26 +33,22 @@ class Shader;
#pragma once #pragma once
#endif // _MSC_VER > 1000 #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: public:
DBobView(); DBobView();
virtual ~DBobView(); virtual ~DBobView();
protected: protected:
vec3_t* path; vec3_t* path;
int refCount;
public: public:
bool m_bShowExtra; bool m_bShowExtra;
int boundingShow; int boundingShow;
DListener* eyes; DListener* eyes;
float fVarGravity; float fVarGravity;
float fMultiplier;
int nPathCount;
Entity* trigger;
Entity* target;
bool UpdatePath(); bool UpdatePath();
char entTarget[256]; char entTarget[256];
@ -67,40 +57,16 @@ public:
bool CalculateTrajectory(vec3_t, vec3_t, float, int, float); bool CalculateTrajectory(vec3_t, vec3_t, float, int, float);
void SetPath(vec3_t* pPath); 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; float fMultiplier;
void renderSolid(Renderer& renderer, const VolumeTest& volume) const; bool m_bHooked;
void renderWireframe(Renderer& renderer, const VolumeTest& volume) const; int nPathCount;
void constructShaders();
void destroyShaders();
void valueChanged(const char* value)
{
UpdatePath();
}
typedef MemberCaller1<DBobView, const char*, &DBobView::valueChanged> 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;
}
}
}; };
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_) #endif // !defined(AFX_BOBVIEW_H__6E36062A_EF0B_11D4_ACF7_004095A18133__INCLUDED_)

View file

@ -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) #pragma warning(disable : 4786)
#endif #endif
#include <list> #include "DBrush.h"
#include "str.h"
#include "DPoint.h"
#include "DPlane.h"
#include "DEPair.h"
#include "DPatch.h"
#include "DEntity.h"
#include "DWinding.h" #include "DWinding.h"
#include "dialogs/dialogs-gtk.h" #include "dialogs/dialogs-gtk.h"
#include "misc.h" #include "misc.h"
#include "iundo.h"
#include "generic/referencecounted.h"
#include "scenelib.h"
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// Construction/Destruction // Construction/Destruction
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
@ -54,8 +40,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
DBrush::DBrush(int ID) DBrush::DBrush(int ID)
{ {
m_nBrushID = ID; m_nBrushID = ID;
bBoundsBuilt = false; bBoundsBuilt = FALSE;
QER_entity = NULL;
QER_brush = NULL; QER_brush = NULL;
} }
@ -69,12 +54,12 @@ DBrush::~DBrush()
// Implementation // 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 #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]); // 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 #endif
bBoundsBuilt = false; bBoundsBuilt = FALSE;
DPlane* newFace = new DPlane(va, vb, vc, texData); DPlane* newFace = new DPlane(va, vb, vc, texData);
faceList.push_back(newFace); 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 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 return 0; // with only 3 faces u can't have a bounded soild
for(std::list<DPlane *>::const_iterator p1=faceList.begin(); p1!=faceList.end(); p1++) for(list<DPlane *>::const_iterator p1=faceList.begin(); p1!=faceList.end(); p1++)
{ {
std::list<DPlane *>::const_iterator p2=p1; list<DPlane *>::const_iterator p2=p1;
for(p2++; p2!=faceList.end(); p2++) for(p2++; p2!=faceList.end(); p2++)
{ {
std::list<DPlane *>::const_iterator p3=p2; list<DPlane *>::const_iterator p3=p2;
for(p3++; p3!=faceList.end(); p3++) for(p3++; p3!=faceList.end(); p3++)
{ {
vec3_t pnt; vec3_t pnt;
@ -103,7 +88,7 @@ int DBrush::BuildPoints()
if(pos == POINT_IN_BRUSH) if(pos == POINT_IN_BRUSH)
{ // ???? shouldn't happen here { // ???? 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) else if(pos == POINT_ON_BRUSH)
{ // normal point { // normal point
@ -126,37 +111,35 @@ int DBrush::BuildPoints()
// Sys_Printf("%i points on brush\n", pointList.size()); // Sys_Printf("%i points on brush\n", pointList.size());
#endif #endif
return static_cast<int>(pointList.size()); return pointList.size();
} }
void DBrush_addFace(DBrush& brush, const _QERFaceData& faceData) void DBrush::LoadFromBrush_t(brush_t* brush, bool textured)
{
brush.AddFace(vector3_to_array(faceData.m_p0), vector3_to_array(faceData.m_p1), vector3_to_array(faceData.m_p2), 0);
}
typedef ReferenceCaller1<DBrush, const _QERFaceData&, DBrush_addFace> 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<DBrush, const _QERFaceData&, DBrush_addFaceTextured> DBrushAddFaceTexturedCaller;
void DBrush::LoadFromBrush(scene::Instance& brush, bool textured)
{ {
ClearFaces(); ClearFaces();
ClearPoints(); 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(); if(faceData == NULL)
QER_brush = brush.path().top().get_pointer(); 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 DBrush::PointPosition(vec3_t pnt)
{ {
int state = POINT_IN_BRUSH; // if nothing happens point is inside brush int state = POINT_IN_BRUSH; // if nothing happens point is inside brush
for(std::list<DPlane *>::const_iterator chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++) for(list<DPlane *>::const_iterator chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++)
{ {
float dist = (*chkPlane)->DistanceToPoint(pnt); float dist = (*chkPlane)->DistanceToPoint(pnt);
@ -172,7 +155,7 @@ int DBrush::PointPosition(vec3_t pnt)
void DBrush::ClearPoints() void DBrush::ClearPoints()
{ {
for(std::list<DPoint *>::const_iterator deadPoint=pointList.begin(); deadPoint!=pointList.end(); deadPoint++) { for(list<DPoint *>::const_iterator deadPoint=pointList.begin(); deadPoint!=pointList.end(); deadPoint++) {
delete *deadPoint; delete *deadPoint;
} }
pointList.clear(); pointList.clear();
@ -180,8 +163,8 @@ void DBrush::ClearPoints()
void DBrush::ClearFaces() void DBrush::ClearFaces()
{ {
bBoundsBuilt = false; bBoundsBuilt = FALSE;
for(std::list<DPlane *>::const_iterator deadPlane=faceList.begin(); deadPlane!=faceList.end(); deadPlane++) for(list<DPlane *>::const_iterator deadPlane=faceList.begin(); deadPlane!=faceList.end(); deadPlane++)
{ {
delete *deadPlane; delete *deadPlane;
} }
@ -197,32 +180,32 @@ void DBrush::AddPoint(vec3_t pnt)
bool DBrush::HasPoint(vec3_t pnt) bool DBrush::HasPoint(vec3_t pnt)
{ {
for(std::list<DPoint *>::const_iterator chkPoint=pointList.begin(); chkPoint!=pointList.end(); chkPoint++) for(list<DPoint *>::const_iterator chkPoint=pointList.begin(); chkPoint!=pointList.end(); chkPoint++)
{ {
if(**chkPoint == pnt) if(**chkPoint == pnt)
return true; return TRUE;
} }
return false; return FALSE;
} }
int DBrush::RemoveRedundantPlanes() int DBrush::RemoveRedundantPlanes()
{ {
int cnt = 0; int cnt = 0;
std::list<DPlane *>::iterator chkPlane; list<DPlane *>::iterator chkPlane;
// find duplicate planes // find duplicate planes
std::list<DPlane *>::iterator p1=faceList.begin(); list<DPlane *>::iterator p1=faceList.begin();
while( p1!=faceList.end() ) while( p1!=faceList.end() )
{ {
std::list<DPlane *>::iterator p2 = p1; list<DPlane *>::iterator p2 = p1;
for(p2++; p2!=faceList.end(); p2++) for(p2++; p2!=faceList.end(); p2++)
{ {
if(**p1 == **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; delete *p1;
p1 = faceList.erase(p1); // duplicate plane p1 = faceList.erase(p1); // duplicate plane
@ -283,12 +266,12 @@ bool DBrush::GetBounds(vec3_t min, vec3_t max)
BuildBounds(); BuildBounds();
if(!bBoundsBuilt) if(!bBoundsBuilt)
return false; return FALSE;
VectorCopy(bbox_min, min); VectorCopy(bbox_min, min);
VectorCopy(bbox_max, max); VectorCopy(bbox_max, max);
return true; return TRUE;
} }
bool DBrush::BBoxCollision(DBrush* chkBrush) bool DBrush::BBoxCollision(DBrush* chkBrush)
@ -300,25 +283,25 @@ bool DBrush::BBoxCollision(DBrush* chkBrush)
chkBrush->GetBounds(min2, max2); chkBrush->GetBounds(min2, max2);
if(min1[0] >= max2[0]) if(min1[0] >= max2[0])
return false; return FALSE;
if(min1[1] >= max2[1]) if(min1[1] >= max2[1])
return false; return FALSE;
if(min1[2] >= max2[2]) if(min1[2] >= max2[2])
return false; return FALSE;
if(max1[0] <= min2[0]) if(max1[0] <= min2[0])
return false; return FALSE;
if(max1[1] <= min2[1]) if(max1[1] <= min2[1])
return false; return FALSE;
if(max1[2] <= min2[2]) if(max1[2] <= min2[2])
return false; return FALSE;
return true; return TRUE;
} }
DPlane* DBrush::HasPlane(DPlane* chkPlane) DPlane* DBrush::HasPlane(DPlane* chkPlane)
{ {
for(std::list<DPlane *>::const_iterator brushPlane=faceList.begin(); brushPlane!=faceList.end(); brushPlane++) for(list<DPlane *>::const_iterator brushPlane=faceList.begin(); brushPlane!=faceList.end(); brushPlane++)
{ {
if(**brushPlane == *chkPlane) if(**brushPlane == *chkPlane)
return *brushPlane; return *brushPlane;
@ -332,21 +315,21 @@ bool DBrush::IsCutByPlane(DPlane *cuttingPlane)
if(pointList.size() == 0) if(pointList.size() == 0)
if(BuildPoints() == 0) if(BuildPoints() == 0)
return false; return FALSE;
std::list<DPoint *>::const_iterator chkPnt = pointList.begin(); list<DPoint *>::const_iterator chkPnt = pointList.begin();
if(chkPnt == pointList.end()) if(chkPnt == pointList.end())
return false; return FALSE;
float dist = cuttingPlane->DistanceToPoint((*chkPnt)->_pnt); float dist = cuttingPlane->DistanceToPoint((*chkPnt)->_pnt);
if(dist > MAX_ROUND_ERROR) if(dist > MAX_ROUND_ERROR)
isInFront = false; isInFront = FALSE;
else if(dist < MAX_ROUND_ERROR) else if(dist < MAX_ROUND_ERROR)
isInFront = true; isInFront = TRUE;
else else
return true; return TRUE;
for(chkPnt++=pointList.begin(); chkPnt!=pointList.end(); chkPnt++) for(chkPnt++=pointList.begin(); chkPnt!=pointList.end(); chkPnt++)
{ {
@ -355,32 +338,31 @@ bool DBrush::IsCutByPlane(DPlane *cuttingPlane)
if(dist > MAX_ROUND_ERROR) if(dist > MAX_ROUND_ERROR)
{ {
if(isInFront) if(isInFront)
return true; return TRUE;
} }
else if(dist < MAX_ROUND_ERROR) else if(dist < MAX_ROUND_ERROR)
{ {
if(!isInFront) if(!isInFront)
return true; return TRUE;
} }
else else
return true; return TRUE;
} }
return false; return FALSE;
} }
brush_t* DBrush::BuildInRadiant(bool allowDestruction, int* changeCnt, entity_t* entity)
scene::Node* DBrush::BuildInRadiant(bool allowDestruction, int* changeCnt, scene::Node* entity)
{ {
if(allowDestruction) if(allowDestruction)
{ {
bool kill = true; bool kill = TRUE;
for(std::list<DPlane *>::const_iterator chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++) for(list<DPlane *>::const_iterator chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++)
{ {
if((*chkPlane)->m_bChkOk) if((*chkPlane)->m_bChkOk)
{ {
kill = false; kill = FALSE;
break; 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. //+djbob: fixed bug when brush had no faces "phantom brush" in radiant.
if(faceList.size() < 4) 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; return NULL;
} }
//-djbob //-djbob
NodeSmartReference node(GlobalBrushCreator().createBrush()); QER_brush = (brush_t*)g_FuncTable.m_pfnCreateBrushHandle();
for(std::list<DPlane *>::const_iterator buildPlane=faceList.begin(); buildPlane!=faceList.end(); buildPlane++) { for(list<DPlane *>::const_iterator buildPlane=faceList.begin(); buildPlane!=faceList.end(); buildPlane++) {
if((*buildPlane)->AddToBrush(node) && changeCnt) { if((*buildPlane)->AddToBrush_t(QER_brush) && changeCnt) {
(*changeCnt)++; (*changeCnt)++;
} }
} }
if(entity) { 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 { } else {
Node_getTraversable(GlobalRadiant().getMapWorldEntity())->insert(node); g_FuncTable.m_pfnCommitBrushHandle(QER_brush);
} }
QER_entity = entity; return QER_brush;
QER_brush = node.get_pointer();
return node.get_pointer();
} }
void DBrush::CutByPlane(DPlane *cutPlane, DBrush **newBrush1, DBrush **newBrush2) 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* b1 = new DBrush;
DBrush* b2 = new DBrush; DBrush* b2 = new DBrush;
for(std::list<DPlane *>::const_iterator parsePlane=faceList.begin(); parsePlane!=faceList.end(); parsePlane++) for(list<DPlane *>::const_iterator parsePlane=faceList.begin(); parsePlane!=faceList.end(); parsePlane++)
{ {
b1->AddFace((*parsePlane)->points[0], (*parsePlane)->points[1], (*parsePlane)->points[2], NULL); b1->AddFace((*parsePlane)->points[0], (*parsePlane)->points[1], (*parsePlane)->points[2], NULL);
b2->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(pointList.size() == 0)
if(BuildPoints() == 0) if(BuildPoints() == 0)
return false; // invalid brush!!!! return FALSE; // invalid brush!!!!
if(chkBrush->pointList.size() == 0) if(chkBrush->pointList.size() == 0)
if(chkBrush->BuildPoints() == 0) if(chkBrush->BuildPoints() == 0)
return false; // invalid brush!!!! return FALSE; // invalid brush!!!!
if(!BBoxCollision(chkBrush)) if(!BBoxCollision(chkBrush))
return false; return FALSE;
std::list<DPlane *>::const_iterator iplPlane; list<DPlane *>::const_iterator iplPlane;
for( iplPlane=faceList.begin(); iplPlane!=faceList.end(); iplPlane++) for( iplPlane=faceList.begin(); iplPlane!=faceList.end(); iplPlane++)
{ {
bool allInFront = true; bool allInFront = TRUE;
for(std::list<DPoint *>::const_iterator iPoint=chkBrush->pointList.begin(); iPoint!=chkBrush->pointList.end(); iPoint++) for(list<DPoint *>::const_iterator iPoint=chkBrush->pointList.begin(); iPoint!=chkBrush->pointList.end(); iPoint++)
{ {
if((*iplPlane)->DistanceToPoint((*iPoint)->_pnt) < -MAX_ROUND_ERROR) if((*iplPlane)->DistanceToPoint((*iPoint)->_pnt) < -MAX_ROUND_ERROR)
{ {
allInFront = false; allInFront = FALSE;
break; break;
} }
} }
if(allInFront) if(allInFront)
return false; return FALSE;
} }
for( iplPlane=chkBrush->faceList.begin(); iplPlane!=chkBrush->faceList.end(); iplPlane++) for( iplPlane=chkBrush->faceList.begin(); iplPlane!=chkBrush->faceList.end(); iplPlane++)
{ {
bool allInFront = true; bool allInFront = TRUE;
for(std::list<DPoint *>::const_iterator iPoint=pointList.begin(); iPoint!=pointList.end(); iPoint++) for(list<DPoint *>::const_iterator iPoint=pointList.begin(); iPoint!=pointList.end(); iPoint++)
{ {
if((*iplPlane)->DistanceToPoint((*iPoint)->_pnt) < -MAX_ROUND_ERROR) if((*iplPlane)->DistanceToPoint((*iPoint)->_pnt) < -MAX_ROUND_ERROR)
{ {
allInFront = false; allInFront = FALSE;
break; break;
} }
} }
if(allInFront) if(allInFront)
return false; return FALSE;
} }
return true; return TRUE;
} }
bool DBrush::IntersectsWith(DPlane* p1, DPlane* p2, vec3_t v) { bool DBrush::IntersectsWith(DPlane* p1, DPlane* p2, vec3_t v) {
vec3_t vDown = { 0, 0, -1 }; vec3_t vDown = { 0, 0, -1 };
std::list<DPlane *>::const_iterator iplPlane; list<DPlane *>::const_iterator iplPlane;
for( iplPlane = faceList.begin(); iplPlane != faceList.end(); iplPlane++) { for( iplPlane = faceList.begin(); iplPlane != faceList.end(); iplPlane++) {
DPlane* p = (*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(p->PlaneIntersection(p1, p2, v)) {
if(PointPosition( v ) != POINT_OUT_BRUSH) { if(PointPosition( v ) != POINT_OUT_BRUSH) {
return true; return TRUE;
} }
} }
} }
return false; return FALSE;
} }
void DBrush::BuildBounds() void DBrush::BuildBounds()
@ -522,11 +503,11 @@ void DBrush::BuildBounds()
if(BuildPoints() == 0) if(BuildPoints() == 0)
return; return;
std::list<DPoint *>::const_iterator first = pointList.begin(); list<DPoint *>::const_iterator first = pointList.begin();
VectorCopy((*first)->_pnt, bbox_min); VectorCopy((*first)->_pnt, bbox_min);
VectorCopy((*first)->_pnt, bbox_max); VectorCopy((*first)->_pnt, bbox_max);
std::list<DPoint *>::const_iterator point=pointList.begin(); list<DPoint *>::const_iterator point=pointList.begin();
for( point++; point!=pointList.end(); point++) for( point++; point!=pointList.end(); point++)
{ {
if((*point)->_pnt[0] > bbox_max[0]) if((*point)->_pnt[0] > bbox_max[0])
@ -544,7 +525,7 @@ void DBrush::BuildBounds()
bbox_min[2] = (*point)->_pnt[2]; bbox_min[2] = (*point)->_pnt[2];
} }
bBoundsBuilt = true; bBoundsBuilt = TRUE;
} }
} }
@ -557,18 +538,18 @@ bool DBrush::BBoxTouch(DBrush *chkBrush)
chkBrush->GetBounds(min2, max2); chkBrush->GetBounds(min2, max2);
if((min1[0] - max2[0]) > MAX_ROUND_ERROR) if((min1[0] - max2[0]) > MAX_ROUND_ERROR)
return false; return FALSE;
if((min1[1] - max2[1]) > MAX_ROUND_ERROR) if((min1[1] - max2[1]) > MAX_ROUND_ERROR)
return false; return FALSE;
if((min1[2] - max2[2]) > MAX_ROUND_ERROR) if((min1[2] - max2[2]) > MAX_ROUND_ERROR)
return false; return FALSE;
if((min2[0] - max1[0]) > MAX_ROUND_ERROR) if((min2[0] - max1[0]) > MAX_ROUND_ERROR)
return false; return FALSE;
if((min2[1] - max1[1]) > MAX_ROUND_ERROR) if((min2[1] - max1[1]) > MAX_ROUND_ERROR)
return false; return FALSE;
if((min2[2] - max1[2]) > MAX_ROUND_ERROR) if((min2[2] - max1[2]) > MAX_ROUND_ERROR)
return false; return FALSE;
int cnt = 0; int cnt = 0;
@ -591,24 +572,24 @@ bool DBrush::BBoxTouch(DBrush *chkBrush)
cnt++; cnt++;
if(cnt > 1) if(cnt > 1)
return false; return FALSE;
return true; return TRUE;
} }
void DBrush::ResetChecks(std::list<Str>* exclusionList) void DBrush::ResetChecks(list<Str>* exclusionList)
{ {
for(std::list<DPlane *>::const_iterator resetPlane=faceList.begin(); resetPlane!=faceList.end(); resetPlane++) for(list<DPlane *>::const_iterator resetPlane=faceList.begin(); resetPlane!=faceList.end(); resetPlane++)
{ {
bool set = false; bool set = FALSE;
if(exclusionList) if(exclusionList)
{ {
for(std::list<Str>::iterator eTexture = exclusionList->begin(); eTexture != exclusionList->end(); eTexture++) for(list<Str>::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; break;
} }
} }
@ -620,7 +601,7 @@ void DBrush::ResetChecks(std::list<Str>* exclusionList)
DPlane* DBrush::HasPlaneInverted(DPlane *chkPlane) DPlane* DBrush::HasPlaneInverted(DPlane *chkPlane)
{ {
for(std::list<DPlane *>::const_iterator brushPlane=faceList.begin(); brushPlane!=faceList.end(); brushPlane++) for(list<DPlane *>::const_iterator brushPlane=faceList.begin(); brushPlane!=faceList.end(); brushPlane++)
{ {
if(**brushPlane != *chkPlane) if(**brushPlane != *chkPlane)
{ {
@ -633,31 +614,31 @@ DPlane* DBrush::HasPlaneInverted(DPlane *chkPlane)
bool DBrush::HasTexture(const char *textureName) bool DBrush::HasTexture(const char *textureName)
{ {
for(std::list<DPlane *>::const_iterator chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++) for(list<DPlane *>::const_iterator chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++)
{ {
if(strstr((*chkPlane)->m_shader.c_str(), textureName)) if(strstr((*chkPlane)->texInfo.m_TextureName, textureName))
return true; return TRUE;
} }
return false; return FALSE;
} }
bool DBrush::IsDetail() bool DBrush::IsDetail()
{ {
for(std::list<DPlane *>::const_iterator chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++) for(list<DPlane *>::const_iterator chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++)
{ {
if((*chkPlane)->texInfo.contents & FACE_DETAIL) if((*chkPlane)->texInfo.m_nContents & FACE_DETAIL)
return true; return TRUE;
} }
return false; return FALSE;
} }
void DBrush::BuildFromWinding(DWinding *w) void DBrush::BuildFromWinding(DWinding *w)
{ {
if(w->numpoints < 3) if(w->numpoints < 3)
{ {
globalErrorStream() << "Winding has invalid number of points"; Sys_ERROR("Winding has invalid number of points");
return; return;
} }
@ -684,7 +665,7 @@ void DBrush::SaveToFile(FILE *pFile)
{ {
fprintf(pFile, "{\n"); fprintf(pFile, "{\n");
for(std::list<DPlane *>::const_iterator pp=faceList.begin(); pp!=faceList.end(); pp++) for(list<DPlane *>::const_iterator pp=faceList.begin(); pp!=faceList.end(); pp++)
{ {
char buffer[512]; 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[0][0], (*pp)->points[0][1], (*pp)->points[0][2],
(*pp)->points[1][0], (*pp)->points[1][1], (*pp)->points[1][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)->points[2][0], (*pp)->points[2][1], (*pp)->points[2][2],
(*pp)->m_shader.c_str(), (*pp)->texInfo.m_TextureName,
(*pp)->texInfo.m_texdef.shift[0], (*pp)->texInfo.m_texdef.shift[1], (*pp)->texInfo.m_fShift[0], (*pp)->texInfo.m_fShift[1],
(*pp)->texInfo.m_texdef.scale[0], (*pp)->texInfo.m_texdef.scale[0], (*pp)->texInfo.m_fScale[0], (*pp)->texInfo.m_fScale[0],
(*pp)->texInfo.m_texdef.rotate); (*pp)->texInfo.m_fRotate);
fprintf(pFile, buffer); fprintf(pFile, buffer);
} }
@ -705,7 +686,7 @@ void DBrush::SaveToFile(FILE *pFile)
void DBrush::Rotate(vec3_t vOrigin, vec3_t vRotation) void DBrush::Rotate(vec3_t vOrigin, vec3_t vRotation)
{ {
for(std::list<DPlane *>::const_iterator rotPlane=faceList.begin(); rotPlane!=faceList.end(); rotPlane++) for(list<DPlane *>::const_iterator rotPlane=faceList.begin(); rotPlane!=faceList.end(); rotPlane++)
{ {
for(int i = 0; i < 3; i++) for(int i = 0; i < 3; i++)
VectorRotate((*rotPlane)->points[i], vRotation, vOrigin); VectorRotate((*rotPlane)->points[i], vRotation, vOrigin);
@ -729,78 +710,78 @@ bool DBrush::ResetTextures(const char* textureName, float fScale[2], float fS
{ {
if(textureName) if(textureName)
{ {
bool changed = false; bool changed = FALSE;
for(std::list<DPlane *>::const_iterator resetPlane=faceList.begin(); resetPlane!=faceList.end(); resetPlane++) for(list<DPlane *>::const_iterator resetPlane=faceList.begin(); resetPlane!=faceList.end(); resetPlane++)
{ {
if(!strcmp((*resetPlane)->m_shader.c_str(), textureName)) if(!strcmp((*resetPlane)->texInfo.m_TextureName, textureName))
{ {
if(bResetTextureName) if(bResetTextureName)
(*resetPlane)->m_shader = newTextureName; strcpy((*resetPlane)->texInfo.m_TextureName, newTextureName);
if(bResetScale[0]) if(bResetScale[0])
(*resetPlane)->texInfo.m_texdef.scale[0] = fScale[0]; (*resetPlane)->texInfo.m_fScale[0] = fScale[0];
if(bResetScale[1]) if(bResetScale[1])
(*resetPlane)->texInfo.m_texdef.scale[1] = fScale[1]; (*resetPlane)->texInfo.m_fScale[1] = fScale[1];
if(bResetShift[0]) if(bResetShift[0])
(*resetPlane)->texInfo.m_texdef.shift[0] = fShift[0]; (*resetPlane)->texInfo.m_fShift[0] = fShift[0];
if(bResetShift[1]) if(bResetShift[1])
(*resetPlane)->texInfo.m_texdef.shift[1] = fShift[1]; (*resetPlane)->texInfo.m_fShift[1] = fShift[1];
if(bResetRotation) 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 return changed; // no point rebuilding unless we need to, only slows things down
} }
else else
{ {
for(std::list<DPlane *>::const_iterator resetPlane=faceList.begin(); resetPlane!=faceList.end(); resetPlane++) for(list<DPlane *>::const_iterator resetPlane=faceList.begin(); resetPlane!=faceList.end(); resetPlane++)
{ {
if(bResetTextureName) if(bResetTextureName)
(*resetPlane)->m_shader = newTextureName; strcpy((*resetPlane)->texInfo.m_TextureName, newTextureName);
if(bResetScale[0]) if(bResetScale[0])
(*resetPlane)->texInfo.m_texdef.scale[0] = fScale[0]; (*resetPlane)->texInfo.m_fScale[0] = fScale[0];
if(bResetScale[1]) if(bResetScale[1])
(*resetPlane)->texInfo.m_texdef.scale[1] = fScale[1]; (*resetPlane)->texInfo.m_fScale[1] = fScale[1];
if(bResetShift[0]) if(bResetShift[0])
(*resetPlane)->texInfo.m_texdef.shift[0] = fShift[0]; (*resetPlane)->texInfo.m_fShift[0] = fShift[0];
if(bResetShift[1]) if(bResetShift[1])
(*resetPlane)->texInfo.m_texdef.shift[1] = fShift[1]; (*resetPlane)->texInfo.m_fShift[1] = fShift[1];
if(bResetRotation) if(bResetRotation)
(*resetPlane)->texInfo.m_texdef.rotate = (float)rotation; (*resetPlane)->texInfo.m_fRotate = (float)rotation;
} }
return true; return TRUE;
} }
} }
bool DBrush::operator ==(DBrush* other) bool DBrush::operator ==(DBrush* other)
{ {
std::list<DPlane *>::const_iterator chkPlane; list<DPlane *>::const_iterator chkPlane;
for(chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++) for(chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++)
{ {
if(!other->HasPlane((*chkPlane))) if(!other->HasPlane((*chkPlane)))
return false; return FALSE;
} }
for(chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++) for(chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++)
{ {
if(!HasPlane((*chkPlane))) if(!HasPlane((*chkPlane)))
return false; return 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); DPlane* newFace = new DPlane(va, vb, vc, textureName, bDetail);
faceList.push_back(newFace); 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 ) { DPlane* DBrush::FindPlaneWithClosestNormal( vec_t* normal ) {
vec_t bestDot = -2; vec_t bestDot = -2;
DPlane* bestDotPlane = NULL; DPlane* bestDotPlane = NULL;
std::list<DPlane *>::const_iterator chkPlane; list<DPlane *>::const_iterator chkPlane;
for( chkPlane = faceList.begin(); chkPlane != faceList.end(); chkPlane++ ) { for( chkPlane = faceList.begin(); chkPlane != faceList.end(); chkPlane++ ) {
DPlane* pPlane = (*chkPlane); DPlane* pPlane = (*chkPlane);
@ -833,7 +814,7 @@ int DBrush::FindPointsForPlane( DPlane* plane, DPoint** pnts, int maxpnts ) {
BuildPoints(); BuildPoints();
for( std::list<DPoint *>::const_iterator points = pointList.begin(); points != pointList.end(); points++ ) { for( list<DPoint *>::const_iterator points = pointList.begin(); points != pointList.end(); points++ ) {
DPoint* point = (*points); DPoint* point = (*points);
if( fabs(plane->DistanceToPoint( point->_pnt )) < MAX_ROUND_ERROR ) { 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 ) { void DBrush::RemovePlane( DPlane* plane ) {
bBoundsBuilt = false; bBoundsBuilt = FALSE;
for( std::list<DPlane *>::const_iterator deadPlane = faceList.begin(); deadPlane != faceList.end(); deadPlane++ ) { for( list<DPlane *>::const_iterator deadPlane = faceList.begin(); deadPlane != faceList.end(); deadPlane++ ) {
if(*deadPlane == plane) { if(*deadPlane == plane) {
delete *deadPlane; delete *deadPlane;
faceList.remove( plane ); faceList.remove( plane );
} }
} }
} }
void DBrush::RemoveFromRadiant( void ) {
if(QER_brush) {
g_FuncTable.m_pfnDeleteBrushHandle(QER_brush);
}
}

View file

@ -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_) #if !defined(AFX_DBRUSH_H__35B2C522_F0A7_11D4_ACF7_004095A18133__INCLUDED_)
#define AFX_DBRUSH_H__35B2C522_F0A7_11D4_ACF7_004095A18133__INCLUDED_ #define AFX_DBRUSH_H__35B2C522_F0A7_11D4_ACF7_004095A18133__INCLUDED_
#if _MSC_VER > 1000 #include "DPlane.h"
#pragma once
#endif // _MSC_VER > 1000
#include <stdio.h>
#include <list>
#include "mathlib.h"
#include "str.h"
class DPlane;
class DWinding;
class DPoint;
class _QERFaceData;
namespace scene
{
class Node;
class Instance;
}
#define POINT_IN_BRUSH 0 #define POINT_IN_BRUSH 0
#define POINT_ON_BRUSH 1 #define POINT_ON_BRUSH 1
#define POINT_OUT_BRUSH 2 #define POINT_OUT_BRUSH 2
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class DBrush class DBrush
{ {
public: 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 SaveToFile(FILE* pFile);
void Rotate(vec3_t vOrigin, vec3_t vRotation); void Rotate(vec3_t vOrigin, vec3_t vRotation);
@ -59,7 +45,7 @@ public:
DPlane* HasPlaneInverted(DPlane* chkPlane); DPlane* HasPlaneInverted(DPlane* chkPlane);
DPlane* HasPlane(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 ResetTextures(const char* textureName, float fScale[2], float fShift[2], int rotation, const char* newTextureName, int bResetTextureName, int bResetScale[2], int bResetShift[2], int bResetRotation);
bool IsDetail(); bool IsDetail();
@ -75,9 +61,9 @@ public:
int BuildPoints(); int BuildPoints();
void BuildBounds(); void BuildBounds();
void BuildFromWinding(DWinding* w); 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<Str>* exclusionList); void ResetChecks(list<Str>* exclusionList);
void ClearFaces(); void ClearFaces();
void ClearPoints(); void ClearPoints();
@ -85,11 +71,12 @@ public:
int RemoveRedundantPlanes( void ); int RemoveRedundantPlanes( void );
void RemovePlane( DPlane* plane ); void RemovePlane( DPlane* plane );
int PointPosition(vec3_t pnt); int PointPosition(vec3_t pnt);
void RemoveFromRadiant( void );
void CutByPlane(DPlane* cutPlane, DBrush** newBrush1, DBrush** newBrush2); 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); void AddPoint(vec3_t pnt);
DPlane* FindPlaneWithClosestNormal( vec_t* normal ); DPlane* FindPlaneWithClosestNormal( vec_t* normal );
@ -101,10 +88,9 @@ public:
bool operator== (DBrush* other); bool operator== (DBrush* other);
// members // members
scene::Node* QER_entity; brush_t* QER_brush;
scene::Node* QER_brush; list<DPlane*> faceList;
std::list<DPlane*> faceList; list<DPoint*> pointList;
std::list<DPoint*> pointList;
int m_nBrushID; int m_nBrushID;
vec3_t bbox_min, bbox_max; vec3_t bbox_min, bbox_max;
bool bBoundsBuilt; bool bBoundsBuilt;

View file

@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#include "StdAfx.h"
#include "DEPair.h" #include "DEPair.h"
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
@ -41,7 +42,7 @@ DEPair::~DEPair()
// Implementation // Implementation
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
void DEPair::Build(const char *pKey, const char *pValue) void DEPair::Build(char *pKey, char *pValue)
{ {
key = pKey; key = pKey;
value = pValue; value = pValue;

View file

@ -28,15 +28,13 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#pragma once #pragma once
#endif // _MSC_VER > 1000 #endif // _MSC_VER > 1000
#include "str.h"
class DEPair class DEPair
{ {
public: public:
DEPair(); DEPair();
virtual ~DEPair(); virtual ~DEPair();
void Build(const char* pKey, const char* pValue); void Build(char* pKey, char* pValue);
Str key; Str key;
Str value; Str value;

View file

@ -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) #pragma warning(disable : 4786)
#endif #endif
#include <list> #include "DEntity.h"
#include "str.h"
#include "DPoint.h"
#include "DPlane.h"
#include "DBrush.h"
#include "DEPair.h"
#include "DPatch.h"
#include "dialogs/dialogs-gtk.h" #include "dialogs/dialogs-gtk.h"
#include "misc.h" #include "misc.h"
#include "CPortals.h" #include "CPortals.h"
#include "iundo.h"
#include "ientity.h"
#include "ieclass.h"
#include "generic/referencecounted.h"
#include <vector>
#include <list>
#include <map>
#include <algorithm>
#include "scenelib.h"
const char* brushEntityList[] = { const char* brushEntityList[] = {
"worldspawn", "worldspawn",
"trigger_always", "trigger_always",
@ -78,7 +57,7 @@ const char* brushEntityList[] = {
// Construction/Destruction // Construction/Destruction
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
DEntity::DEntity(const char *classname, int ID) DEntity::DEntity(char *classname, int ID)
{ {
SetClassname(classname); SetClassname(classname);
m_nID = ID; m_nID = ID;
@ -98,7 +77,7 @@ DEntity::~DEntity()
void DEntity::ClearBrushes() void DEntity::ClearBrushes()
{ {
for(std::list<DBrush *>::const_iterator deadBrush=brushList.begin(); deadBrush!=brushList.end(); deadBrush++) for(list<DBrush *>::const_iterator deadBrush=brushList.begin(); deadBrush!=brushList.end(); deadBrush++)
{ {
delete *deadBrush; delete *deadBrush;
} }
@ -107,7 +86,7 @@ void DEntity::ClearBrushes()
void DEntity::ClearPatches() void DEntity::ClearPatches()
{ {
for(std::list<DPatch *>::const_iterator deadPatch=patchList.begin(); deadPatch!=patchList.end(); deadPatch++) for(list<DPatch *>::const_iterator deadPatch=patchList.begin(); deadPatch!=patchList.end(); deadPatch++)
{ {
delete *deadPatch; delete *deadPatch;
} }
@ -152,7 +131,7 @@ bool DEntity::LoadFromPrt(char *filename)
portals.Load(); portals.Load();
if(portals.node_count == 0) if(portals.node_count == 0)
return false; return FALSE;
ClearBrushes(); ClearBrushes();
ClearEPairs(); ClearEPairs();
@ -189,15 +168,15 @@ bool DEntity::LoadFromPrt(char *filename)
} }
if(!build) 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 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) 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) 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; DBrush* buildBrush = NULL;
for(std::list<DBrush *>::const_iterator chkBrush=brushList.begin(); chkBrush!=brushList.end(); chkBrush++) for(list<DBrush *>::const_iterator chkBrush=brushList.begin(); chkBrush!=brushList.end(); chkBrush++)
{ {
if((*chkBrush)->m_nBrushID == ID) if((*chkBrush)->m_nBrushID == ID)
{ {
@ -226,82 +205,43 @@ DBrush* DEntity::GetBrushForID(int ID)
return buildBrush; return buildBrush;
} }
template<typename Functor>
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<typename Functor>
inline const Functor& Scene_forEachSelectedBrush(const Functor& functor)
{
GlobalSelectionSystem().foreachSelected(BrushSelectedVisitor<Functor>(functor));
return functor;
}
void DEntity_loadBrush(DEntity& entity, scene::Instance& brush)
{
DBrush* loadBrush = entity.NewBrush(static_cast<int>(entity.brushList.size()));
loadBrush->LoadFromBrush(brush, true);
}
typedef ReferenceCaller1<DEntity, scene::Instance&, DEntity_loadBrush> DEntityLoadBrushCaller;
void DEntity::LoadSelectedBrushes() void DEntity::LoadSelectedBrushes()
{ {
ClearBrushes(); ClearBrushes();
ClearEPairs(); ClearEPairs();
Scene_forEachSelectedBrush(DEntityLoadBrushCaller(*this)); int count = g_FuncTable.m_pfnAllocateSelectedBrushHandles();
}
template<typename Functor> for(int i = 0; i < count; i++) {
class PatchSelectedVisitor : public SelectionSystem::Visitor brush_t *brush = (brush_t*)g_FuncTable.m_pfnGetSelectedBrushHandle(i);
{
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);
}
}
};
template<typename Functor> if(brush->pPatch)
inline const Functor& Scene_forEachSelectedPatch(const Functor& functor) continue;
{
GlobalSelectionSystem().foreachSelected(PatchSelectedVisitor<Functor>(functor));
return functor;
}
void DEntity_loadPatch(DEntity& entity, scene::Instance& patch) DBrush* loadBrush = NewBrush(i);
{ loadBrush->LoadFromBrush_t(brush, TRUE);
DPatch* loadPatch = entity.NewPatch(); }
loadPatch->LoadFromPatch(patch);
g_FuncTable.m_pfnReleaseSelectedBrushHandles();
} }
typedef ReferenceCaller1<DEntity, scene::Instance&, DEntity_loadPatch> DEntityLoadPatchCaller;
void DEntity::LoadSelectedPatches() void DEntity::LoadSelectedPatches()
{ {
ClearPatches(); ClearPatches();
ClearEPairs(); 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() bool* DEntity::BuildIntersectList()
@ -313,15 +253,15 @@ bool* DEntity::BuildIntersectList()
bool* pbIntList = new bool[max]; bool* pbIntList = new bool[max];
memset(pbIntList, 0, sizeof(bool)*(max)); memset(pbIntList, 0, sizeof(bool)*(max));
for(std::list<DBrush *>::const_iterator pB1=brushList.begin(); pB1!=brushList.end(); pB1++) for(list<DBrush *>::const_iterator pB1=brushList.begin(); pB1!=brushList.end(); pB1++)
{ {
std::list<DBrush *>::const_iterator pB2=pB1; list<DBrush *>::const_iterator pB2=pB1;
for(pB2++; pB2!=brushList.end(); pB2++) for(pB2++; pB2!=brushList.end(); pB2++)
{ {
if((*pB1)->IntersectsWith((*pB2))) if((*pB1)->IntersectsWith((*pB2)))
{ {
pbIntList[(*pB1)->m_nBrushID] = true; pbIntList[(*pB1)->m_nBrushID] = TRUE;
pbIntList[(*pB2)->m_nBrushID] = true; pbIntList[(*pB2)->m_nBrushID] = TRUE;
} }
} }
} }
@ -338,15 +278,15 @@ bool* DEntity::BuildDuplicateList()
bool* pbDupList = new bool[max]; bool* pbDupList = new bool[max];
memset(pbDupList, 0, sizeof(bool)*(max)); memset(pbDupList, 0, sizeof(bool)*(max));
for(std::list<DBrush *>::const_iterator pB1=brushList.begin(); pB1!=brushList.end(); pB1++) for(list<DBrush *>::const_iterator pB1=brushList.begin(); pB1!=brushList.end(); pB1++)
{ {
std::list<DBrush *>::const_iterator pB2=pB1; list<DBrush *>::const_iterator pB2=pB1;
for(pB2++; pB2!=brushList.end(); pB2++) for(pB2++; pB2!=brushList.end(); pB2++)
{ {
if(**pB1 == *pB2) if(**pB1 == *pB2)
{ {
pbDupList[(*pB1)->m_nBrushID] = true; pbDupList[(*pB1)->m_nBrushID] = TRUE;
pbDupList[(*pB2)->m_nBrushID] = true; pbDupList[(*pB2)->m_nBrushID] = TRUE;
} }
} }
} }
@ -359,87 +299,81 @@ void DEntity::SelectBrushes(bool *selectList)
if(selectList == NULL) if(selectList == NULL)
return; return;
GlobalSelectionSystem().setSelectedAll(false); g_FuncTable.m_pfnDeselectAllBrushes();
scene::Path path(NodeReference(GlobalSceneGraph().root())); g_FuncTable.m_pfnAllocateActiveBrushHandles();
path.push(NodeReference(*QER_Entity));
for(std::list<DBrush *>::const_iterator pBrush=brushList.begin(); pBrush!=brushList.end(); pBrush++) for(std::list<DBrush *>::const_iterator pBrush=brushList.begin(); pBrush!=brushList.end(); pBrush++)
{ {
if(selectList[(*pBrush)->m_nBrushID]) if(selectList[(*pBrush)->m_nBrushID])
{ g_FuncTable.m_pfnSelectBrush((*pBrush)->QER_brush);
path.push(NodeReference(*(*pBrush)->QER_brush));
Instance_getSelectable(*GlobalSceneGraph().find(path))->setSelected(true);
path.pop();
}
} }
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(); ClearPatches();
ClearBrushes(); ClearBrushes();
ClearEPairs(); 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; int i;
for(i = 0; brushEntityList[i]; 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; break;
} }
} }
if(!keep) if(!keep)
return false; return FALSE;
if(Node_getTraversable(ent)) int count = g_FuncTable.m_pfnAllocateEntityBrushHandles(QER_Entity);
{
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, "");
if(Node_isPatch(node)) for(i = 0; i < count; i++)
{ {
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);
Node_getTraversable(ent)->traverse(load_brushes); brush_t *brush = (brush_t*)g_FuncTable.m_pfnGetEntityBrushHandle(i);
if(brush == NULL) {
DoMessageBox("GTKRadiant returned a NULL pointer, NOT a good sign", "WARNING!!!", MB_OK);
continue;
} }
return true; 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<Str>* exclusionList, bool useDetail) void DEntity::RemoveNonCheckBrushes(list<Str>* exclusionList, bool useDetail)
{ {
std::list<DBrush *>::iterator chkBrush=brushList.begin(); list<DBrush *>::iterator chkBrush=brushList.begin();
while( chkBrush!=brushList.end() ) while( chkBrush!=brushList.end() )
{ {
@ -453,7 +387,7 @@ void DEntity::RemoveNonCheckBrushes(std::list<Str>* exclusionList, bool useDetai
} }
} }
std::list<Str>::iterator eTexture; list<Str>::iterator eTexture;
for( eTexture=exclusionList->begin(); eTexture!=exclusionList->end(); eTexture++ ) for( eTexture=exclusionList->begin(); eTexture!=exclusionList->end(); eTexture++ )
{ {
@ -470,24 +404,38 @@ void DEntity::RemoveNonCheckBrushes(std::list<Str>* exclusionList, bool useDetai
} }
} }
void DEntity::ResetChecks(std::list<Str>* exclusionList) void DEntity::ResetChecks(list<Str>* exclusionList)
{ {
for(std::list<DBrush *>::const_iterator resetBrush=brushList.begin(); resetBrush!=brushList.end(); resetBrush++) for(list<DBrush *>::const_iterator resetBrush=brushList.begin(); resetBrush!=brushList.end(); resetBrush++)
{ {
(*resetBrush)->ResetChecks(exclusionList); (*resetBrush)->ResetChecks(exclusionList);
} }
} }
int DEntity::FixBrushes() int DEntity::FixBrushes(bool rebuild)
{ {
int count = 0; g_FuncTable.m_pfnAllocateActiveBrushHandles();
for(std::list<DBrush *>::const_iterator fixBrush=brushList.begin(); fixBrush!=brushList.end(); fixBrush++) int cnt = 0;
for(list<DBrush *>::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) void DEntity::BuildInRadiant(bool allowDestruction)
@ -496,29 +444,35 @@ void DEntity::BuildInRadiant(bool allowDestruction)
if(makeEntity) 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<DEPair* >::const_iterator buildEPair=epairList.begin(); buildEPair!=epairList.end(); buildEPair++) epair_t* pEpS = GetNextChainItem(NULL, "classname", m_Classname);
epair_t* pEp = pEpS;
for(list<DEPair* >::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<DBrush *>::const_iterator buildBrush=brushList.begin(); buildBrush!=brushList.end(); buildBrush++) g_FuncTable.m_pfnCommitEntityHandleToMap(pE);
(*buildBrush)->BuildInRadiant(allowDestruction, NULL, node.get_pointer());
for(std::list<DPatch *>::const_iterator buildPatch=patchList.begin(); buildPatch!=patchList.end(); buildPatch++) for(list<DBrush *>::const_iterator buildBrush=brushList.begin(); buildBrush!=brushList.end(); buildBrush++)
(*buildPatch)->BuildInRadiant(node.get_pointer()); (*buildBrush)->BuildInRadiant(allowDestruction, NULL, pE);
QER_Entity = node.get_pointer(); for(list<DPatch *>::const_iterator buildPatch=patchList.begin(); buildPatch!=patchList.end(); buildPatch++)
(*buildPatch)->BuildInRadiant(pE);
QER_Entity = pE;
} }
else else
{ {
for(std::list<DBrush *>::const_iterator buildBrush=brushList.begin(); buildBrush!=brushList.end(); buildBrush++) for(list<DBrush *>::const_iterator buildBrush=brushList.begin(); buildBrush!=brushList.end(); buildBrush++)
(*buildBrush)->BuildInRadiant(allowDestruction, NULL); (*buildBrush)->BuildInRadiant(allowDestruction, NULL);
for(std::list<DPatch *>::const_iterator buildPatch=patchList.begin(); buildPatch!=patchList.end(); buildPatch++) for(list<DPatch *>::const_iterator buildPatch=patchList.begin(); buildPatch!=patchList.end(); buildPatch++)
(*buildPatch)->BuildInRadiant(); (*buildPatch)->BuildInRadiant();
} }
} }
@ -527,14 +481,14 @@ void DEntity::BuildInRadiant(bool allowDestruction)
int DEntity::GetIDMax( void ) { int DEntity::GetIDMax( void ) {
int max = -1; int max = -1;
for(std::list<DBrush *>::const_iterator cntBrush=brushList.begin(); cntBrush!=brushList.end(); cntBrush++) { for(list<DBrush *>::const_iterator cntBrush=brushList.begin(); cntBrush!=brushList.end(); cntBrush++) {
if((*cntBrush)->m_nBrushID > max) if((*cntBrush)->m_nBrushID > max)
max = (*cntBrush)->m_nBrushID; max = (*cntBrush)->m_nBrushID;
} }
return max+1; return max+1;
} }
void DEntity::SetClassname( const char *classname ) { void DEntity::SetClassname( char *classname ) {
m_Classname = classname; m_Classname = classname;
} }
@ -544,12 +498,12 @@ void DEntity::SaveToFile(FILE *pFile)
fprintf(pFile, "\"classname\" \"%s\"\n", (const char *)m_Classname); fprintf(pFile, "\"classname\" \"%s\"\n", (const char *)m_Classname);
for(std::list<DEPair *>::const_iterator ep=epairList.begin(); ep!=epairList.end(); ep++) for(list<DEPair *>::const_iterator ep=epairList.begin(); ep!=epairList.end(); ep++)
{ {
fprintf(pFile, "\"%s\" \"%s\"\n", (const char *)(*ep)->key, (const char *)(*ep)->value); fprintf(pFile, "\"%s\" \"%s\"\n", (const char *)(*ep)->key, (const char *)(*ep)->value);
} }
for(std::list<DBrush *>::const_iterator bp=brushList.begin(); bp!=brushList.end(); bp++) for(list<DBrush *>::const_iterator bp=brushList.begin(); bp!=brushList.end(); bp++)
{ {
(*bp)->SaveToFile(pFile); (*bp)->SaveToFile(pFile);
} }
@ -559,14 +513,14 @@ void DEntity::SaveToFile(FILE *pFile)
void DEntity::ClearEPairs() void DEntity::ClearEPairs()
{ {
for(std::list<DEPair *>::const_iterator deadEPair=epairList.begin(); deadEPair!=epairList.end(); deadEPair++) for(list<DEPair *>::const_iterator deadEPair=epairList.begin(); deadEPair!=epairList.end(); deadEPair++)
{ {
delete (*deadEPair); delete (*deadEPair);
} }
epairList.clear(); epairList.clear();
} }
void DEntity::AddEPair(const char *key, const char *value) { void DEntity::AddEPair(char *key, char *value) {
DEPair* newEPair; DEPair* newEPair;
newEPair = FindEPairByKey( key ); newEPair = FindEPairByKey( key );
if(!newEPair) { 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 epair_t* ep = epl;
while(ep)
{ {
DEntity* m_entity; if(!strcmp(ep->key, "classname"))
public: SetClassname(ep->value);
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 else
m_entity->AddEPair(key, value); AddEPair(ep->key, ep->value);
ep = ep->next;
} }
} load_epairs(this);
epl->forEachKeyValue(load_epairs);
} }
bool DEntity::ResetTextures(const char* textureName, float fScale[2], float fShift[2], int rotation, const char* newTextureName, 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) int bResetTextureName, int bResetScale[2], int bResetShift[2], int bResetRotation, bool rebuild)
{ {
bool reset = false; g_FuncTable.m_pfnDeselectAllBrushes();
for(std::list<DBrush *>::const_iterator resetBrush=brushList.begin(); resetBrush!=brushList.end(); resetBrush++) g_FuncTable.m_pfnAllocateActiveBrushHandles();
bool reset = FALSE;
for(list<DBrush *>::const_iterator resetBrush=brushList.begin(); resetBrush!=brushList.end(); resetBrush++)
{ {
bool tmp = (*resetBrush)->ResetTextures(textureName, fScale, fShift, rotation, newTextureName, bool tmp = (*resetBrush)->ResetTextures(textureName, fScale, fShift, rotation, newTextureName,
bResetTextureName, bResetScale, bResetShift, bResetRotation); bResetTextureName, bResetScale, bResetShift, bResetRotation);
if(tmp) if(tmp)
{ {
reset = true; reset = TRUE;
if(rebuild) if(rebuild)
{ {
Node_getTraversable(*(*resetBrush)->QER_entity)->erase(*(*resetBrush)->QER_brush); entity_t *pE = (*resetBrush)->QER_brush->owner;
(*resetBrush)->BuildInRadiant(false, NULL, (*resetBrush)->QER_entity); g_FuncTable.m_pfnDeleteBrushHandle((*resetBrush)->QER_brush);
(*resetBrush)->BuildInRadiant(FALSE, NULL, pE->entityId == 0 ? NULL : pE);
if( pE->entityId == 0 ? NULL : pE )
{
}
} }
} }
} }
if(bResetTextureName) if(bResetTextureName)
{ {
for(std::list<DPatch *>::const_iterator resetPatch=patchList.begin(); resetPatch!=patchList.end(); resetPatch++) for(list<DPatch *>::const_iterator resetPatch=patchList.begin(); resetPatch!=patchList.end(); resetPatch++)
{ {
bool tmp = (*resetPatch)->ResetTextures(textureName, newTextureName); bool tmp = (*resetPatch)->ResetTextures(textureName, newTextureName);
if(tmp) if(tmp)
{ {
reset = true; reset = TRUE;
if(rebuild) if(rebuild)
{ {
Node_getTraversable(*(*resetPatch)->QER_entity)->erase(*(*resetPatch)->QER_brush); entity_t *pE = (*resetPatch)->QER_brush->owner;
(*resetPatch)->BuildInRadiant((*resetPatch)->QER_entity); g_FuncTable.m_pfnDeleteBrushHandle((*resetPatch)->QER_brush);
(*resetPatch)->BuildInRadiant(pE->entityId == 0 ? NULL : pE);
} }
} }
} }
} }
g_FuncTable.m_pfnReleaseActiveBrushHandles();
return reset; return reset;
} }
DEPair* DEntity::FindEPairByKey(const char* keyname) DEPair* DEntity::FindEPairByKey(const char* keyname)
{ {
for(std::list<DEPair *>::const_iterator ep=epairList.begin(); ep!=epairList.end(); ep++) for(list<DEPair *>::const_iterator ep=epairList.begin(); ep!=epairList.end(); ep++)
{ {
char* c = (*ep)->key; char* c = (*ep)->key;
if(!strcmp(c, keyname)) if(!strcmp(c, keyname))
@ -656,7 +615,7 @@ DEPair* DEntity::FindEPairByKey(const char* keyname)
void DEntity::RemoveFromRadiant() void DEntity::RemoveFromRadiant()
{ {
Node_getTraversable(GlobalSceneGraph().root())->erase(*QER_Entity); g_EntityTable.m_pfnEntity_Free( (entity_t*)QER_Entity );
QER_Entity = NULL; QER_Entity = NULL;
} }
@ -685,9 +644,9 @@ void DEntity::SpawnFloat(const char* key, const char* defaultstring, float* out)
{ {
DEPair* pEP = FindEPairByKey(key); DEPair* pEP = FindEPairByKey(key);
if(pEP) { if(pEP) {
*out = static_cast<float>(atof(pEP->value)); *out = static_cast< float >( atof( pEP->value ) );
} else { } else {
*out = static_cast<float>(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 ) { int DEntity::GetBrushCount( void ) {
return static_cast<int>(brushList.size()); return brushList.size();
} }
DBrush* DEntity::FindBrushByPointer( scene::Node& brush ) { DBrush* DEntity::FindBrushByPointer( brush_t* brush ) {
for(std::list<DBrush *>::const_iterator listBrush = brushList.begin(); listBrush != brushList.end(); listBrush++) { for(list<DBrush *>::const_iterator listBrush = brushList.begin(); listBrush != brushList.end(); listBrush++) {
DBrush* pBrush = (*listBrush); DBrush* pBrush = (*listBrush);
if(pBrush->QER_brush == &brush) { if(pBrush->QER_brush == brush) {
return pBrush; return pBrush;
} }
} }

View file

@ -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_) #if !defined(AFX_DENTITY_H__35B2C523_F0A7_11D4_ACF7_004095A18133__INCLUDED_)
#define 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 #if _MSC_VER > 1000
#pragma once #pragma once
#endif // _MSC_VER > 1000 #endif // _MSC_VER > 1000
#include <list>
#include "str.h"
#include "mathlib.h"
class DEPair;
class DBrush;
class DPlane;
class DPatch;
class Entity;
namespace scene
{
class Node;
}
class _QERFaceData;
class DEntity class DEntity
{ {
public: public:
void RemoveFromRadiant(); void RemoveFromRadiant();
scene::Node* QER_Entity; entity_t* QER_Entity;
int m_nID; int m_nID;
// Constrcution/Destruction // Constrcution/Destruction
DEntity(const char* classname = "worldspawn", int ID = -1); // sets classname DEntity(char* classname = "worldspawn", int ID = -1); // sets classname
virtual ~DEntity(); virtual ~DEntity();
// --------------------------------------------- // ---------------------------------------------
// epair functions........ // epair functions........
void LoadEPairList(Entity* epl); void LoadEPairList(epair_t* epl);
void AddEPair(const char* key, const char* value); void AddEPair(char* key, char* value);
void ClearEPairs(); void ClearEPairs();
DEPair* FindEPairByKey(const char* keyname); DEPair* FindEPairByKey(const char* keyname);
// --------------------------------------------- // ---------------------------------------------
@ -66,16 +55,16 @@ public:
// random functions........ // 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); 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 SaveToFile(FILE* pFile);
void SetClassname(const char* classname); void SetClassname(char* classname);
int GetIDMax(); int GetIDMax();
void BuildInRadiant(bool allowDestruction); void BuildInRadiant(bool allowDestruction);
void ResetChecks(std::list<Str>* exclusionList); void ResetChecks(list<Str>* exclusionList);
void RemoveNonCheckBrushes(std::list<Str>* exclusionList, bool useDetail); void RemoveNonCheckBrushes(list<Str>* exclusionList, bool useDetail);
DPlane* AddFaceToBrush(vec3_t va, vec3_t vb, vec3_t vc, _QERFaceData* faceData, int ID); // slow, try not to use much DPlane* AddFaceToBrush(vec3_t va, vec3_t vb, vec3_t vc, _QERFaceData* faceData, int ID); // slow, try not to use much
int GetBrushCount( void ); int GetBrushCount( void );
DBrush* FindBrushByPointer( scene::Node& brush ); DBrush* FindBrushByPointer( brush_t* brush );
// --------------------------------------------- // ---------------------------------------------
@ -100,17 +89,18 @@ public:
// --------------------------------------------- // ---------------------------------------------
// vars // vars
std::list<DEPair*> epairList; list<DEPair*> epairList;
std::list<DBrush*> brushList; list<DBrush*> brushList;
// new patches, wahey!!! // new patches, wahey!!!
std::list<DPatch*> patchList; list<DPatch*> patchList;
Str m_Classname; 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 LoadSelectedBrushes();
void LoadSelectedPatches(); void LoadSelectedPatches();

View file

@ -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;
}

View file

@ -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_)

View file

@ -21,29 +21,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#include "StdAfx.h"
#include "DMap.h" #include "DMap.h"
#include "str.h"
#include <list>
#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 <vector>
#include <list>
#include <map>
#include <algorithm>
#include "scenelib.h"
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// Construction/Destruction // Construction/Destruction
@ -77,7 +57,7 @@ void DMap::ClearEntities()
{ {
m_nNextEntity = 1; m_nNextEntity = 1;
for(std::list<DEntity *>::const_iterator deadEntity=entityList.begin(); deadEntity!=entityList.end(); deadEntity++) for(list<DEntity *>::const_iterator deadEntity=entityList.begin(); deadEntity!=entityList.end(); deadEntity++)
delete *deadEntity; delete *deadEntity;
entityList.clear(); entityList.clear();
@ -87,7 +67,7 @@ DEntity* DMap::GetEntityForID(int ID)
{ {
DEntity* findEntity = NULL; DEntity* findEntity = NULL;
for(std::list<DEntity *>::const_iterator chkEntity=entityList.begin(); chkEntity!=entityList.end(); chkEntity++) for(list<DEntity *>::const_iterator chkEntity=entityList.begin(); chkEntity!=entityList.end(); chkEntity++)
{ {
if((*chkEntity)->m_nID == ID) if((*chkEntity)->m_nID == ID)
{ {
@ -110,7 +90,7 @@ DEntity* DMap::GetWorldSpawn()
void DMap::BuildInRadiant(bool bAllowDestruction) void DMap::BuildInRadiant(bool bAllowDestruction)
{ {
for(std::list<DEntity *>::const_iterator buildEntity=entityList.begin(); buildEntity!=entityList.end(); buildEntity++) for(list<DEntity *>::const_iterator buildEntity=entityList.begin(); buildEntity!=entityList.end(); buildEntity++)
(*buildEntity)->BuildInRadiant(bAllowDestruction); (*buildEntity)->BuildInRadiant(bAllowDestruction);
} }
@ -118,37 +98,45 @@ void DMap::LoadAll(bool bLoadPatches)
{ {
ClearEntities(); ClearEntities();
GlobalSelectionSystem().setSelectedAll(false); g_FuncTable.m_pfnDeselectAllBrushes();
class load_entities_t : public scene::Traversable::Walker int count = g_FuncTable.m_pfnGetEntityCount();
{
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);
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; int count = 0;
for(std::list<DEntity *>::const_iterator fixEntity=entityList.begin(); fixEntity!=entityList.end(); fixEntity++) for(list<DEntity *>::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; 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, 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) int bResetTextureName, int bResetScale[2], int bResetShift[2], int bResetRotation)
{ {
for(std::list<DEntity *>::const_iterator texEntity=entityList.begin(); texEntity!=entityList.end(); texEntity++) for(list<DEntity *>::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, (*texEntity)->ResetTextures(textureName, fScale, fShift, rotation, newTextureName,
bResetTextureName, bResetScale, bResetShift, bResetRotation, true); bResetTextureName, bResetScale, bResetShift, bResetRotation, TRUE);
else else
{ {
if((*texEntity)->ResetTextures( textureName, fScale, fShift, rotation, newTextureName, if((*texEntity)->ResetTextures( textureName, fScale, fShift, rotation, newTextureName,
bResetTextureName, bResetScale, bResetShift, bResetRotation, false)) bResetTextureName, bResetScale, bResetShift, bResetRotation, FALSE))
RebuildEntity(*texEntity); RebuildEntity(*texEntity);
} }
} }
@ -174,5 +162,5 @@ void DMap::ResetTextures( const char* textureName, float fScale[2], float f
void DMap::RebuildEntity(DEntity *ent) void DMap::RebuildEntity(DEntity *ent)
{ {
ent->RemoveFromRadiant(); ent->RemoveFromRadiant();
ent->BuildInRadiant(false); ent->BuildInRadiant(FALSE);
} }

View file

@ -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_) #if !defined(AFX_DMAP_H__ACAE597A_D26D_49AD_AA69_EDE743DB54FA__INCLUDED_)
#define 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 #if _MSC_VER > 1000
#pragma once #pragma once
#endif // _MSC_VER > 1000 #endif // _MSC_VER > 1000
#include <list>
class DEntity;
class DMap class DMap
{ {
public: public:
static void RebuildEntity(DEntity* ent); 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 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); void BuildInRadiant(bool bAllowDestruction);
int m_nNextEntity; int m_nNextEntity;
DEntity* GetWorldSpawn(); DEntity* GetWorldSpawn();
void ClearEntities(); void ClearEntities();
DEntity* GetEntityForID(int ID); DEntity* DMap::GetEntityForID(int ID);
DEntity* AddEntity(char* classname = "worldspawn", int ID = -1); DEntity* AddEntity(char* classname = "worldspawn", int ID = -1);
std::list<DEntity*> entityList; list<DEntity*> entityList;
DMap(); DMap();
virtual ~DMap(); virtual ~DMap();
int FixBrushes(); int FixBrushes(bool rebuild);
}; };
#endif // !defined(AFX_DMAP_H__ACAE597A_D26D_49AD_AA69_EDE743DB54FA__INCLUDED_) #endif // !defined(AFX_DMAP_H__ACAE597A_D26D_49AD_AA69_EDE743DB54FA__INCLUDED_)

View file

@ -21,14 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#include "StdAfx.h"
#include "DPatch.h" #include "DPatch.h"
#include <list>
#include "str.h"
#include "scenelib.h"
#include "ipatch.h"
#include "misc.h" #include "misc.h"
#include "./dialogs/dialogs-gtk.h" #include "./dialogs/dialogs-gtk.h"
@ -46,7 +40,7 @@ DPatch::DPatch()
{ {
width = MIN_PATCH_WIDTH; width = MIN_PATCH_WIDTH;
height = MIN_PATCH_HEIGHT; height = MIN_PATCH_HEIGHT;
QER_entity = NULL; QER_patch = NULL;
QER_brush = NULL; QER_brush = NULL;
} }
@ -70,53 +64,27 @@ void CopyDrawVert(const drawVert_t* in, drawVert_t* out)
VectorCopy(in->xyz, out->xyz); 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(); int nIndex = g_FuncTable.m_pfnCreatePatchHandle();
//$ FIXME: m_pfnGetPatchHandle //$ FIXME: m_pfnGetPatchHandle
patchMesh_t* pm = g_FuncTable.m_pfnGetPatchData(nIndex); patchMesh_t* pm = g_FuncTable.m_pfnGetPatchData(nIndex);
b->patchBrush = true; pm->height = height;
b->pPatch = Patch_Alloc(); pm->width = width;
b->pPatch->setDims(width,height);
for(int x = 0; x < width; x++) for(int x = 0; x < width; x++)
for(int y = 0; y < height; y++) for(int y = 0; y < height; y++)
CopyDrawVert(&points[x][y], &pm->ctrl[x][y]); CopyDrawVert(&points[x][y], &pm->ctrl[x][y]);
QER_patch = pm;
/* if(entity) /* if(entity)
{ {
// strcpy(pm->d_texture->name, texture); // strcpy(pm->d_texture->name, texture);
brush_t* brush = (brush_t*)g_FuncTable.m_pfnCreateBrushHandle(); brush_t* brush = (brush_t*)g_FuncTable.m_pfnCreateBrushHandle();
brush->patchBrush = true; brush->patchBrush = TRUE;
brush->pPatch = pm; brush->pPatch = pm;
pm->pSymbiot = brush; pm->pSymbiot = brush;
@ -135,52 +103,27 @@ void DPatch::BuildInRadiant(scene::Node* entity)
g_FuncTable.m_pfnCommitPatchHandleToMap(nIndex, pm, texture); g_FuncTable.m_pfnCommitPatchHandleToMap(nIndex, pm, texture);
QER_brush = pm->pSymbiot; 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 = brush;
QER_brush = patch.path().top().get_pointer(); QER_patch = brush->pPatch;
PatchControlMatrix matrix = GlobalPatchCreator().Patch_getControlPoints(patch.path().top()); SetTexture(QER_patch->pShader->getName());
width = static_cast<int>(matrix.x()); for(int x = 0; x < QER_patch->width; x++)
height = static_cast<int>(matrix.y()); 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++) width = QER_patch->width;
{ height = QER_patch->height;
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()));
#if 0 void DPatch::RemoveFromRadiant()
SetTexture(brush->pPatch->GetShader()); {
if(QER_brush)
width = brush->pPatch->getWidth(); g_FuncTable.m_pfnDeleteBrushHandle(QER_brush);
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
} }
bool DPatch::ResetTextures(const char *oldTextureName, const char *newTextureName) 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)) if( !oldTextureName || !strcmp(texture, oldTextureName))
{ {
strcpy(texture, newTextureName); 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], 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) void Print1dArray(vec3_t* array, int size)
{ {
for(int i = 0; i < size; i++) for(int i = 0; i < size; i++)
globalOutputStream() << "(" << array[i][0] << " " << array[i][1] << " " << array[i][2] << ")\t"; Sys_Printf("(%.0f %.0f %.0f)\t", array[i][0], array[i][1], array[i][2]);
globalOutputStream() << "\n"; Sys_Printf("\n");
} }
bool Compare1dArrays(vec3_t* a1, vec3_t* a2, int size) 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; int i;
for(i = 0; i < p1->height; i++, y++) for(i = 0; i < p1->height; i++, y++)
for(int x = 0; x < p1->width; x++) 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(i = 1; i < p2->height; i++, y++)
for(int x = 0; x < p2->width; x++) 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(); // newPatch->Invert();
@ -335,13 +278,16 @@ DPatch* DPatch::MergePatches(patch_merge_t merge_info, DPatch *p1, DPatch *p2)
void DPatch::Invert() void DPatch::Invert()
{ {
drawVert_t vertTemp;
int i, j; int i, j;
for(i = 0 ; i < width ; i++ ) for(i = 0 ; i < width ; i++ )
{ {
for(j = 0; j < height / 2; j++) 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() void DPatch::Transpose()
{ {
int i, j, w; int i, j, w;
drawVert_t dv;
if ( width > height ) if ( width > height )
{ {
@ -359,12 +306,14 @@ void DPatch::Transpose()
if ( j < height ) if ( j < height )
{ {
// swap the value // 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 else
{ {
// just copy // 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 ) if ( j < width )
{ {
// swap the value // 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 else
{ {
// just copy // 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(); Invert();
} }
std::list<DPatch> DPatch::Split(bool rows, bool cols) list<DPatch> DPatch::Split(bool rows, bool cols)
{ {
std::list<DPatch> patchList; list<DPatch> patchList;
int i; int i;
int x, y; int x, y;
@ -416,7 +367,7 @@ std::list<DPatch> DPatch::Split(bool rows, bool cols)
{ {
for(x = 0; x < p.width; x++) 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); patchList.push_back(p);
@ -424,13 +375,13 @@ std::list<DPatch> DPatch::Split(bool rows, bool cols)
if(cols && width >= 5) if(cols && width >= 5)
{ {
std::list<DPatch> patchList2; list<DPatch> patchList2;
for(std::list<DPatch>::iterator patches = patchList.begin(); patches != patchList.end(); patches++) for(list<DPatch>::iterator patches = patchList.begin(); patches != patchList.end(); patches++)
{ {
std::list<DPatch> patchList3 = (*patches).Split(false, true); list<DPatch> patchList3 = (*patches).Split(false, true);
for(std::list<DPatch>::iterator patches2 = patchList3.begin(); patches2 != patchList3.end(); patches2++) for(list<DPatch>::iterator patches2 = patchList3.begin(); patches2 != patchList3.end(); patches2++)
patchList2.push_front(*patches2); patchList2.push_front(*patches2);
} }
@ -451,7 +402,7 @@ std::list<DPatch> DPatch::Split(bool rows, bool cols)
{ {
for(y = 0; y < p.height; y++) 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));
} }
} }

Some files were not shown because too many files have changed in this diff Show more