git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant@1 8a3a26a2-13c4-0310-b231-cf6edde360e5
This commit is contained in:
TTimo 2006-02-10 22:01:20 +00:00
commit 12b372f89c
1589 changed files with 431686 additions and 0 deletions

7830
CHANGES Normal file

File diff suppressed because it is too large Load diff

1
COMPILING Normal file
View file

@ -0,0 +1 @@
see docs/developer/README

82
CONTRIBUTORS Normal file
View file

@ -0,0 +1,82 @@
GtkRadiant CONTRIBUTORS and CREDITS
last update: 09/12/2004
=======================
Loki
----
Leonardo Zide leo@lokigames.com
Mike Phillips (Loki QA)
Bernd Kreimeier (overall coordination)
QER.com
-------
TTimo timo@idsoftware.com
^Fishman (Pablo Zurita) fish@gamedesign.net
RR2DO2 rr2do2@q3f.com
SmallPileofGibs spog@planetquake.com
Curry plugin
------------
Mike "mickey" Jackman
Tim "Maj" Rennie
PrtView plugin, various bug fixes and q3map guru
------------------------------------------------
Geoffrey DeWan
Gensurf plugin
--------------
David Hyde
PicoModel
---------
seaw0lf with assist by ydnar
Q3Map2
------
Randy 'ydnar' Reddig
Updated shader files, textures, entities.def, keyboard shortcut list
overall testing and feedback
----------------------------
Jean-Francois "Eutectic" Groleau
Improvements and bug fixing
---------------------------
Jan Paul "MrElusive" van Waveren
Robert Duffy
Forest "LordHavoc" Wroncy-Hale
Nurail
AcidDeath
Chronos
Michael Schlueter
Jamie Wilkinson
Robert "Tr3B" Beckebans
Web
---
Dave "Bargle" Koenig
Jason "Wolfen" Spencer
Shawn "EvilTypeGuy" Walker
Thanks to John Hutton, AstroCreep and W2k for web help
FAQ
---
Equim and Wex
Testing/Feedback
---
Black_Dog, d0nkey, Fjoggis, Jago, jetscreamer, gibbie, Godmil, Gom Jabbar,
Mindlink, mslaf, necros, Promit, Ravo, RPG, scampie, sock, sponge, thiste,
voodoochopsticks, Zwiffle
Misc
----
Thanks to everyone on the beta mailing list and
irc.telefragged.com #qeradiant for testing and feedback.
Updated icons by AstroCreep!
Bitch-slapping by RaYGunn!
Last minute bugs by SPoG! (SPoG--)

47
DoxyConfig Normal file
View file

@ -0,0 +1,47 @@
# Included Doxygen Config file
#---------------------------------------------------------------------------
# Project name & version number
#---------------------------------------------------------------------------
PROJECT_NAME =
PROJECT_NUMBER =
#---------------------------------------------------------------------------
# Where to put the output
# Note: The images dir should be next to the created html dir within the
# output dir.
# eg;
# [Current Dir]
# L__[OUTPUT_DIRECTORY]
# L__[html]
# L__[images]
#---------------------------------------------------------------------------
OUTPUT_DIRECTORY = ../GtkRadiant-doxygen
#---------------------------------------------------------------------------
# Where to read the sources
# you can add more than one source...
# INPUT = radiant/ \
# tools/quake3/q3map \
# tools/quake3/q3data
#
# Recursive is set on, so setting it to ./ (current dir) would read source
# files recursively from the current dir down. (which would take a while)
#
# eg: To document just include, if the current directory is ../GtkRadiant/
# then...
#---------------------------------------------------------------------------
INPUT = radiant/
#---------------------------------------------------------------------------
# Misc settings
# TAB_SIZE - sets the indenting for the inline source and the source
# browser
# INCLUDE_PATH - will include documentation for included files from other
# packages. You can specify more than one path the same as
# shown in the INPUT example Leave it blank if you don't want
# this.
# PERL_PATH - path to the perl executable
#
#---------------------------------------------------------------------------
PERL_PATH = /usr/bin/perl

1117
Doxyfile Normal file

File diff suppressed because it is too large Load diff

159
Doxygen_files/Doxyfile Normal file
View file

@ -0,0 +1,159 @@
# Doxyfile 1.2.5-20010304
#---------------------------------------------------------------------------
# General configuration options
#---------------------------------------------------------------------------
PROJECT_NAME =
PROJECT_NUMBER =
OUTPUT_DIRECTORY =
OUTPUT_LANGUAGE = English
EXTRACT_ALL = YES
EXTRACT_PRIVATE = YES
EXTRACT_STATIC = YES
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ALWAYS_DETAILED_SEC = YES
FULL_PATH_NAMES = YES
STRIP_FROM_PATH = $(PWD)/
INTERNAL_DOCS = YES
CLASS_DIAGRAMS = YES
SOURCE_BROWSER = YES
INLINE_SOURCES = YES
STRIP_CODE_COMMENTS = NO
CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = NO
VERBATIM_HEADERS = YES
SHOW_INCLUDE_FILES = YES
JAVADOC_AUTOBRIEF = YES
INHERIT_DOCS = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
DISTRIBUTE_GROUP_DOC = NO
TAB_SIZE = 2
ENABLED_SECTIONS =
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
ALIASES =
MAX_INITIALIZER_LINES = 30
OPTIMIZE_OUTPUT_FOR_C = NO
SHOW_USED_FILES = YES
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = YES
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE = doxygen.log
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT =
FILE_PATTERNS = *.h \
*.cpp \
*.c
RECURSIVE = YES
EXCLUDE =
EXCLUDE_PATTERNS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
IMAGE_PATH =
INPUT_FILTER =
FILTER_SOURCE_FILES = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX = 4
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT =
HTML_HEADER = Doxygen_files/doxygen_gtkradiant_head.html
HTML_FOOTER = Doxygen_files/doxygen_gtkradiant_foot.html
HTML_STYLESHEET = Doxygen_files/doxygen_gtkradiant.css
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
GENERATE_CHI = NO
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO
TREEVIEW_WIDTH = 250
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = NO
LATEX_OUTPUT =
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = NO
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT =
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT =
MAN_EXTENSION = .3
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED =
#---------------------------------------------------------------------------
# Configuration::addtions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
HAVE_DOT = YES
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
GRAPHICAL_HIERARCHY = YES
DOT_PATH =
MAX_DOT_GRAPH_WIDTH = 1024
MAX_DOT_GRAPH_HEIGHT = 1024
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::addtions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = NO
CGI_NAME = search.cgi
CGI_URL =
DOC_URL =
DOC_ABSPATH =
BIN_ABSPATH = /usr/local/bin/
EXT_DOC_PATHS =
#---------------------------------------------------------------------------
# Include file, at the bottom to over-ride anything I missed.
#---------------------------------------------------------------------------
@INCLUDE = genConf

View file

@ -0,0 +1,45 @@
/*
** Doxygen index.html generation file
**
*/
/*! \mainpage +project+ Doxygen Index
<img src="../images/gtkr_splash.jpg" align="right" hspace="2" vspace="2">
\section intro Introduction
This documentation was generated from GtkRadiant source code using Doxygen.<br>
Generated from source in: +target+
\section links Links
<b>General Links</b><br>
<a href="http://www.doxygen.org">Doxygen Homepage</a><br>
<a href="http://www.gtkradiant.com">GtkRadiant Homepage</a><br>
<a href="http://zerowing.idsoftare.com">Zerowing - GtkRadiant Development</a><br>
<b>Local Links</b><br>
<a href="../reference/index.html">Doxygen Quick Reference (Local)</a><br>
<p>
<b>GtkRadiant FAQ Links</b><br>
<a href="http://www.qeradiant.com/faq/fom-serve/cache/115.html">GtkRadiant FAQ</a><br>
<a href="http://www.qeradiant.com/faq/fom-serve/cache/181.html">GtkRadiant FAQ: Open Tasks</a><br>
<a href="http://www.qeradiant.com/faq/fom-serve/cache/116.html">GtkRadiant FAQ: Compiling instructions</a><br>
<a href="http://www.qeradiant.com/faq/fom-serve/cache/116.html">GtkRadiant FAQ: Creating/Submitting patches</a><br>
<a href="http://www.qeradiant.com/faq/fom-serve/cache/141.html">GtkRadiant FAQ: Coding Conventions & Guidelines</a><br>
</p>
<b>Misc Links</b><br>
<a href="http://www.idsoftware.com">idsoftware.com</a><br>
<p>
<i>
* Note: The content on this page was generated from <a href="doxy__mainpage_8h.html">this</A> file.
It is moved into the <target> path when the doxygen documentation is generated, and removed immediately
afterwards.
</i>
</p>
<i>This page generated: by <b>+user+</b> on <b>+machine+</b><br>
On +date+
</i>
*/

View file

@ -0,0 +1,34 @@
body { background-color: black; }
IMG { border-color: #222222; border: 0; }
em { font-size: 11px; font-style: italic; font-weight: normal; color: #888888; }
H1 { text-align: center; font-size: 15px; color: #2222AA; font-family: Geneva, Verdana, Helvetica, Arial, sans-serif; }
H3 { text-align: center; font-size: 18px; color: #2222AA; font-family: Geneva, Verdana, Helvetica, Arial, sans-serif; }
A { text-decoration: none; color: #6666DD; }
A:HOVER { text-decoration: underline; color: #4444FF; }
A:VISITED { text-decoration: none; color: #8888AA; }
A.qindex { text-decoration: none; color: #6666DD; font-size: 11px; }
A.qindex:HOVER { text-decoration: underline; color: #4444FF; font-size: 11px; }
A.qindex:VISITED { text-decoration: none; color: #8888AA; font-size: 11px; }
A.qindexRef { font-size: 11px; }
A.el { text-decoration: none; font-weight: bold; }
A.elRef { font-weight: bold; }
A.code { text-decoration: none; font-weight: normal; color: #6666DD; }
A.code:HOVER { text-decoration: underline; font-weight: normal; color: #4444FF; }
A.code:VISITED { text-decoration: none; font-weight: normal; color: #8888AA; }
A.codeRef { text-decoration: none; font-weight: normal; color: #6666DD; }
A.codeRef:HOVER { text-decoration: underline; font-weight: normal; color: #4444FF; }
A.codeRef:VISITED { text-decoration: none; font-weight: normal; color: #8888AA; }
DL.el { margin-left: 2cm; width: 99%; }
DIV.fragment { background-color: #FFFFFF; width: 99%; }
DIV.ah { background-color: #AAAAAA; width: 99%; margin-bottom: 3; margin-top: 3; }
TD.md { cellpadding: 0; background-color: #DDDDDD; border: 0; width: 99%; color: #222222; }
DIV.groupHeader { margin-left: 16; margin-top: 12; margin-bottom: 6; font-weight: bold; color: #222222; }
DIV.groupText { margin-left: 16; font-style: italic; font-size: smaller; }
FONT.keyword { color: #0080A0; }
FONT.keywordtype { color: #604020; }
FONT.keywordflow { color: #E08000; }
FONT.comment { color: #800000; }
FONT.comment { color: #009900; text-decoration: italic; }
FONT.preprocessor { color: #806020; }
FONT.stringliteral{ color: #002080; }
FONT.charliteral { color: #008080; }

View file

@ -0,0 +1,49 @@
<!-- ---------------- Start Footer ----------------- -->
</td></tr></table>
</center>
<br><br>
<div align="center">
<table width="95%" cellpadding="1" cellspacing="0">
<tr>
<td width="50%">
<i>Documentation generated by : <a href="http://www.doxygen.org">Doxygen</a> $doxygenversion</i>
</td>
<td align="right">
<a href="mailto:ttimo@idsoftware.com">
<i>ttimo@idsoftware.com</i>
</a>
</td>
</tr>
</table>
</div>
<br>
<br>
</div></td>
<td background="../images/body-right-tile.gif" height="100%">&nbsp;</td>
</tr>
<tr>
<td valign="top" align="left">
<img src="../images/body-lower-left.gif" alt="" width="19" height="12">
</td>
<td valign="top" background="../images/body-lower-tile.gif">
<img border="0" src="../images/body-lower-tile.gif" height="12" width="100%">
</td>
<td valign="top" align="right">
<img src="../images/body-lower-right.gif" alt="" width="19" height="12">
</td>
</tr>
</table>
</td>
<td valign="top">
</td>
</tr>
</table>
</div>
</body>
</html>

View file

@ -0,0 +1,38 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>$projectname $projectnumber Doxygen Documentation</title>
<link href="doxygen_gtkradiant.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
</head>
<body bgcolor="black">
<div align="center">
<center>
<table cellpadding="0" cellspacing="0" border="0" width="94%">
<tr>
<td>
<img src="../images/top-title.gif" alt="" width="254" height="92"></td>
<td background="../images/top-tile.gif" valign="top" align="right" width="100%">
<br><img src="../images/history_id_logo.gif" alt="idsoftware"></td>
<td align="left">
<img src="../images/top-right.gif" alt="" width="12" height="92"></td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" width="95%">
<tr height="12">
<td valign="top">
<img src="../images/body-upper-left.gif" alt="" width="19" height="12"></td>
<td valign="top" background="../images/body-upper-tile.gif">
<img border="0" src="../images/body-upper-tile.gif" height="12" width="100%"></td>
<td valign="top">
<img src="../images/body-upper-right.gif" alt="" width="19" height="12"></td>
</tr>
<tr>
<td background="../images/body-left-tile.gif" height="100%">&nbsp;</td>
<td width="100%" height="100%" bgcolor="#EEEEEE" cellpadding="0" cellspacing="0" border="0"><div>
<br><hr width="95%">
<center>
<table cellpadding="0" cellspacing="0" border="0" width="95%"><tr><td>
<!-- ----------------- End Header ----------------- -->

View file

@ -0,0 +1,7 @@
<html>
<head>
<meta http-equiv=Refresh content="1; url=./html/index.html">
</head>
<body>
Redirecting to <a href="./html/index.html">Doxygen index</a>
</body>

View file

@ -0,0 +1,46 @@
<!-- ---------------- Start Footer ----------------- -->
<br><br>
<div align="center">
<table width="95%" cellpadding="1" cellspacing="0">
<tr>
<td width="50%">
<!-- Left side of footer -->
<i><a href="http://www.doxygen.org">Doxygen</a> is: Copyright © 1997-2001 by <a href="mailto:dimitri@stack.nl">Dimitri van Heesch.</a></i>
</td>
<td align="right">
<!-- Right side of footer -->
<i>GtkRadiant Doxygen Maintainer: <a href="mailto:gefdavis@dingoblue.net.au">Gef</a>
</td>
</tr>
</table>
</div>
<br>
<br>
</div></td>
<td background="../images/body-right-tile.gif" height="100%">&nbsp;</td>
</tr>
<tr>
<td valign="top" align="left">
<img src="../images/body-lower-left.gif" alt="" width="19" height="12">
</td>
<td valign="top" background="../images/body-lower-tile.gif">
<img border="0" src="../images/body-lower-tile.gif" height="12" width="100%">
</td>
<td valign="top" align="right">
<img src="../images/body-lower-right.gif" alt="" width="19" height="12">
</td>
</tr>
</table>
</td>
<td valign="top">
</td>
</tr>
</table>
</center>
</div>
</body>
</html>

View file

@ -0,0 +1,38 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>GtkRadiant - Doxygen Quick Reference</title>
<link href="doxygen_gtkradiant.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
</head>
<body bgcolor="black">
<div align="center">
<center>
<table cellpadding="0" cellspacing="0" border="0" width="94%">
<tr>
<td>
<img src="../images/top-title.gif" alt="" width="254" height="92">
</td>
<td background="../images/top-tile.gif" valign="top" align="right" width="100%">
<br><img src="../images/history_id_logo.gif" alt="idsoftware" border="0"></td>
<td align="left">
<img src="../images/top-right.gif" alt="" width="12" height="92"></td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" width="95%">
<tr>
<td valign="top" align="left">
<img src="../images/body-upper-left.gif" alt="" width="19" height="12"></td>
<td valign="top" background="../images/body-upper-tile.gif">
<img border="0" src="../images/body-upper-tile.gif" height="12" width="100%"></td>
<td valign="top" align="right">
<img src="../images/body-upper-right.gif" alt="" width="19" height="12"></td>
</tr>
<tr>
<td background="../images/body-left-tile.gif" height="100%">&nsbp;</td>
<td width="100%" height="100%" bgcolor="#EEEEEE" cellpadding="0" cellspacing="0" border="1"><div>
<br><hr width="95%">
<!-- ----------------- End Header ----------------- -->

View file

@ -0,0 +1,103 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>IEPairsClassDocumentationExample Doxygen Documentation</title>
<link href="doxygen_gtkradiant.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
</head>
<body bgcolor="black">
<div align="center">
<table cellpadding="0" cellspacing="0" border="0" width="94%">
<tr>
<td>
<img src="../images/top-title.gif" alt="" width="254" height="92">
</td>
<td background="../images/top-tile.gif" valign="top" align="right" width="100%">
<br><img src="../images/history_id_logo.gif" alt="idsoftware" border="0">
</td>
<td align="left">
<img src="../images/top-right.gif" alt="" width="12" height="92">
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" width="95%">
<tr>
<td valign="top" align="left">
<img src="../images/body-upper-left.gif" alt="" width="19" height="12">
</td>
<td valign="top" background="../images/body-upper-tile.gif">
<img border="0" src="../images/body-upper-tile.gif" height="12" width="100%">
</td>
<td valign="top" align="right">
<img src="../images/body-upper-right.gif" alt="" width="19" height="12">
</td>
</tr>
<tr>
<td background="../images/body-left-tile.gif" height="100%">&nbsp;</td>
<td width="100%" height="100%" bgcolor="#EEEEEE" cellpadding="0" cellspacing="0" border="1"><div>
<br><hr>
<center>
<table cellpadding="0" cellspacing="0" border="0" width="95%"><tr><td>
<!-- ----------------- End Header ----------------- -->
<!-- Generated by Doxygen 1.2.8.1 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="pages.html">Related Pages</a> &nbsp; </center>
<hr><h1>IEPairsClassDocumentationExample Compound List</h1>Here are the classes, structs, unions and interfaces with brief descriptions:<ul>
<li><a class="el" href="classIEpair.html">IEpair</a> (Virtual class to allow plugin operations on entity pairs)
</ul>
<!-- ---------------- Start Footer ----------------- -->
</td></tr></table>
</center>
<br><br>
<div align="center">
<table width="95%" cellpadding="1" cellspacing="0">
<tr>
<td width="50%">
<i>Documentation generated by : <a href="http://www.doxygen.org">Doxygen</a> 1.2.8.1 on 11 Aug 2001</i>
</td>
<td align="right">
<a href="mailto:ttimo@idsoftware.com">
<i>ttimo@idsoftware.com</i>
</a>
</td>
</tr>
</table>
</div>
<br>
<br>
</div></td>
<td background="../images/body-right-tile.gif" height="100%">&nbsp;</td>
</tr>
<tr>
<td valign="top" align="left">
<img src="../images/body-lower-left.gif" alt="" width="19" height="12">
</td>
<td valign="top" background="../images/body-lower-tile.gif">
<img border="0" src="../images/body-lower-tile.gif" height="12" width="100%">
</td>
<td valign="top" align="right">
<img src="../images/body-lower-right.gif" alt="" width="19" height="12">
</td>
</tr>
</table>
</td>
<td valign="top">
</td>
</tr>
</table>
</div>
</body>
</html>

View file

@ -0,0 +1,110 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>IEPairsClassDocumentationExample Doxygen Documentation</title>
<link href="doxygen_gtkradiant.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
</head>
<body bgcolor="black">
<div align="center">
<table cellpadding="0" cellspacing="0" border="0" width="94%">
<tr>
<td>
<img src="../images/top-title.gif" alt="" width="254" height="92">
</td>
<td background="../images/top-tile.gif" valign="top" align="right" width="100%">
<br><img src="../images/history_id_logo.gif" alt="idsoftware" border="0">
</td>
<td align="left">
<img src="../images/top-right.gif" alt="" width="12" height="92">
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" width="95%">
<tr>
<td valign="top" align="left">
<img src="../images/body-upper-left.gif" alt="" width="19" height="12">
</td>
<td valign="top" background="../images/body-upper-tile.gif">
<img border="0" src="../images/body-upper-tile.gif" height="12" width="100%">
</td>
<td valign="top" align="right">
<img src="../images/body-upper-right.gif" alt="" width="19" height="12">
</td>
</tr>
<tr>
<td background="../images/body-left-tile.gif" height="100%">&nbsp;</td>
<td width="100%" height="100%" bgcolor="#EEEEEE" cellpadding="0" cellspacing="0" border="1"><div>
<br><hr>
<center>
<table cellpadding="0" cellspacing="0" border="0" width="95%"><tr><td>
<!-- ----------------- End Header ----------------- -->
<!-- Generated by Doxygen 1.2.8.1 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="pages.html">Related Pages</a> &nbsp; </center>
<hr><h1>IEpair Member List</h1>This is the complete list of members for <a class="el" href="classIEpair.html">IEpair</a>, including all inherited members.<ul>
<li><a class="el" href="classIEpair.html#a7">CalculateRotatedBounds</a>(vec3_t mins, vec3_t maxs)=0
<code> [pure virtual]</code><li><a class="el" href="classIEpair.html#a1">DecRef</a>()=0
<code> [pure virtual]</code><li><a class="el" href="classIEpair.html#a3">FloatForKey</a>(char *key)=0
<code> [pure virtual]</code><li><a class="el" href="classIEpair.html#a6">GetEntityOrigin</a>(vec3_t vec)=0
<code> [pure virtual]</code><li><a class="el" href="classIEpair.html#a2">GetVectorForKey</a>(char *key, vec3_t vec)=0
<code> [pure virtual]</code><li><a class="el" href="classIEpair.html#a0">IncRef</a>()=0
<code> [pure virtual]</code><li><a class="el" href="classIEpair.html#a5">SetKeyValue</a>(char *key, char *value)=0
<code> [pure virtual]</code><li><a class="el" href="classIEpair.html#a4">ValueForKey</a>(char *key)=0
<code> [pure virtual]</code></ul>
<!-- ---------------- Start Footer ----------------- -->
</td></tr></table>
</center>
<br><br>
<div align="center">
<table width="95%" cellpadding="1" cellspacing="0">
<tr>
<td width="50%">
<i>Documentation generated by : <a href="http://www.doxygen.org">Doxygen</a> 1.2.8.1 on 11 Aug 2001</i>
</td>
<td align="right">
<a href="mailto:ttimo@idsoftware.com">
<i>ttimo@idsoftware.com</i>
</a>
</td>
</tr>
</table>
</div>
<br>
<br>
</div></td>
<td background="../images/body-right-tile.gif" height="100%">&nbsp;</td>
</tr>
<tr>
<td valign="top" align="left">
<img src="../images/body-lower-left.gif" alt="" width="19" height="12">
</td>
<td valign="top" background="../images/body-lower-tile.gif">
<img border="0" src="../images/body-lower-tile.gif" height="12" width="100%">
</td>
<td valign="top" align="right">
<img src="../images/body-lower-right.gif" alt="" width="19" height="12">
</td>
</tr>
</table>
</td>
<td valign="top">
</td>
</tr>
</table>
</div>
</body>
</html>

View file

@ -0,0 +1,414 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>IEPairsClassDocumentationExample Doxygen Documentation</title>
<link href="doxygen_gtkradiant.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
</head>
<body bgcolor="black">
<div align="center">
<table cellpadding="0" cellspacing="0" border="0" width="94%">
<tr>
<td>
<img src="../images/top-title.gif" alt="" width="254" height="92">
</td>
<td background="../images/top-tile.gif" valign="top" align="right" width="100%">
<br><img src="../images/history_id_logo.gif" alt="idsoftware" border="0">
</td>
<td align="left">
<img src="../images/top-right.gif" alt="" width="12" height="92">
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" width="95%">
<tr>
<td valign="top" align="left">
<img src="../images/body-upper-left.gif" alt="" width="19" height="12">
</td>
<td valign="top" background="../images/body-upper-tile.gif">
<img border="0" src="../images/body-upper-tile.gif" height="12" width="100%">
</td>
<td valign="top" align="right">
<img src="../images/body-upper-right.gif" alt="" width="19" height="12">
</td>
</tr>
<tr>
<td background="../images/body-left-tile.gif" height="100%">&nbsp;</td>
<td width="100%" height="100%" bgcolor="#EEEEEE" cellpadding="0" cellspacing="0" border="1"><div>
<br><hr>
<center>
<table cellpadding="0" cellspacing="0" border="0" width="95%"><tr><td>
<!-- ----------------- End Header ----------------- -->
<!-- Generated by Doxygen 1.2.8.1 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="pages.html">Related Pages</a> &nbsp; </center>
<hr><h1>IEpair Class Reference</h1>Virtual class to allow plugin operations on entity pairs.
<a href="#_details">More...</a>
<p>
<a href="classIEpair-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
<tr><td colspan=2><br><h2>Public Methods</h2></td></tr>
<tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classIEpair.html#a0">IncRef</a> ()=0</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Increment the number of references to this object.</em> <a href="#a0">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classIEpair.html#a1">DecRef</a> ()=0</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Decrement the reference count.</em> <a href="#a1">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classIEpair.html#a2">GetVectorForKey</a> (char *key, vec3_t vec)=0</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Get a vector from a key.</em> <a href="#a2">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual float&nbsp;</td><td valign=bottom><a class="el" href="classIEpair.html#a3">FloatForKey</a> (char *key)=0</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Get a float from a key.</em> <a href="#a3">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual char*&nbsp;</td><td valign=bottom><a class="el" href="classIEpair.html#a4">ValueForKey</a> (char *key)=0</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Get a string (char *) from a key.</em> <a href="#a4">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classIEpair.html#a5">SetKeyValue</a> (char *key, char *value)=0</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Set a key value to char *value.</em> <a href="#a5">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classIEpair.html#a6">GetEntityOrigin</a> (vec3_t vec)=0</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Get a vec3_t for the entities origin.</em> <a href="#a6">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classIEpair.html#a7">CalculateRotatedBounds</a> (vec3_t mins, vec3_t maxs)=0</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Compute the rotated bounds of the BBox based on "angle" and "angles" keys.</em> <a href="#a7">More...</a><em></em></font><br><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Virtual class to allow plugin operations on entity pairs.
<p>
<p>
<dl compact><dt>
<b><a class="el" href="todo.html#_todo000001">Todo: </a></b><dd>
Write more complete documentation for this class so that it's use is clear</dl>
<p>
An interface to entity keys and key pairs that allows plugins to; read and write entity keys and key values, get a key value as a vec3_t
<p>
<p>
Definition at line <a class="el" href="test_8c-source.html#l00010">10</a> of file <a class="el" href="test_8c-source.html">iepairs.h</a>.<hr><h2>Member Function Documentation</h2>
<a name="a7" doxytag="IEpair::CalculateRotatedBounds"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td nowrap valign="top"><b>
void IEpair::CalculateRotatedBounds (
</b></td>
<td valign="bottom"><b>
vec3_t <em>mins</em>,
</b></td>
</tr>
<tr>
<td></td>
<td><b>
vec3_t <em>maxs</em>&nbsp;)<code> [pure virtual]</code>
</b></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Compute the rotated bounds of the BBox based on "angle" and "angles" keys.
<p>
</td>
</tr>
</table>
<a name="a1" doxytag="IEpair::DecRef"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td nowrap valign="top"><b>
void IEpair::DecRef (
</b></td>
<td valign="bottom"><b>
)<code> [pure virtual]</code>
</b></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Decrement the reference count.
<p>
</td>
</tr>
</table>
<a name="a3" doxytag="IEpair::FloatForKey"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td nowrap valign="top"><b>
float IEpair::FloatForKey (
</b></td>
<td valign="bottom"><b>
char * <em>key</em>&nbsp;)<code> [pure virtual]</code>
</b></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Get a float from a key.
<p>
</td>
</tr>
</table>
<a name="a6" doxytag="IEpair::GetEntityOrigin"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td nowrap valign="top"><b>
void IEpair::GetEntityOrigin (
</b></td>
<td valign="bottom"><b>
vec3_t <em>vec</em>&nbsp;)<code> [pure virtual]</code>
</b></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Get a vec3_t for the entities origin.
<p>
</td>
</tr>
</table>
<a name="a2" doxytag="IEpair::GetVectorForKey"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td nowrap valign="top"><b>
void IEpair::GetVectorForKey (
</b></td>
<td valign="bottom"><b>
char * <em>key</em>,
</b></td>
</tr>
<tr>
<td></td>
<td><b>
vec3_t <em>vec</em>&nbsp;)<code> [pure virtual]</code>
</b></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Get a vector from a key.
<p>
</td>
</tr>
</table>
<a name="a0" doxytag="IEpair::IncRef"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td nowrap valign="top"><b>
void IEpair::IncRef (
</b></td>
<td valign="bottom"><b>
)<code> [pure virtual]</code>
</b></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Increment the number of references to this object.
<p>
</td>
</tr>
</table>
<a name="a5" doxytag="IEpair::SetKeyValue"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td nowrap valign="top"><b>
void IEpair::SetKeyValue (
</b></td>
<td valign="bottom"><b>
char * <em>key</em>,
</b></td>
</tr>
<tr>
<td></td>
<td><b>
char * <em>value</em>&nbsp;)<code> [pure virtual]</code>
</b></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Set a key value to char *value.
<p>
<dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>key</em>
&nbsp;</td><td>
The (char *) containing the keyname </td></tr>
<tr><td valign=top><em>value</em>
&nbsp;</td><td>
The (char *) to set the key value to </td></tr>
</table>
</dl> </td>
</tr>
</table>
<a name="a4" doxytag="IEpair::ValueForKey"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td nowrap valign="top"><b>
char * IEpair::ValueForKey (
</b></td>
<td valign="bottom"><b>
char * <em>key</em>&nbsp;)<code> [pure virtual]</code>
</b></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Get a string (char *) from a key.
<p>
</td>
</tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="test_8c-source.html">iepairs.h</a></ul>
<!-- ---------------- Start Footer ----------------- -->
</td></tr></table>
</center>
<br><br>
<div align="center">
<table width="95%" cellpadding="1" cellspacing="0">
<tr>
<td width="50%">
<i>Documentation generated by : <a href="http://www.doxygen.org">Doxygen</a> 1.2.8.1 on 11 Aug 2001</i>
</td>
<td align="right">
<a href="mailto:ttimo@idsoftware.com">
<i>ttimo@idsoftware.com</i>
</a>
</td>
</tr>
</table>
</div>
<br>
<br>
</div></td>
<td background="../images/body-right-tile.gif" height="100%">&nbsp;</td>
</tr>
<tr>
<td valign="top" align="left">
<img src="../images/body-lower-left.gif" alt="" width="19" height="12">
</td>
<td valign="top" background="../images/body-lower-tile.gif">
<img border="0" src="../images/body-lower-tile.gif" height="12" width="100%">
</td>
<td valign="top" align="right">
<img src="../images/body-lower-right.gif" alt="" width="19" height="12">
</td>
</tr>
</table>
</td>
<td valign="top">
</td>
</tr>
</table>
</div>
</body>
</html>

View file

@ -0,0 +1,103 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>IEPairsClassDocumentationExample Doxygen Documentation</title>
<link href="doxygen_gtkradiant.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
</head>
<body bgcolor="black">
<div align="center">
<table cellpadding="0" cellspacing="0" border="0" width="94%">
<tr>
<td>
<img src="../images/top-title.gif" alt="" width="254" height="92">
</td>
<td background="../images/top-tile.gif" valign="top" align="right" width="100%">
<br><img src="../images/history_id_logo.gif" alt="idsoftware" border="0">
</td>
<td align="left">
<img src="../images/top-right.gif" alt="" width="12" height="92">
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" width="95%">
<tr>
<td valign="top" align="left">
<img src="../images/body-upper-left.gif" alt="" width="19" height="12">
</td>
<td valign="top" background="../images/body-upper-tile.gif">
<img border="0" src="../images/body-upper-tile.gif" height="12" width="100%">
</td>
<td valign="top" align="right">
<img src="../images/body-upper-right.gif" alt="" width="19" height="12">
</td>
</tr>
<tr>
<td background="../images/body-left-tile.gif" height="100%">&nbsp;</td>
<td width="100%" height="100%" bgcolor="#EEEEEE" cellpadding="0" cellspacing="0" border="1"><div>
<br><hr>
<center>
<table cellpadding="0" cellspacing="0" border="0" width="95%"><tr><td>
<!-- ----------------- End Header ----------------- -->
<!-- Generated by Doxygen 1.2.8.1 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="pages.html">Related Pages</a> &nbsp; </center>
<hr><h1>IEPairsClassDocumentationExample Compound Index</h1><table align=center width="95%" border=0 cellspacing=0 cellpadding=0>
<tr><td><div class="ah"><font color="white"><b>&nbsp;&nbsp;I&nbsp;&nbsp;</b></font></div></td><td><a class="el" href="classIEpair.html">IEpair</a>&nbsp;&nbsp;&nbsp;</td></tr>
</table>
<!-- ---------------- Start Footer ----------------- -->
</td></tr></table>
</center>
<br><br>
<div align="center">
<table width="95%" cellpadding="1" cellspacing="0">
<tr>
<td width="50%">
<i>Documentation generated by : <a href="http://www.doxygen.org">Doxygen</a> 1.2.8.1 on 11 Aug 2001</i>
</td>
<td align="right">
<a href="mailto:ttimo@idsoftware.com">
<i>ttimo@idsoftware.com</i>
</a>
</td>
</tr>
</table>
</div>
<br>
<br>
</div></td>
<td background="../images/body-right-tile.gif" height="100%">&nbsp;</td>
</tr>
<tr>
<td valign="top" align="left">
<img src="../images/body-lower-left.gif" alt="" width="19" height="12">
</td>
<td valign="top" background="../images/body-lower-tile.gif">
<img border="0" src="../images/body-lower-tile.gif" height="12" width="100%">
</td>
<td valign="top" align="right">
<img src="../images/body-lower-right.gif" alt="" width="19" height="12">
</td>
</tr>
</table>
</td>
<td valign="top">
</td>
</tr>
</table>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View file

@ -0,0 +1,35 @@
body { background-color: black; }
IMG { border-color: #222222; border: 1; }
em { font-size: 11px; font-style: italic; font-weight: normal; color: #888888; }
H1 { text-align: center; font-size: 15px; color: #2222AA; font-family: Geneva, Verdana, Helvetica, Arial, sans-serif; }
H3 { text-align: center; font-size: 18px; color: #2222AA; font-family: Geneva, Verdana, Helvetica, Arial, sans-serif; }
A { text-decoration: none; color: #6666DD; }
A:HOVER { text-decoration: underline; color: #4444FF; }
A:VISITED { text-decoration: none; color: #8888AA; }
A.qindex { text-decoration: none; color: #6666DD; font-size: 11px; }
A.qindex:HOVER { text-decoration: underline; color: #4444FF; font-size: 11px; }
A.qindex:VISITED { text-decoration: none; color: #8888AA; font-size: 11px; }
A.qindexRef { font-size: 11px; }
A.el { text-decoration: none; font-weight: bold; }
A.elRef { font-weight: bold; }
A.code { text-decoration: none; font-weight: normal; color: #6666DD; }
A.code:HOVER { text-decoration: underline; font-weight: normal; color: #4444FF; }
A.code:VISITED { text-decoration: none; font-weight: normal; color: #8888AA; }
A.codeRef { text-decoration: none; font-weight: normal; color: #6666DD; }
A.codeRef:HOVER { text-decoration: underline; font-weight: normal; color: #4444FF; }
A.codeRef:VISITED { text-decoration: none; font-weight: normal; color: #8888AA; }
DL.el { margin-left: 2cm; width: 99%; }
DIV.fragment { background-color: #FFFFFF; width: 99%; }
DIV.ah { background-color: #AAAAAA; width: 99%; margin-bottom: 3; margin-top: 3; }
TD.md { cellpadding: 2; background-color: #DDDDDD; border: 1; width: 99%; color: #222222; }
DIV.groupHeader { margin-left: 16; margin-top: 12; margin-bottom: 6; font-weight: bold; color: #222222; }
DIV.groupText { margin-left: 16; font-style: italic; font-size: smaller; }
FONT.keyword { color: #0080A0; }
FONT.keywordtype { color: #604020; }
FONT.keywordflow { color: #E08000; }
FONT.comment { color: #800000; }
FONT.comment { color: #009900; text-decoration: italic; }
FONT.preprocessor { color: #806020; }
FONT.stringliteral{ color: #002080; }
FONT.charliteral { color: #008080; }

View file

@ -0,0 +1,102 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>IEPairsClassDocumentationExample Doxygen Documentation</title>
<link href="doxygen_gtkradiant.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
</head>
<body bgcolor="black">
<div align="center">
<table cellpadding="0" cellspacing="0" border="0" width="94%">
<tr>
<td>
<img src="../images/top-title.gif" alt="" width="254" height="92">
</td>
<td background="../images/top-tile.gif" valign="top" align="right" width="100%">
<br><img src="../images/history_id_logo.gif" alt="idsoftware" border="0">
</td>
<td align="left">
<img src="../images/top-right.gif" alt="" width="12" height="92">
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" width="95%">
<tr>
<td valign="top" align="left">
<img src="../images/body-upper-left.gif" alt="" width="19" height="12">
</td>
<td valign="top" background="../images/body-upper-tile.gif">
<img border="0" src="../images/body-upper-tile.gif" height="12" width="100%">
</td>
<td valign="top" align="right">
<img src="../images/body-upper-right.gif" alt="" width="19" height="12">
</td>
</tr>
<tr>
<td background="../images/body-left-tile.gif" height="100%">&nbsp;</td>
<td width="100%" height="100%" bgcolor="#EEEEEE" cellpadding="0" cellspacing="0" border="1"><div>
<br><hr>
<center>
<table cellpadding="0" cellspacing="0" border="0" width="95%"><tr><td>
<!-- ----------------- End Header ----------------- -->
<!-- Generated by Doxygen 1.2.8.1 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="pages.html">Related Pages</a> &nbsp; </center>
<hr><h1>IEPairsClassDocumentationExample File List</h1>Here is a list of all files with brief descriptions:<ul>
<li><a class="el" href="test_8c.html">iepairs.h</a> <a href="test_8c-source.html">[code]</a></ul>
<!-- ---------------- Start Footer ----------------- -->
</td></tr></table>
</center>
<br><br>
<div align="center">
<table width="95%" cellpadding="1" cellspacing="0">
<tr>
<td width="50%">
<i>Documentation generated by : <a href="http://www.doxygen.org">Doxygen</a> 1.2.8.1 on 11 Aug 2001</i>
</td>
<td align="right">
<a href="mailto:ttimo@idsoftware.com">
<i>ttimo@idsoftware.com</i>
</a>
</td>
</tr>
</table>
</div>
<br>
<br>
</div></td>
<td background="../images/body-right-tile.gif" height="100%">&nbsp;</td>
</tr>
<tr>
<td valign="top" align="left">
<img src="../images/body-lower-left.gif" alt="" width="19" height="12">
</td>
<td valign="top" background="../images/body-lower-tile.gif">
<img border="0" src="../images/body-lower-tile.gif" height="12" width="100%">
</td>
<td valign="top" align="right">
<img src="../images/body-lower-right.gif" alt="" width="19" height="12">
</td>
</tr>
</table>
</td>
<td valign="top">
</td>
</tr>
</table>
</div>
</body>
</html>

View file

@ -0,0 +1,110 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>IEPairsClassDocumentationExample Doxygen Documentation</title>
<link href="doxygen_gtkradiant.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
</head>
<body bgcolor="black">
<div align="center">
<table cellpadding="0" cellspacing="0" border="0" width="94%">
<tr>
<td>
<img src="../images/top-title.gif" alt="" width="254" height="92">
</td>
<td background="../images/top-tile.gif" valign="top" align="right" width="100%">
<br><img src="../images/history_id_logo.gif" alt="idsoftware" border="0">
</td>
<td align="left">
<img src="../images/top-right.gif" alt="" width="12" height="92">
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" width="95%">
<tr>
<td valign="top" align="left">
<img src="../images/body-upper-left.gif" alt="" width="19" height="12">
</td>
<td valign="top" background="../images/body-upper-tile.gif">
<img border="0" src="../images/body-upper-tile.gif" height="12" width="100%">
</td>
<td valign="top" align="right">
<img src="../images/body-upper-right.gif" alt="" width="19" height="12">
</td>
</tr>
<tr>
<td background="../images/body-left-tile.gif" height="100%">&nbsp;</td>
<td width="100%" height="100%" bgcolor="#EEEEEE" cellpadding="0" cellspacing="0" border="1"><div>
<br><hr>
<center>
<table cellpadding="0" cellspacing="0" border="0" width="95%"><tr><td>
<!-- ----------------- End Header ----------------- -->
<!-- Generated by Doxygen 1.2.8.1 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="pages.html">Related Pages</a> &nbsp; </center>
<hr><h1>IEPairsClassDocumentationExample Compound Members</h1>Here is a list of all class members with links to the class documentation for each member:<ul>
<li>CalculateRotatedBounds()
: <a class="el" href="classIEpair.html#a7">IEpair</a><li>DecRef()
: <a class="el" href="classIEpair.html#a1">IEpair</a><li>FloatForKey()
: <a class="el" href="classIEpair.html#a3">IEpair</a><li>GetEntityOrigin()
: <a class="el" href="classIEpair.html#a6">IEpair</a><li>GetVectorForKey()
: <a class="el" href="classIEpair.html#a2">IEpair</a><li>IncRef()
: <a class="el" href="classIEpair.html#a0">IEpair</a><li>SetKeyValue()
: <a class="el" href="classIEpair.html#a5">IEpair</a><li>ValueForKey()
: <a class="el" href="classIEpair.html#a4">IEpair</a></ul>
<!-- ---------------- Start Footer ----------------- -->
</td></tr></table>
</center>
<br><br>
<div align="center">
<table width="95%" cellpadding="1" cellspacing="0">
<tr>
<td width="50%">
<i>Documentation generated by : <a href="http://www.doxygen.org">Doxygen</a> 1.2.8.1 on 11 Aug 2001</i>
</td>
<td align="right">
<a href="mailto:ttimo@idsoftware.com">
<i>ttimo@idsoftware.com</i>
</a>
</td>
</tr>
</table>
</div>
<br>
<br>
</div></td>
<td background="../images/body-right-tile.gif" height="100%">&nbsp;</td>
</tr>
<tr>
<td valign="top" align="left">
<img src="../images/body-lower-left.gif" alt="" width="19" height="12">
</td>
<td valign="top" background="../images/body-lower-tile.gif">
<img border="0" src="../images/body-lower-tile.gif" height="12" width="100%">
</td>
<td valign="top" align="right">
<img src="../images/body-lower-right.gif" alt="" width="19" height="12">
</td>
</tr>
</table>
</td>
<td valign="top">
</td>
</tr>
</table>
</div>
</body>
</html>

View file

@ -0,0 +1,16 @@
digraph inheritance
{
Node7 [shape="box",label="Inherited",fontsize=10,height=0.2,width=0.4,fontname="doxfont",color="black",style="filled" fontcolor="white"];
Node8 -> Node7 [dir=back,color="midnightblue",fontsize=10,style="solid",fontname="doxfont"];
Node8 [shape="box",label="PublicBase",fontsize=10,height=0.2,width=0.4,fontname="doxfont",color="black",URL="$class_publicbase.html"];
Node9 -> Node8 [dir=back,color="midnightblue",fontsize=10,style="solid",fontname="doxfont"];
Node9 [shape="box",label="Truncated",fontsize=10,height=0.2,width=0.4,fontname="doxfont",color="red",URL="$class_truncated.html"];
Node11 -> Node7 [dir=back,color="darkgreen",fontsize=10,style="solid",fontname="doxfont"];
Node11 [shape="box",label="ProtectedBase",fontsize=10,height=0.2,width=0.4,fontname="doxfont",color="black",URL="$class_protectedbase.html"];
Node12 -> Node7 [dir=back,color="firebrick4",fontsize=10,style="solid",fontname="doxfont"];
Node12 [shape="box",label="PrivateBase",fontsize=10,height=0.2,width=0.4,fontname="doxfont",color="black",URL="$class_privatebase.html"];
Node13 -> Node7 [dir=back,color="midnightblue",fontsize=10,style="solid",fontname="doxfont"];
Node13 [shape="box",label="Undocumented",fontsize=10,height=0.2,width=0.4,fontname="doxfont",color="grey75"];
Node14 -> Node7 [dir=back,color="darkorchid3",fontsize=10,style="dashed",label="m_usedClass",fontname="doxfont"];
Node14 [shape="box",label="Used",fontsize=10,height=0.2,width=0.4,fontname="doxfont",color="black",URL="$class_used.html"];
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

View file

@ -0,0 +1,141 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>IEPairsClassDocumentationExample Doxygen Documentation</title>
<link href="doxygen_gtkradiant.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
</head>
<body bgcolor="black">
<div align="center">
<table cellpadding="0" cellspacing="0" border="0" width="94%">
<tr>
<td>
<img src="../images/top-title.gif" alt="" width="254" height="92">
</td>
<td background="../images/top-tile.gif" valign="top" align="right" width="100%">
<br><img src="../images/history_id_logo.gif" alt="idsoftware" border="0">
</td>
<td align="left">
<img src="../images/top-right.gif" alt="" width="12" height="92">
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" width="95%">
<tr>
<td valign="top" align="left">
<img src="../images/body-upper-left.gif" alt="" width="19" height="12">
</td>
<td valign="top" background="../images/body-upper-tile.gif">
<img border="0" src="../images/body-upper-tile.gif" height="12" width="100%">
</td>
<td valign="top" align="right">
<img src="../images/body-upper-right.gif" alt="" width="19" height="12">
</td>
</tr>
<tr>
<td background="../images/body-left-tile.gif" height="100%">&nbsp;</td>
<td width="100%" height="100%" bgcolor="#EEEEEE" cellpadding="0" cellspacing="0" border="1"><div>
<br><hr>
<center>
<table cellpadding="0" cellspacing="0" border="0" width="95%"><tr><td>
<!-- ----------------- End Header ----------------- -->
<!-- Generated by Doxygen 1.2.8.1 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="pages.html">Related Pages</a> &nbsp; </center>
<hr><h1>Graph Legend</h1>This page explains how to interpret the graphs that are generated by doxygen.
<p>
Consider the following example: <div class="fragment"><pre><font class="comment">/*! Invisible class because of truncation */</font>
<font class="keyword">class </font>Invisible { };
<font class="comment"></font>
<font class="comment">/*! Truncated class, inheritance relation is hidden */</font>
<font class="keyword">class </font>Truncated : <font class="keyword">public</font> Invisible { };
<font class="comment">/* Class not documented with doxygen comments */</font>
<font class="keyword">class </font>Undocumented { };
<font class="comment"></font>
<font class="comment">/*! Class that is inherited using public inheritance */</font>
<font class="keyword">class </font>PublicBase : <font class="keyword">public</font> Truncated { };
<font class="comment"></font>
<font class="comment">/*! Class that is inherited using protected inheritance */</font>
<font class="keyword">class </font>ProtectedBase { };
<font class="comment"></font>
<font class="comment">/*! Class that is inherited using private inheritance */</font>
<font class="keyword">class </font>PrivateBase { };
<font class="comment"></font>
<font class="comment">/*! Class that is used by the Inherited class */</font>
<font class="keyword">class </font>Used { };
<font class="comment"></font>
<font class="comment">/*! Super class that inherits a number of other classes */</font>
<font class="keyword">class </font>Inherited : <font class="keyword">public</font> PublicBase,
<font class="keyword">protected</font> ProtectedBase,
<font class="keyword">private</font> PrivateBase,
<font class="keyword">public</font> Undocumented
{
<font class="keyword">private</font>:
Used *m_usedClass;
};</pre></div> If the <code>MAX_DOT_GRAPH_HEIGHT</code> tag in the configuration file is set to 200 this will result in the following graph:
<p>
<center>
<img src="graph_legend.gif"></center>
<p>
The boxes in the above graph have the following meaning: <ul>
<li>A filled black box represents the struct or class for which the graph is generated. <li>A box with a black border denotes a documented struct or class. <li>A box with a grey border denotes an undocumented struct or class. <li>A box with a red border denotes a documented struct or class for which not all inheritance/containment relations are shown. A graph is truncated if it does not fit within the specified boundaries.</ul>
The arrows have the following meaning: <ul>
<li>A dark blue arrow is used to visualize a public inheritance relation between two classes. <li>A dark green arrow is used for protected inheritance. <li>A dark red arrow is used for private inheritance. <li>A purple dashed arrow is used if a class is contained or used by another class. The arrow is labeled with the variable(s) through which the pointed class or struct is accessible. </ul>
<!-- ---------------- Start Footer ----------------- -->
</td></tr></table>
</center>
<br><br>
<div align="center">
<table width="95%" cellpadding="1" cellspacing="0">
<tr>
<td width="50%">
<i>Documentation generated by : <a href="http://www.doxygen.org">Doxygen</a> 1.2.8.1 on 11 Aug 2001</i>
</td>
<td align="right">
<a href="mailto:ttimo@idsoftware.com">
<i>ttimo@idsoftware.com</i>
</a>
</td>
</tr>
</table>
</div>
<br>
<br>
</div></td>
<td background="../images/body-right-tile.gif" height="100%">&nbsp;</td>
</tr>
<tr>
<td valign="top" align="left">
<img src="../images/body-lower-left.gif" alt="" width="19" height="12">
</td>
<td valign="top" background="../images/body-lower-tile.gif">
<img border="0" src="../images/body-lower-tile.gif" height="12" width="100%">
</td>
<td valign="top" align="right">
<img src="../images/body-lower-right.gif" alt="" width="19" height="12">
</td>
</tr>
</table>
</td>
<td valign="top">
</td>
</tr>
</table>
</div>
</body>
</html>

View file

@ -0,0 +1,102 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>IEPairs Class Example Doxygen Documentation</title>
<link href="doxygen_gtkradiant.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
</head>
<body bgcolor="black">
<div align="center">
<table cellpadding="0" cellspacing="0" border="0" width="94%">
<tr>
<td>
<img src="../images/top-title.gif" alt="" width="254" height="92">
</td>
<td background="../images/top-tile.gif" valign="top" align="right" width="100%">
<br><img src="../images/history_id_logo.gif" alt="idsoftware" border="0">
</td>
<td align="left">
<img src="../images/top-right.gif" alt="" width="12" height="92">
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" width="95%">
<tr>
<td valign="top" align="left">
<img src="../images/body-upper-left.gif" alt="" width="19" height="12">
</td>
<td valign="top" background="../images/body-upper-tile.gif">
<img border="0" src="../images/body-upper-tile.gif" height="12" width="100%">
</td>
<td valign="top" align="right">
<img src="../images/body-upper-right.gif" alt="" width="19" height="12">
</td>
</tr>
<tr>
<td background="../images/body-left-tile.gif" height="100%">&nbsp;</td>
<td width="100%" height="100%" bgcolor="#EEEEEE" cellpadding="0" cellspacing="0" border="1"><div>
<br><hr>
<center>
<table cellpadding="0" cellspacing="0" border="0" width="95%"><tr><td>
<!-- ----------------- End Header ----------------- -->
<!-- Generated by Doxygen 1.2.8.1 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="pages.html">Related Pages</a> &nbsp; </center>
<hr><h1>IEPairs Class Example Documentation</h1>
<p>
<!-- ---------------- Start Footer ----------------- -->
</td></tr></table>
</center>
<br><br>
<div align="center">
<table width="95%" cellpadding="1" cellspacing="0">
<tr>
<td width="50%">
<i>Documentation generated by : <a href="http://www.doxygen.org">Doxygen</a> 1.2.8.1 on 11 Aug 2001</i>
</td>
<td align="right">
<a href="mailto:ttimo@idsoftware.com">
<i>ttimo@idsoftware.com</i>
</a>
</td>
</tr>
</table>
</div>
<br>
<br>
</div></td>
<td background="../images/body-right-tile.gif" height="100%">&nbsp;</td>
</tr>
<tr>
<td valign="top" align="left">
<img src="../images/body-lower-left.gif" alt="" width="19" height="12">
</td>
<td valign="top" background="../images/body-lower-tile.gif">
<img border="0" src="../images/body-lower-tile.gif" height="12" width="100%">
</td>
<td valign="top" align="right">
<img src="../images/body-lower-right.gif" alt="" width="19" height="12">
</td>
</tr>
</table>
</td>
<td valign="top">
</td>
</tr>
</table>
</div>
</body>
</html>

View file

@ -0,0 +1,104 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>IEPairsClassDocumentationExample Doxygen Documentation</title>
<link href="doxygen_gtkradiant.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
</head>
<body bgcolor="black">
<div align="center">
<table cellpadding="0" cellspacing="0" border="0" width="94%">
<tr>
<td>
<img src="../images/top-title.gif" alt="" width="254" height="92">
</td>
<td background="../images/top-tile.gif" valign="top" align="right" width="100%">
<br><img src="../images/history_id_logo.gif" alt="idsoftware" border="0">
</td>
<td align="left">
<img src="../images/top-right.gif" alt="" width="12" height="92">
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" width="95%">
<tr>
<td valign="top" align="left">
<img src="../images/body-upper-left.gif" alt="" width="19" height="12">
</td>
<td valign="top" background="../images/body-upper-tile.gif">
<img border="0" src="../images/body-upper-tile.gif" height="12" width="100%">
</td>
<td valign="top" align="right">
<img src="../images/body-upper-right.gif" alt="" width="19" height="12">
</td>
</tr>
<tr>
<td background="../images/body-left-tile.gif" height="100%">&nbsp;</td>
<td width="100%" height="100%" bgcolor="#EEEEEE" cellpadding="0" cellspacing="0" border="1"><div>
<br><hr>
<center>
<table cellpadding="0" cellspacing="0" border="0" width="95%"><tr><td>
<!-- ----------------- End Header ----------------- -->
<!-- Generated by Doxygen 1.2.8.1 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="pages.html">Related Pages</a> &nbsp; </center>
<hr><h1>IEPairsClassDocumentationExample Related Pages</h1>Here is a list of all related documentation pages:<ul>
<li><a class="el" href="todo.html">Todo List</a>
</ul>
<!-- ---------------- Start Footer ----------------- -->
</td></tr></table>
</center>
<br><br>
<div align="center">
<table width="95%" cellpadding="1" cellspacing="0">
<tr>
<td width="50%">
<i>Documentation generated by : <a href="http://www.doxygen.org">Doxygen</a> 1.2.8.1 on 11 Aug 2001</i>
</td>
<td align="right">
<a href="mailto:ttimo@idsoftware.com">
<i>ttimo@idsoftware.com</i>
</a>
</td>
</tr>
</table>
</div>
<br>
<br>
</div></td>
<td background="../images/body-right-tile.gif" height="100%">&nbsp;</td>
</tr>
<tr>
<td valign="top" align="left">
<img src="../images/body-lower-left.gif" alt="" width="19" height="12">
</td>
<td valign="top" background="../images/body-lower-tile.gif">
<img border="0" src="../images/body-lower-tile.gif" height="12" width="100%">
</td>
<td valign="top" align="right">
<img src="../images/body-lower-right.gif" alt="" width="19" height="12">
</td>
</tr>
</table>
</td>
<td valign="top">
</td>
</tr>
</table>
</div>
</body>
</html>

View file

@ -0,0 +1,140 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>IEPairsClassDocumentationExample Doxygen Documentation</title>
<link href="doxygen_gtkradiant.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
</head>
<body bgcolor="black">
<div align="center">
<table cellpadding="0" cellspacing="0" border="0" width="94%">
<tr>
<td>
<img src="../images/top-title.gif" alt="" width="254" height="92">
</td>
<td background="../images/top-tile.gif" valign="top" align="right" width="100%">
<br><img src="../images/history_id_logo.gif" alt="idsoftware" border="0">
</td>
<td align="left">
<img src="../images/top-right.gif" alt="" width="12" height="92">
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" width="95%">
<tr>
<td valign="top" align="left">
<img src="../images/body-upper-left.gif" alt="" width="19" height="12">
</td>
<td valign="top" background="../images/body-upper-tile.gif">
<img border="0" src="../images/body-upper-tile.gif" height="12" width="100%">
</td>
<td valign="top" align="right">
<img src="../images/body-upper-right.gif" alt="" width="19" height="12">
</td>
</tr>
<tr>
<td background="../images/body-left-tile.gif" height="100%">&nbsp;</td>
<td width="100%" height="100%" bgcolor="#EEEEEE" cellpadding="0" cellspacing="0" border="1"><div>
<br><hr>
<center>
<table cellpadding="0" cellspacing="0" border="0" width="95%"><tr><td>
<!-- ----------------- End Header ----------------- -->
<!-- Generated by Doxygen 1.2.8.1 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="pages.html">Related Pages</a> &nbsp; </center>
<hr><h1>iepairs.h</h1><a href="test_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <font class="comment">//! Virtual class to allow plugin operations on entity pairs</font>
00002 <font class="comment"></font><font class="comment">/*!</font>
00003 <font class="comment"> \todo Write more complete documentation for this class so that it's use</font>
00004 <font class="comment"> is clear</font>
00005 <font class="comment"> </font>
00006 <font class="comment"> An interface to entity keys and key pairs that allows plugins to;</font>
00007 <font class="comment"> read and write entity keys and key values, get a key value as a</font>
00008 <font class="comment"> vec3_t</font>
00009 <font class="comment">*/</font>
<a name="l00010"></a><a class="code" href="classIEpair.html">00010</a> <font class="keyword">class </font><a class="code" href="classIEpair.html">IEpair</a>
00011 {
00012 <font class="keyword">public</font>:<font class="comment"></font>
00013 <font class="comment"> //! Increment the number of references to this object</font>
00014 <font class="comment"></font> <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classIEpair.html#a0">IncRef</a> () = 0;
00015 <font class="comment"></font>
00016 <font class="comment"> //! Decrement the reference count</font>
00017 <font class="comment"></font> <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classIEpair.html#a1">DecRef</a> () = 0;
00018 <font class="comment"></font>
00019 <font class="comment"> //! Get a vector from a key</font>
00020 <font class="comment"></font> <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classIEpair.html#a2">GetVectorForKey</a>( <font class="keywordtype">char</font>* key, vec3_t vec ) = 0;
00021 <font class="comment"></font>
00022 <font class="comment"> //! Get a float from a key</font>
00023 <font class="comment"></font> <font class="keyword">virtual</font> <font class="keywordtype">float</font> <a class="code" href="classIEpair.html#a3">FloatForKey</a>( <font class="keywordtype">char</font> *key ) = 0;
00024 <font class="comment"></font>
00025 <font class="comment"> //! Get a string (char *) from a key</font>
00026 <font class="comment"></font> <font class="keyword">virtual</font> <font class="keywordtype">char</font>* <a class="code" href="classIEpair.html#a4">ValueForKey</a>( <font class="keywordtype">char</font> *key ) = 0;
00027 <font class="comment"></font>
00028 <font class="comment"> //! Set a key value to char *value</font>
00029 <font class="comment"></font><font class="comment"> /*!</font>
00030 <font class="comment"> \param key The (char *) containing the keyname</font>
00031 <font class="comment"> \param value The (char *) to set the key value to</font>
00032 <font class="comment"> */</font>
00033 <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classIEpair.html#a5">SetKeyValue</a>( <font class="keywordtype">char</font> *key, <font class="keywordtype">char</font> *value ) = 0;
00034 <font class="comment"></font>
00035 <font class="comment"> //! Get a vec3_t for the entities origin</font>
00036 <font class="comment"></font> <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classIEpair.html#a6">GetEntityOrigin</a>( vec3_t vec ) = 0;
00037 <font class="comment"></font>
00038 <font class="comment"> //! Compute the rotated bounds of the BBox based on "angle" and "angles" keys</font>
00039 <font class="comment"></font> <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classIEpair.html#a7">CalculateRotatedBounds</a>( vec3_t mins, vec3_t maxs ) = 0;
00040 };
</pre></div>
<!-- ---------------- Start Footer ----------------- -->
</td></tr></table>
</center>
<br><br>
<div align="center">
<table width="95%" cellpadding="1" cellspacing="0">
<tr>
<td width="50%">
<i>Documentation generated by : <a href="http://www.doxygen.org">Doxygen</a> 1.2.8.1 on 11 Aug 2001</i>
</td>
<td align="right">
<a href="mailto:ttimo@idsoftware.com">
<i>ttimo@idsoftware.com</i>
</a>
</td>
</tr>
</table>
</div>
<br>
<br>
</div></td>
<td background="../images/body-right-tile.gif" height="100%">&nbsp;</td>
</tr>
<tr>
<td valign="top" align="left">
<img src="../images/body-lower-left.gif" alt="" width="19" height="12">
</td>
<td valign="top" background="../images/body-lower-tile.gif">
<img border="0" src="../images/body-lower-tile.gif" height="12" width="100%">
</td>
<td valign="top" align="right">
<img src="../images/body-lower-right.gif" alt="" width="19" height="12">
</td>
</tr>
</table>
</td>
<td valign="top">
</td>
</tr>
</table>
</div>
</body>
</html>

View file

@ -0,0 +1,107 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>IEPairsClassDocumentationExample Doxygen Documentation</title>
<link href="doxygen_gtkradiant.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
</head>
<body bgcolor="black">
<div align="center">
<table cellpadding="0" cellspacing="0" border="0" width="94%">
<tr>
<td>
<img src="../images/top-title.gif" alt="" width="254" height="92">
</td>
<td background="../images/top-tile.gif" valign="top" align="right" width="100%">
<br><img src="../images/history_id_logo.gif" alt="idsoftware" border="0">
</td>
<td align="left">
<img src="../images/top-right.gif" alt="" width="12" height="92">
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" width="95%">
<tr>
<td valign="top" align="left">
<img src="../images/body-upper-left.gif" alt="" width="19" height="12">
</td>
<td valign="top" background="../images/body-upper-tile.gif">
<img border="0" src="../images/body-upper-tile.gif" height="12" width="100%">
</td>
<td valign="top" align="right">
<img src="../images/body-upper-right.gif" alt="" width="19" height="12">
</td>
</tr>
<tr>
<td background="../images/body-left-tile.gif" height="100%">&nbsp;</td>
<td width="100%" height="100%" bgcolor="#EEEEEE" cellpadding="0" cellspacing="0" border="1"><div>
<br><hr>
<center>
<table cellpadding="0" cellspacing="0" border="0" width="95%"><tr><td>
<!-- ----------------- End Header ----------------- -->
<!-- Generated by Doxygen 1.2.8.1 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="pages.html">Related Pages</a> &nbsp; </center>
<hr><h1>iepairs.h File Reference</h1>
<p>
<a href="test_8c-source.html">Go to the source code of this file.</a><table border=0 cellpadding=0 cellspacing=0>
<tr><td colspan=2><br><h2>Compounds</h2></td></tr>
<tr><td nowrap align=right valign=top>class &nbsp;</td><td valign=bottom><a class="el" href="classIEpair.html">IEpair</a></td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Virtual class to allow plugin operations on entity pairs.</em> <a href="classIEpair.html#_details">More...</a><em></em></font><br><br></td></tr>
</table>
<!-- ---------------- Start Footer ----------------- -->
</td></tr></table>
</center>
<br><br>
<div align="center">
<table width="95%" cellpadding="1" cellspacing="0">
<tr>
<td width="50%">
<i>Documentation generated by : <a href="http://www.doxygen.org">Doxygen</a> 1.2.8.1 on 11 Aug 2001</i>
</td>
<td align="right">
<a href="mailto:ttimo@idsoftware.com">
<i>ttimo@idsoftware.com</i>
</a>
</td>
</tr>
</table>
</div>
<br>
<br>
</div></td>
<td background="../images/body-right-tile.gif" height="100%">&nbsp;</td>
</tr>
<tr>
<td valign="top" align="left">
<img src="../images/body-lower-left.gif" alt="" width="19" height="12">
</td>
<td valign="top" background="../images/body-lower-tile.gif">
<img border="0" src="../images/body-lower-tile.gif" height="12" width="100%">
</td>
<td valign="top" align="right">
<img src="../images/body-lower-right.gif" alt="" width="19" height="12">
</td>
</tr>
</table>
</td>
<td valign="top">
</td>
</tr>
</table>
</div>
</body>
</html>

View file

@ -0,0 +1,105 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>IEPairsClassDocumentationExample Doxygen Documentation</title>
<link href="doxygen_gtkradiant.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
</head>
<body bgcolor="black">
<div align="center">
<table cellpadding="0" cellspacing="0" border="0" width="94%">
<tr>
<td>
<img src="../images/top-title.gif" alt="" width="254" height="92">
</td>
<td background="../images/top-tile.gif" valign="top" align="right" width="100%">
<br><img src="../images/history_id_logo.gif" alt="idsoftware" border="0">
</td>
<td align="left">
<img src="../images/top-right.gif" alt="" width="12" height="92">
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" width="95%">
<tr>
<td valign="top" align="left">
<img src="../images/body-upper-left.gif" alt="" width="19" height="12">
</td>
<td valign="top" background="../images/body-upper-tile.gif">
<img border="0" src="../images/body-upper-tile.gif" height="12" width="100%">
</td>
<td valign="top" align="right">
<img src="../images/body-upper-right.gif" alt="" width="19" height="12">
</td>
</tr>
<tr>
<td background="../images/body-left-tile.gif" height="100%">&nbsp;</td>
<td width="100%" height="100%" bgcolor="#EEEEEE" cellpadding="0" cellspacing="0" border="1"><div>
<br><hr>
<center>
<table cellpadding="0" cellspacing="0" border="0" width="95%"><tr><td>
<!-- ----------------- End Header ----------------- -->
<!-- Generated by Doxygen 1.2.8.1 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="pages.html">Related Pages</a> &nbsp; </center>
<hr><a name="todo"><h2>Todo List</h2></a>
<dl compact>
<dt><a name="_todo000001"></a>Class <a class="el" href="classIEpair.html">IEpair</a> <dd>Write more complete documentation for this class so that it's use is clear
</dl>
<!-- ---------------- Start Footer ----------------- -->
</td></tr></table>
</center>
<br><br>
<div align="center">
<table width="95%" cellpadding="1" cellspacing="0">
<tr>
<td width="50%">
<i>Documentation generated by : <a href="http://www.doxygen.org">Doxygen</a> 1.2.8.1 on 11 Aug 2001</i>
</td>
<td align="right">
<a href="mailto:ttimo@idsoftware.com">
<i>ttimo@idsoftware.com</i>
</a>
</td>
</tr>
</table>
</div>
<br>
<br>
</div></td>
<td background="../images/body-right-tile.gif" height="100%">&nbsp;</td>
</tr>
<tr>
<td valign="top" align="left">
<img src="../images/body-lower-left.gif" alt="" width="19" height="12">
</td>
<td valign="top" background="../images/body-lower-tile.gif">
<img border="0" src="../images/body-lower-tile.gif" height="12" width="100%">
</td>
<td valign="top" align="right">
<img src="../images/body-lower-right.gif" alt="" width="19" height="12">
</td>
</tr>
</table>
</td>
<td valign="top">
</td>
</tr>
</table>
</div>
</body>
</html>

159
Doxygen_files/genDoxyfile Normal file
View file

@ -0,0 +1,159 @@
# Doxyfile 1.2.5-20010304
#---------------------------------------------------------------------------
# General configuration options
#---------------------------------------------------------------------------
PROJECT_NAME =
PROJECT_NUMBER =
OUTPUT_DIRECTORY =
OUTPUT_LANGUAGE = English
EXTRACT_ALL = YES
EXTRACT_PRIVATE = YES
EXTRACT_STATIC = YES
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ALWAYS_DETAILED_SEC = YES
FULL_PATH_NAMES = YES
STRIP_FROM_PATH = $(PWD)/
INTERNAL_DOCS = YES
CLASS_DIAGRAMS = YES
SOURCE_BROWSER = YES
INLINE_SOURCES = YES
STRIP_CODE_COMMENTS = NO
CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = NO
VERBATIM_HEADERS = YES
SHOW_INCLUDE_FILES = YES
JAVADOC_AUTOBRIEF = YES
INHERIT_DOCS = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
DISTRIBUTE_GROUP_DOC = NO
TAB_SIZE = 2
ENABLED_SECTIONS =
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
ALIASES =
MAX_INITIALIZER_LINES = 30
OPTIMIZE_OUTPUT_FOR_C = NO
SHOW_USED_FILES = YES
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = YES
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE = doxygen.log
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT =
FILE_PATTERNS = *.h \
*.cpp \
*.c
RECURSIVE = YES
EXCLUDE =
EXCLUDE_PATTERNS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
IMAGE_PATH =
INPUT_FILTER =
FILTER_SOURCE_FILES = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX = 4
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT =
HTML_HEADER = Doxygen_files/doxygen_gtkradiant_head.html
HTML_FOOTER = Doxygen_files/doxygen_gtkradiant_foot.html
HTML_STYLESHEET = Doxygen_files/doxygen_gtkradiant.css
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
GENERATE_CHI = NO
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO
TREEVIEW_WIDTH = 250
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = NO
LATEX_OUTPUT =
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = NO
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT =
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT =
MAN_EXTENSION = .3
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED =
#---------------------------------------------------------------------------
# Configuration::addtions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
HAVE_DOT = YES
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
GRAPHICAL_HIERARCHY = YES
DOT_PATH =
MAX_DOT_GRAPH_WIDTH = 1024
MAX_DOT_GRAPH_HEIGHT = 1024
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::addtions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = NO
CGI_NAME = search.cgi
CGI_URL =
DOC_URL =
DOC_ABSPATH =
BIN_ABSPATH = /usr/local/bin/
EXT_DOC_PATHS =
#---------------------------------------------------------------------------
# Include file, at the bottom to over-ride anything I missed.
#---------------------------------------------------------------------------
@INCLUDE = ./Doxygen_files/genConf

View file

@ -0,0 +1,421 @@
#!/bin/bash
# Functions for the gendox script
#
# Gef, Aug 2001
#------------------------------------------------------------------------
# Set the doxygen output language from the system locale
#------------------------------------------------------------------------
get_language() {
if [ -n "$LANG" ] ; then
local LANG=`locale | grep LANG | cut -d= -f2`;
fi
case "$LANG" in
czech)
OUPUTLANGUAGE="Czech";
;;
german)
OUPUTLANGUAGE="German";
;;
spanish)
OUPUTLANGUAGE="Spanish";
;;
finnish)
OUPUTLANGUAGE="Finnish";
;;
french)
OUPUTLANGUAGE="French";
;;
italian)
OUPUTLANGUAGE="Italian";
;;
japanese*)
OUPUTLANGUAGE="Japanese";
;;
dutch)
OUPUTLANGUAGE="Dutch";
;;
swedish)
OUPUTLANGUAGE="Swedish";
;;
*)
OUPUTLANGUAGE="English";
;;
esac
}
#------------------------------------------------------------------------
# Output usage info & output help
#------------------------------------------------------------------------
output_usage() {
echo -e "Usage: $0 [<target(s)>] [-o <output_directory>]";
return;
}
output_help() {
output_usage;
echo -e "\nOptions:";
echo -e " [<target(s)>]";
echo -e " This is an optional parameter that specifies the directory, or multiple";
echo -e " directories from which to generate the documentation.";
echo -e "";
echo -e " [-o <output_directory>]";
echo -e " An optional parameter that specifies the output directory in which";
echo -e " to save the generated documentation.";
echo -e "";
echo -e " -q or --quiet";
echo -e " Prevents the output of status information"
echo -e ""
echo -e " --help, or -h";
echo -e " Displays this information";
echo -e ""
echo -e " -q or --quiet";
echo -e " Prevents the output of status information"
echo -e ""
echo -e " -k or --kill";
echo -e " kills running doxygen pids."
echo -e ""
echo -e "* Further information on using this script, can be found in README.doxygen";
echo -e "* in the current directory.";
}
#------------------------------------------------------------------------
# Set the target to what was passed on the command line
#------------------------------------------------------------------------
parse_commandline() {
# todo:
# need to add the ability to check for an auto gen'd version
# used for automatically generating new documentation for each commit
# to the cvs server
# funky bash shell array
declare -a OPTLIST[$#];
if [ $OPTCOUNT == 0 ] ; then
# No options on the command line so set the target list to the core
TARGETCOUNT=0;
OUTPUTDIR="../$(basename `pwd`)-doxygen";
else
# put all the command line options into an array
for f in $COMLINE ; do
OPTLIST[$COUNTER]="$f";
let COUNTER++;
done
for (( COUNTER=0 ; $COUNTER < $OPTCOUNT; $[COUNTER++] )) ; do
if [ "${OPTLIST[$COUNTER]}" == "--help" ] ; then
# output usage information
output_help;
RETVAL=1;
return;
elif [ "${OPTLIST[$COUNTER]}" == "-h" ] ; then
# output usage information
output_help;
RETVAL=1;
return;
fi
case ${OPTLIST[$COUNTER]} in
-q)
QUIETMODE=1;
;;
--quiet)
QUIETMODE=1;
;;
-k)
KILLON=1;
;;
--kill)
KILLON=1;
;;
-o)
# look for the -o switch, and get the next command line option as the output dir
if [ -z ${OPTLIST[$COUNTER + 1]} ] ; then
[ $QUIETMODE -gt 0 ] || echo -e " ** Output switch used, but no output dir passed...";
[ $QUIETMODE -gt 0 ] || echo -e " ** Setting default output dir.";
else
let COUNTER++;
OUTPUTDIR=${OPTLIST[$COUNTER]};
fi
break;
;;
**)
# If the command line option is anything other that -o then assume it's a target
# Check to make sure the target exists first...
if [ -d ${OPTLIST[$COUNTER]} ] ; then
TARGETLIST[$COUNTER]=${OPTLIST[$COUNTER]};
else
output_usage;
echo -e " ** Error: Non-existent directory specified as a target.\nExiting.";
RETVAL=1;
return;
fi
let TARGETCOUNT++;
;;
esac
done
fi # if [ $OPTCOUNT == 0 ] ;
if [ $TARGETCOUNT == 0 ] ; then
TARGETCOUNT=4;
TARGETLIST[0]="include";
TARGETLIST[1]="libs";
TARGETLIST[2]="radiant";
TARGETLIST[3]="plugins";
# Gef: outputdir for default core when no targets are passed on the command line
# TTimo problem still there, if -o used on command line, don't override
if [ -z $OUTPUTDIR ] ; then
OUTPUTDIR="../$(basename `pwd`)-doxygen";
fi
fi
# Add trailing slash's to the lines that need them
TARGETSTRING=`echo ${TARGETLIST[*]} | sed -e 's/" "/", "/'`
[ $QUIETMODE -gt 0 ] || echo -ne " -> Set Input to: ";
for (( COUNTER=0; COUNTER < $TARGETCOUNT ; $[COUNTER++] )) ; do
if [ $COUNTER == $[TARGETCOUNT - 1] ] ; then
[ $QUIETMODE -gt 0 ] || echo -ne "${TARGETLIST[$COUNTER]}\n";
TARGETLIST[$COUNTER]="${TARGETLIST[$COUNTER]}";
else
[ $QUIETMODE -gt 0 ] || echo -ne "${TARGETLIST[$COUNTER]}, ";
TARGETLIST[$COUNTER]="${TARGETLIST[$COUNTER]} \\";
fi
done
[ $QUIETMODE -gt 0 ] || echo -e " -> Set Output Dir to: $OUTPUTDIR";
return;
}
#------------------------------------------------------------------------
# Try to extract the version number
# todo: find a better way to determine the version
#------------------------------------------------------------------------
get_version() {
VERSION=`grep PROJECT_NUMBER $DOXYCONFIG | grep -v \# | cut -d= -f2`;
if [ -z $VERSION ] ; then
if [ -f "./include/version.default" ] ; then # checks that we are in the right dir
VERSION=`cat ./include/version.default`;
else
VERSION="(Unknown)";
fi
fi
return;
}
#------------------------------------------------------------------------
# Create a projectname from the tree name
#------------------------------------------------------------------------
get_projectname() {
PROJECTNAME=`grep PROJECT_NAME $DOXYCONFIG | grep -v \# | cut -d= -f2`;
if [ -z $PROJECTNAME ] ; then
# PROJECTNAME=`echo $TARGET | sed -e s/[^A-Za-z0-9]/!/ | cut -d! -f1`;
PROJECTNAME="$(basename `pwd`)";
fi
return;
}
#------------------------------------------------------------------------
# function to determine the path to the perl executable
#------------------------------------------------------------------------
get_perlpath() {
if [ -f "$DOXYCONFIG" ] ; then
PERLPATH=`grep PERL_PATH $DOXYCONFIG | grep = | cut -d= -f2`
fi
if [ 'basename $PERLPATH &2>/dev/null' != "perl" ] ; then
PERLPATH=`which perl 2>/dev/null | sed -e 's/perl//'`;
elif [ 'basename $PERLPATH &2>/dev/null' != "perl" ] ; then
PERLPATH="";
fi
return;
}
#------------------------------------------------------------------------
# Function to determine the path to the dot executable
#------------------------------------------------------------------------
get_dotpath() {
if [ -f "$DOXYCONFIG" ] ; then
DOTPATH=`grep DOT_PATH $DOXYCONFIG | grep = | cut -d= -f2`
fi
if [ -z $DOTPATH ] || [ `basename $DOTPATH 2>/dev/null` != "dot" ] ; then
DOTPATH=`which dot 2>/dev/null`;
fi
if [ -z $DOTPATH ] || [ `basename $DOTPATH 2>/dev/null` != "dot" ] ; then
DOTPATH="";
HAVEDOT="No";
echo -e "** Warning: dot not found.";
[ $QUIETMODE -gt 0 ] || echo -e "** dot is part of the GraphVis package and is used to generate";
[ $QUIETMODE -gt 0 ] || echo -e "** dependancy/inheritance/include (etc) diagrams.";
[ $QUIETMODE -gt 0 ] || echo -e "** It's suggested that you install the GraphVis package for those";
[ $QUIETMODE -gt 0 ] || echo -e "** features.";
[ $QUIETMODE -gt 0 ] || echo -e "** GraphVis can be downloaded from www.graphvis.org";
else
HAVEDOT="Yes";
DOTPATH=`echo $DOTPATH | sed -e 's/dot//'`;
fi
return;
}
#------------------------------------------------------------------------
# Function to move stuff around
#------------------------------------------------------------------------
# eg: move the images into the output directory & the reference doc into the
# html directory.
# called after doxygen has finished generating documentation
move_stuff() {
[ $QUIETMODE -gt 0 ] || echo -ne " -> Move stuff.\n";
if [ ! -d $OUTPUTDIR ] ; then
mkdir $OUTPUTDIR;
fi
if [ ! -d "$EXTRAS_PATH/images/" ] ; then
[ $QUIETMODE -gt 0 ] || echo -e " - Looking for images.";
[ $QUIETMODE -gt 0 ] || sleep 2;
[ $QUIETMODE -gt 0 ] || echo -e " - I can't find the images...";
[ $QUIETMODE -gt 0 ] || sleep 1;
[ $QUIETMODE -gt 0 ] || echo -e " - Where did you put the images!?";
[ $QUIETMODE -gt 0 ] || sleep 2;
[ $QUIETMODE -gt 0 ] || echo -e " - They have to be here somewhere...";
[ $QUIETMODE -gt 0 ] || sleep 1;
[ $QUIETMODE -gt 0 ] || echo -e " - Looking in /dev/null";
[ $QUIETMODE -gt 0 ] || sleep 3;
[ $QUIETMODE -gt 0 ] || echo -e " - YOU FOOL, YOU DELETED THE IMAGES!!!";
[ $QUIETMODE -gt 0 ] || sleep 1;
[ $QUIETMODE -gt 0 ] || echo -e " - I quit!";
RETVAL=666;
else
if [ ! -d $OUTPUTDIR/images ] ; then
mkdir $OUTPUTDIR/images ;
fi
cp $EXTRAS_PATH/images/* $OUTPUTDIR/images/ ;
RETVAL=0;
fi
return;
}
#------------------------------------------------------------------------
# clean_up() removes old versions of the documentation
#------------------------------------------------------------------------
clean_up() {
if [ -f $OUTPUTDIR/html/index.html ] ; then
[ $QUIETMODE -gt 0 ] || echo -e " -> Trashing old dox.";
rm -f $OUTPUTDIR/html/*
fi
return;
}
#------------------------------------------------------------------------
# Create a new genConf & Doxyfile
#------------------------------------------------------------------------
gen_doxyconfig() {
[ $QUIETMODE -gt 0 ] || echo -e " -> Generating DoxyConfig.";
RETVAL=0;
# first need to make sure there is a Doxyfile here
if [ ! -f $DOXYFILE ] ; then
# what now? (could generate one with 'doxygen -e Doxyfile') but it would be screwed.
echo -e "No Doxyfile here...";
RETVAL=3;
return;
else
# Create a new doxyfile with the @INCLUDE statement including the generated stuff
echo "`cat $DOXYFILE | grep -v @INCLUDE`" > $NEWDOXYFILE
echo "@INCLUDE = $CONFIG_OUTPUT" >> $NEWDOXYFILE
fi
# remove the old config file
rm -f $CONFIG_OUTPUT
# create a new one
touch $CONFIG_OUTPUT
echo "# Generated configuration - Do Not Edit." >> $CONFIG_OUTPUT;
echo "# If you want to modify options, edit DoxyConfig and re-run genconf." >> $CONFIG_OUTPUT;
echo -e "\n" >> $CONFIG_OUTPUT;
echo -e "PROJECT_NAME=$PROJECTNAME" >> $CONFIG_OUTPUT;
echo -e "PROJECT_NUMBER=$VERSION" >> $CONFIG_OUTPUT;
echo -e "PERL_PATH=$PERLPATH" >> $CONFIG_OUTPUT;
echo -e "HAVE_DOT=$HAVEDOT" >> $CONFIG_OUTPUT;
echo -e "DOT_PATH=$DOTPATH" >> $CONFIG_OUTPUT;
echo -e "OUTPUT_LANGUAGE=$OUTPUTLANGUAGE" >> $CONFIG_OUTPUT;
echo -n "INPUT=" >> $CONFIG_OUTPUT;
for (( COUNTER=0 ; COUNTER < $TARGETCOUNT; $[COUNTER++] )) ; do
# echo -e "${TARGETLIST[$COUNTER]}";
echo -e "${TARGETLIST[$COUNTER]}" >> $CONFIG_OUTPUT
done
# echo -e "INPUT=$TARGET" >> $CONFIG_OUTPUT;
echo -e "OUTPUT_DIRECTORY=$OUTPUTDIR" >> $CONFIG_OUTPUT;
echo -e "\n" >> $CONFIG_OUTPUT;
return;
}
#------------------------------------------------------------------------
# Build the reference page & index
#------------------------------------------------------------------------
build_extra_html() {
# file locations
REF_OUT="$OUTPUTDIR/reference/index.html"
INDEX_OUT="$OUTPUTDIR/index.html"
# Make the output directory if it doesn't exist
if [ ! -d $OUTPUTDIR/reference/ ] ; then
[ $QUIETMODE -gt 0 ] || echo -e " -> Making reference directory";
mkdir $OUTPUTDIR/reference
fi
# cat the files together and output the result to each file
[ $QUIETMODE -gt 0 ] || echo -e " -> Building reference document";
cat $EXTRAS_PATH/doxygen_reference_head.html $EXTRAS_PATH/reference1.html $EXTRAS_PATH/doxygen_reference_foot.html > $REF_OUT;
if [ ! -d $OUTPUTDIR/example/ ] ; then
[ $QUIETMODE -gt 0 ] || echo -e " -> Making example dir";
mkdir $OUTPUTDIR/example
fi
[ $QUIETMODE -gt 0 ] || echo -e " -> Moving example docs";
cp $EXTRAS_PATH/example/* $OUTPUTDIR/example/
cp $EXTRAS_PATH/doxygen_gtkradiant.css $OUTPUTDIR/example/
# Make a redirecting index.html
cat $EXTRAS_PATH/doxygen_index.html > $INDEX_OUT;
return;
}
#------------------------------------------------------------------------
# Execute doxygen
#------------------------------------------------------------------------
run_doxygen() {
# copy doxy_mainpage.h to the target directory
# pipe it through sed to add generation time/date and username - $machine
TEMPLOCATION=`echo $TARGETSTRING | cut -d' ' -f1`;
if [ X"$USERNAME" == "X" ] ; then
USERNAME=`whoami`;
fi
MACHINE=`uname -n`; # `uname -n` or `hostname` ??
cp $EXTRAS_PATH/doxy_mainpage.h temp.h
cat temp.h |
sed "s/+project+/$PROJECTNAME/" |
sed "s|+target+|$TARGETSTRING|" |
sed "s/+user+/$USERNAME/" |
sed "s/+machine+/$MACHINE/" |
sed "s/+date+/$(date '+%b %d %Y')/" > $TEMPLOCATION/doxy_mainpage.h ;
rm -f temp.h
# Start doxygen with the command "doxygen $DOXYFILE"
[ $QUIETMODE -gt 0 ] || echo -e " -> Executing doxygen.";
[ $QUIETMODE -gt 0 ] || echo -e "> doxygen $NEWDOXYFILE";
doxygen $NEWDOXYFILE
RETVAL=$?
# remove doxy_mainpage.h from the target directory
rm -f $TEMPLOCATION/doxy_mainpage.h
return;
}
#------------------------------------------------------------------------
# End.

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 606 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

View file

@ -0,0 +1,333 @@
<div align="center">
<table width="95%" cellpadding="0" cellspacing="0" border="0">
<tr><td>
<a href="../html/index.html">GtkRadiant Doxygen Documentation</a>
<a name="top"></a>
<h1>Doxygen Quick Reference</h1>
<hr>
<p align="left">
<h2>Index</h2>
<ol>
<li><a href="#cs">Commenting styles</a></li>
<li><a href="#qts">Qt Style C++ Class Example</a></li>
<li><a href="#jds">JavaDoc Style C++ Class Example</a></li>
<li><a href="#spt">Special Tags</a></li>
<li><a href="#stt">Structural Tags</a></li>
</ol>
</p>
<hr>
<a name="cs"></a>
<h2>1. Commenting Styles</h2>
There are two different <i>styles</i> of commenting that doxygen recognises.
<p align="left">
Qt Style:<br>
<code>
/*!<br>
.... text ....<br>
*/<br>
<br>
</code>
Qt Style Single line<br>
<code>
//! .... one line of text ....<br>
</code>
</p>
<p align="left">
JavaDoc Style:<br>
<code>
/**<br>
* .... text ....<br>
*/<br>
</code>
<br>
JavaDoc Style Single line<br>
<code>
/// .... one line of text ....<br>
</code>
</p>
<p>
Doxygen only allows one brief and one detailed description for each declaration/definition.
If there is a brief description before a declaration, and one before the a definition, only
the one before the <i>declaration</i> will be used. If the same situation occurs for a detailed
description the one before the <i>definition</i> is preferred and the one before the declaration will
be ignored.<br>
A useful method is to have the brief documentation with the declaration in the header file,
and the detailed documentation with the definition in the source file.
<p>
<i>Note: Standard C/C++ comments are ignored by doxygen, but will be included in the code listing
for that file. </i>
</p>
</p>
<p align="right"><a href="#top">top</a> </p>
<hr>
<a name="qts"></a>
<h2>2. Qt Style C++ Class Example</h2>
<p>
Here is an example of a C++ class using Qt Style documentation.<br>
The IEpair class from include/iepairs.h is used here. The html result of using these comments
can be found <a href="../example/index.html">here</a>.<br>
<p>
<i>Note: The resulting html was generated from a single file. If it were generated as part of
the whole documentation, many of the function names and variables would be hyperlinks to
their definitions.</i><br>
</p>
<pre>
//! Virtual class to allow plugin operations on entity pairs
/*!
\todo Write more complete documentation for this class so that it's use
is clear
An interface to entity keys and key pairs that allows plugins to;
read and write entity keys and key values, get a key value as a
vec3_t
*/
class IEpair
{
public:
//! Increment the number of references to this object
virtual void IncRef () = 0;
//! Decrement the reference count
virtual void DecRef () = 0;
//! Get a vector from a key
virtual void GetVectorForKey( char* key, vec3_t vec ) = 0;
//! Get a float from a key
virtual float FloatForKey( char *key ) = 0;
//! Get a string (char *) from a key
virtual char* ValueForKey( char *key ) = 0;
//! Set a key value to char *value
/*!
\param key The (char *) containing the keyname
\param value The (char *) to set the key value to
*/
virtual void SetKeyValue( char *key, char *value ) = 0;
//! Get a vec3_t for the entities origin
virtual void GetEntityOrigin( vec3_t vec ) = 0;
//! Compute the rotated bounds of the BBox based on "angle" and "angles" keys
virtual void CalculateRotatedBounds( vec3_t mins, vec3_t maxs ) = 0;
};
</pre>
</p>
<p>
<p align="right"><a href="#top">top</a> </p>
<a name="jds"></a>
<h2>3. JavaDoc Style C++ Class Example</h2>
The same class documented using JavaDoc Style comments
<pre>
/// Virtual class to allow plugin operations on entity pairs
/**
* @todo Write more complete documentation for this class so that it's use
* is clear
*
* An interface to entity keys and key pairs that allows plugins to;
* read and write entity keys and key values, get a key value as a
* vec3_t
*/
class IEpair
{
public:
/// Increment the number of references to this object
virtual void IncRef () = 0;
/// Decrement the reference count
virtual void DecRef () = 0;
/// Get a vector from a key
virtual void GetVectorForKey( char* key, vec3_t vec ) = 0;
/// Get a float from a key
virtual float FloatForKey( char *key ) = 0;
/// Get a string (char *) from a key
virtual char* ValueForKey( char *key ) = 0;
/** Set a key value to char *value
* @param key The (char *) containing the keyname
* @param value The (char *) to set the key value to
*/
virtual void SetKeyValue( char *key, char *value ) = 0;
//! Get a vec3_t for the entities origin
virtual void GetEntityOrigin( vec3_t vec ) = 0;
//! Compute the rotated bounds of the BBox based on "angle" and "angles" keys
virtual void CalculateRotatedBounds( vec3_t mins, vec3_t maxs ) = 0;
};
</pre>
</p>
<p align="right"><a href="#top">top</a> </p>
<hr>
<a name="spt"></a>
<h2>4. Special Tags</h2>
<p>
Special tags using the Qt style begin with a " \ ", or using JavaDoc style a " @ " (the two should not be mixed).<br>
<br>
<b>Common special tags</b><br>
<center>
<table width="90%" cellpadding="4" cellspacing="2" border="0" valign="top">
<tr><td width="10%" bgcolor="#DDDDDD" align="right">
<b>author</b>
</td><td bgcolor="#DDDDDD">
<i>The author or a list of comma separated authors/contributers</i>
</td></tr><tr><td bgcolor="#CCCCCC" align="right">
<b>see</b>
</td><td bgcolor="#CCCCCC">
<i>A reference to another class, class member, function, etc...</i>
</td></tr><tr><td bgcolor="#DDDDDD" align="right">
<b>param</b>
</td><td bgcolor="#DDDDDD">
<i>A description of a specific function argument or parameter</i>
</td></tr><tr><td bgcolor="#CCCCCC" align="right">
<b>return</b>
</td><td bgcolor="#CCCCCC">
<i>A description of the value returned from a function/method</i>
</td></tr><tr><td bgcolor="#DDDDDD" align="right">
<b>bug</b>
</td><td bgcolor="#DDDDDD">
<i>Starts a paragraph where one or more bugs may be listed.</i>
</td></tr><tr><td bgcolor="#CCCCCC" align="right">
<b>note</b>
</td><td bgcolor="#CCCCCC">
<i>Starts a paragraph where a note may be entered.</i>
</td></tr><tr><td bgcolor="#DDDDDD" align="right">
<b>todo</b>
</td><td bgcolor="#DDDDDD">
<i>Starts a paragraph where a TODO item is described.</i><br>
Note: All TODO items are collated into a separate todo list, each linking to each other
</td></tr><tr><td bgcolor="#CCCCCC" align="right">
<b>version</b>
</td><td bgcolor="#CCCCCC">
<i>Starts a paragraph where one or more version strings may be entered.</i>
</td></tr><tr><td bgcolor="#DDDDDD" align="right">
<b>warning</b>
</td><td bgcolor="#DDDDDD">
<i>Starts a paragraph where one or more warning messages may be entered.</i>
</td></tr><tr><td bgcolor="#DDDDDD" align="right">
<b>brief</b>
</td><td bgcolor="#DDDDDD">
<i>A single line comment in place of the //! or /// comment.</i>
</td>
</tr>
</table>
</center>
<br>
<p align="right"><a href="#top">top</a></p>
<hr>
<a name="stt"></a>
<h2>5. Structural Tags</h2>
<p>
These are used to document a named object, and are not required to be located near that
object definition or declaration. This allows the documentation for an object to be located
anywhere in the doxygen input files. The exception to this rule however, is that these
documentation blocks cannot be within the body of a function or within C style comment blocks.
All structural commands are preceded by either a " \ " or a " @ ", depending on the
documentation style, and require one or more parameters to specify the name of the object
the description is referring to.<br>
</p>
<p>
An example of the \file structural tag:
<pre>
/*! \file iepairs.h
\brief One line documentation for this file
\author Author(s)
Long description of this file
*/
</pre>
</p>
<b>Common Structural Tags</b><br><br>
<center>
<table width="90%" cellpadding="4" cellspacing="2" border="0" valign="top">
<tr><td width="10%" bgcolor="#DDDDDD" align="right">
<b>class</b>
</td><td bgcolor="#DDDDDD">
<i>Documents a class<br>
eg:<code><br>
/*! \class IEpair<br>
\brief Short description of the IEpair class<br>
<br>
Detailed description of the IEpair class<br>
*/<br>
</code>
</i>
</td></tr><tr><td bgcolor="#CCCCCC" align="right">
<b>def</b>
</td><td bgcolor="#CCCCCC">
<i>Describes a #define<br>
eg:<code><br>
/*! \def MAX_VALUE The name of the define<br>
\brief Description of MAX_VALUE<br>
*/<br>
</code>
</i>
</td></tr><tr><td bgcolor="#DDDDDD" align="right">
<b>file</b>
</td><td bgcolor="#DDDDDD">
<i>Describes a file<br>
eg:<code><br>
/*! \file iepairs.h The name of the file<br>
\brief Description of the file iepairs.h<br>
<br>
Details<br>
*/<br>
</code>
</i>
</td></tr><tr><td bgcolor="#CCCCCC" align="right">
<b>struct</b>
</td><td bgcolor="#CCCCCC">
<i>Documents a struct<br>
eg:<code><br>
/*! \struct BTListList_t the name of the struct<br>
\brief Description of BTListList_t<br>
<br>
Details<br>
*/<br>
</code>
</i>
</td></tr><tr><td bgcolor="#DDDDDD" align="right">
<b>var</b>
</td><td bgcolor="#DDDDDD">
<i>Documents a typedef, variable or enum value<br>
eg:<code><br>
/*! \var typedef unsigned int UINT32<br>
\brief Short description<br>
*/<br>
</code>
</i>
</td></tr><tr><td bgcolor="#CCCCCC" align="right">
<b>fn</b>
</td><td bgcolor="#CCCCCC">
<i>Documents a function</i>
eg:<code><br>
/*! \fn virtual void IEpair::DecRef() = 0;<br>
\brief Short description of this function<br>
<br>
Detailed description of this function<br>
*/<br>
</code>
</i>
</td>
</tr>
</table>
</center>
<br>
<p align="right"><a href="#top">top</a> </p>
<hr>
</td></tr>
</table>
</div>

340
GPL Normal file
View file

@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<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.

690
GtkRadiant.prj Normal file
View file

@ -0,0 +1,690 @@
# Anjuta Version 1.0.2
Compatibility Level: 1
<PROJECT_DESCRIPTION_START>
level editor for Id technology games
<PROJECT_DESCRIPTION_END>
<CONFIG_PROGS_START>
<CONFIG_PROGS_END>
<CONFIG_LIBS_START>
<CONFIG_LIBS_END>
<CONFIG_HEADERS_START>
<CONFIG_HEADERS_END>
<CONFIG_CHARACTERISTICS_START>
<CONFIG_CHARACTERISTICS_END>
<CONFIG_LIB_FUNCS_START>
<CONFIG_LIB_FUNCS_END>
<CONFIG_ADDITIONAL_START>
<CONFIG_ADDITIONAL_END>
<CONFIG_FILES_START>
<CONFIG_FILES_END>
<MAKEFILE_AM_START>
<MAKEFILE_AM_END>
props.file.type=project
anjuta.version=1.0.2
anjuta.compatibility.level=1
project.name=GtkRadiant
project.type=GENERIC
project.target.type=EXECUTABLE
project.version=changesallthetime
project.author=qeradiant.com dev team
project.source.target=install/radiant.x86
project.has.gettext=0
project.programming.language=C_C++
project.excluded.modules= intl
project.config.extra.modules.before=
project.config.extra.modules.after=
project.config.blocked=1
project.config.disable.overwriting=1 1 1 1 1 1 1 1 1
project.menu.entry=GtkRadiant Version changesallthetime
project.menu.group=Application
project.menu.comment=GtkRadiant Version changesallthetime
project.menu.icon=
project.menu.need.terminal=0
project.configure.options=
anjuta.program.arguments=
preferences.indent.automatic=1
preferences.use.tabs=0
preferences.indent.opening=0
preferences.indent.closing=0
preferences.tabsize=2
preferences.indent.size=2
preferences.autoformat.style=Style of Kangleipak
preferences.autoformat.custom.style= -i8 -sc -bli0 -bl0 -cbi0 -ss
preferences.autoformat.disable=0
module.include.name=.
module.include.type=
module.include.expanded=1
module.include.files=\
Doxygen_files/doxy_mainpage.h\
contrib/bobtoolz/CPortals.h\
contrib/bobtoolz/DBobView.h\
contrib/bobtoolz/DBrush.h\
contrib/bobtoolz/DEPair.h\
contrib/bobtoolz/DEntity.h\
contrib/bobtoolz/DListener.h\
contrib/bobtoolz/DMap.h\
contrib/bobtoolz/DPatch.h\
contrib/bobtoolz/DPlane.h\
contrib/bobtoolz/DPoint.h\
contrib/bobtoolz/DShape.h\
contrib/bobtoolz/DVisDrawer.h\
contrib/bobtoolz/DWinding.h\
contrib/bobtoolz/StdAfx.h\
contrib/bobtoolz/bobToolz.h\
contrib/bobtoolz/bsploader.h\
contrib/bobtoolz/ctfresource_gtk.h\
contrib/bobtoolz/funchandlers.h\
contrib/bobtoolz/lists.h\
contrib/bobtoolz/misc.h\
contrib/bobtoolz/resource-gtk.h\
contrib/bobtoolz/resource.h\
contrib/bobtoolz/shapes.h\
contrib/bobtoolz/visfind.h\
contrib/bobtoolz/dialogs/AboutDialog.h\
contrib/bobtoolz/dialogs/AutoCaulkDialog.h\
contrib/bobtoolz/dialogs/AutoCaulkStartDialog.h\
contrib/bobtoolz/dialogs/BrushCheckDialog.h\
contrib/bobtoolz/dialogs/DoorDialog.h\
contrib/bobtoolz/dialogs/IntersectDialog.h\
contrib/bobtoolz/dialogs/IntersectInfoDialog.h\
contrib/bobtoolz/dialogs/PolygonDialog.h\
contrib/bobtoolz/dialogs/StairDialog.h\
contrib/bobtoolz/dialogs/TextureResetDialog.h\
contrib/bobtoolz/dialogs/dialogs-gtk.h\
contrib/bobtoolz/dialogs/pathplotterdialog.h\
contrib/gtkgensurf/gendlgs.h\
contrib/gtkgensurf/gensurf.h\
contrib/gtkgensurf/triangle.h\
contrib/patches/Gtk/fileselect/linux/gtkfilesel-01222001.h\
contrib/prtview/AboutDialog.h\
contrib/prtview/ConfigDialog.h\
contrib/prtview/LoadPortalFileDialog.h\
contrib/prtview/gtkdlgs.h\
contrib/prtview/portals.h\
contrib/prtview/prtview.h\
contrib/prtview/resource.h\
contrib/prtview/stdafx.h\
docs/developer/XMLPush/StdAfx.h\
include/gtkr_list.h\
include/gtkr_vector.h\
include/ibrush.h\
include/ibspfrontend.h\
include/idata.h\
include/idatastream.h\
include/ientity.h\
include/iepairs.h\
include/ifilesystem.h\
include/igl.h\
include/iimage.h\
include/imap.h\
include/imodel.h\
include/ipatch.h\
include/ipluginentities.h\
include/irefcount.h\
include/iscriplib.h\
include/iselectedface.h\
include/ishaders.h\
include/ishadersmanager.h\
include/isurfaceplugin.h\
include/iui.h\
include/iui_gtk.h\
include/qerplugin.h\
include/qertypes.h\
include/qsysprintf.h\
include/stl_check.h\
include/stream_version.h\
libs/bytebool.h\
libs/cmdlib.h\
libs/jpeglib.h\
libs/mathlib.h\
libs/missing.h\
libs/multimon.h\
libs/pakstuff.h\
libs/str.h\
libs/synapse.h\
libs/jpeg6/jchuff.h\
libs/jpeg6/jconfig.h\
libs/jpeg6/jdct.h\
libs/jpeg6/jdhuff.h\
libs/jpeg6/jerror.h\
libs/jpeg6/jinclude.h\
libs/jpeg6/jmemsys.h\
libs/jpeg6/jmorecfg.h\
libs/jpeg6/jpegint.h\
libs/jpeg6/jversion.h\
libs/l_net/l_net.h\
libs/l_net/l_net_wins.h\
libs/pak/unzip.h\
plugins/image/bmp.h\
plugins/image/image.h\
plugins/image/lbmlib.h\
plugins/mapq3/plugin.h\
plugins/mapxml/plugin.h\
plugins/md3model/entitymodel.h\
plugins/md3model/md3.h\
plugins/md3model/md3model.h\
plugins/md3model/md3surface.h\
plugins/md3model/plugin.h\
plugins/md3model/surface.h\
plugins/sample/stdafx.h\
plugins/sample/str.h\
plugins/shaders/plugin.h\
plugins/shaders/shaders.h\
plugins/surface/plugtexdef.h\
plugins/surface/surfdlg.h\
plugins/surface/surfplug.h\
plugins/textool/2DView.h\
plugins/textool/ControlPointsManager.h\
plugins/textool/StdAfx.h\
plugins/textool/resource.h\
plugins/vfspak/vfs.h\
plugins/vfspak/vfspak.h\
plugins/vfspk3/unzip-vfspk3.h\
plugins/vfspk3/vfs.h\
plugins/vfspk3/vfspk3.h\
radiant/brush.h\
radiant/camera.h\
radiant/camwindow.h\
radiant/dialog.h\
radiant/entity.h\
radiant/epairswrapper.h\
radiant/feedback.h\
radiant/file.h\
radiant/filters.h\
radiant/findtexturedialog.h\
radiant/glwidget.h\
radiant/glwindow.h\
radiant/groupdialog.h\
radiant/gtkfilesel-darwin.h\
radiant/gtkfilesel-linux.h\
radiant/gtkfilesel.h\
radiant/gtkmisc.h\
radiant/mainframe.h\
radiant/map.h\
radiant/parse.h\
radiant/patchdialog.h\
radiant/plugin.h\
radiant/pluginmanager.h\
radiant/points.h\
radiant/preferences.h\
radiant/qe3.h\
radiant/qedefs.h\
radiant/qfiles.h\
radiant/qgl.h\
radiant/resource.h\
radiant/select.h\
radiant/stdafx.h\
radiant/surfacedialog.h\
radiant/texmanip.h\
radiant/textures.h\
radiant/texwindow.h\
radiant/ui.h\
radiant/undo.h\
radiant/watchbsp.h\
radiant/winding.h\
radiant/xmlstuff.h\
radiant/xywindow.h\
radiant/z.h\
radiant/zwindow.h\
tools/quake3/common/aselib.h\
tools/quake3/common/bspfile.h\
tools/quake3/common/cmdlib.h\
tools/quake3/common/imagelib.h\
tools/quake3/common/inout.h\
tools/quake3/common/l3dslib.h\
tools/quake3/common/mutex.h\
tools/quake3/common/polylib.h\
tools/quake3/common/polyset.h\
tools/quake3/common/qfiles.h\
tools/quake3/common/qthreads.h\
tools/quake3/common/scriplib.h\
tools/quake3/common/surfaceflags.h\
tools/quake3/common/trilib.h\
tools/quake3/common/unzip.h\
tools/quake3/common/vfs.h\
tools/quake3/q3data/3dslib.h\
tools/quake3/q3data/md3lib.h\
tools/quake3/q3data/p3dlib.h\
tools/quake3/q3data/q3data.h\
tools/quake3/q3map/Heapagnt.h\
tools/quake3/q3map/game_t.h\
tools/quake3/q3map/light.h\
tools/quake3/q3map/mesh.h\
tools/quake3/q3map/qbsp.h\
tools/quake3/q3map/shaders.h\
tools/quake3/q3map/vis.h\
libs/function.h\
include/iarchive.h\
libs/filestream.h
module.source.name=.
module.source.type=
module.source.expanded=1
module.source.files=\
contrib/bobtoolz/DBobView.cpp\
contrib/bobtoolz/DBrush.cpp\
contrib/bobtoolz/DEPair.cpp\
contrib/bobtoolz/DEntity.cpp\
contrib/bobtoolz/DListener.cpp\
contrib/bobtoolz/DMap.cpp\
contrib/bobtoolz/DPatch.cpp\
contrib/bobtoolz/DPlane.cpp\
contrib/bobtoolz/DPoint.cpp\
contrib/bobtoolz/DShape.cpp\
contrib/bobtoolz/DVisDrawer.cpp\
contrib/bobtoolz/DWinding.cpp\
contrib/bobtoolz/StdAfx.cpp\
contrib/bobtoolz/bobToolz-GTK.cpp\
contrib/bobtoolz/bobToolz.cpp\
contrib/bobtoolz/bsploader.cpp\
contrib/bobtoolz/cportals.cpp\
contrib/bobtoolz/ctfToolz-GTK.cpp\
contrib/bobtoolz/funchandlers-GTK.cpp\
contrib/bobtoolz/funchandlers-ctf-GTK.cpp\
contrib/bobtoolz/funchandlers.cpp\
contrib/bobtoolz/lists.cpp\
contrib/bobtoolz/misc.cpp\
contrib/bobtoolz/shapes.cpp\
contrib/bobtoolz/visfind.cpp\
contrib/bobtoolz/dialogs/AboutDialog.cpp\
contrib/bobtoolz/dialogs/AutoCaulkDialog.cpp\
contrib/bobtoolz/dialogs/AutoCaulkStartDialog.cpp\
contrib/bobtoolz/dialogs/DoorDialog.cpp\
contrib/bobtoolz/dialogs/IntersectDialog.cpp\
contrib/bobtoolz/dialogs/IntersectInfoDialog.cpp\
contrib/bobtoolz/dialogs/PolygonDialog.cpp\
contrib/bobtoolz/dialogs/StairDialog.cpp\
contrib/bobtoolz/dialogs/TextureResetDialog.cpp\
contrib/bobtoolz/dialogs/brushcheckdialog.cpp\
contrib/bobtoolz/dialogs/dialogs-gtk.cpp\
contrib/bobtoolz/dialogs/pathplotterdialog.cpp\
contrib/gtkgensurf/bitmap.cpp\
contrib/gtkgensurf/dec.cpp\
contrib/gtkgensurf/face.cpp\
contrib/gtkgensurf/font.cpp\
contrib/gtkgensurf/gendlgs.cpp\
contrib/gtkgensurf/genmap.cpp\
contrib/gtkgensurf/gensurf.cpp\
contrib/gtkgensurf/heretic.cpp\
contrib/gtkgensurf/plugin.cpp\
contrib/gtkgensurf/triangle.c\
contrib/gtkgensurf/view.cpp\
contrib/patches/Gtk/fileselect/linux/gtkfilesel-01222001.c\
contrib/prtview/AboutDialog.cpp\
contrib/prtview/ConfigDialog.cpp\
contrib/prtview/LoadPortalFileDialog.cpp\
contrib/prtview/gtkdlgs.cpp\
contrib/prtview/portals.cpp\
contrib/prtview/prtview.cpp\
contrib/prtview/stdafx.cpp\
docs/developer/XMLPush/StdAfx.cpp\
docs/developer/XMLPush/XMLPush.cpp\
docs/manual/quake3/Compile_Manual/cfgq3.c\
libs/cmdlib/cmdlib.cpp\
libs/jpeg6/jcomapi.cpp\
libs/jpeg6/jdapimin.cpp\
libs/jpeg6/jdapistd.cpp\
libs/jpeg6/jdatasrc.cpp\
libs/jpeg6/jdcoefct.cpp\
libs/jpeg6/jdcolor.cpp\
libs/jpeg6/jddctmgr.cpp\
libs/jpeg6/jdhuff.cpp\
libs/jpeg6/jdinput.cpp\
libs/jpeg6/jdmainct.cpp\
libs/jpeg6/jdmarker.cpp\
libs/jpeg6/jdmaster.cpp\
libs/jpeg6/jdpostct.cpp\
libs/jpeg6/jdsample.cpp\
libs/jpeg6/jdtrans.cpp\
libs/jpeg6/jerror.cpp\
libs/jpeg6/jfdctflt.cpp\
libs/jpeg6/jidctflt.cpp\
libs/jpeg6/jmemmgr.cpp\
libs/jpeg6/jmemnobs.cpp\
libs/jpeg6/jpgload.cpp\
libs/jpeg6/jutils.cpp\
libs/l_net/l_net.c\
libs/l_net/l_net_berkley.c\
libs/l_net/l_net_wins.c\
libs/mathlib/bbox.c\
libs/mathlib/linear.c\
libs/mathlib/m4x4.c\
libs/mathlib/mathlib.c\
libs/mathlib/ray.c\
libs/pak/pakstuff.cpp\
libs/pak/unzip.cpp\
libs/synapse/synapse.cpp\
plugins/image/bmp.cpp\
plugins/image/image.cpp\
plugins/image/jpeg.cpp\
plugins/image/lbmlib.cpp\
plugins/mapq3/parse.cpp\
plugins/mapq3/plugin.cpp\
plugins/mapq3/write.cpp\
plugins/mapxml/plugin.cpp\
plugins/mapxml/xmlparse.cpp\
plugins/mapxml/xmlwrite.cpp\
plugins/md3model/eclassmodel.cpp\
plugins/md3model/entitymodel.cpp\
plugins/md3model/md3model.cpp\
plugins/md3model/md3surface.cpp\
plugins/md3model/miscmodel.cpp\
plugins/md3model/plugin.cpp\
plugins/sample/sample.cpp\
plugins/sample/stdafx.cpp\
plugins/shaders/plugin.cpp\
plugins/shaders/shaders.cpp\
plugins/surface/plugtexdef.cpp\
plugins/surface/surfdlg.cpp\
plugins/surface/surfplug.cpp\
plugins/textool/2DView.cpp\
plugins/textool/ControlPointsManager.cpp\
plugins/textool/StdAfx.cpp\
plugins/textool/TexTool.cpp\
plugins/vfspak/vfs.cpp\
plugins/vfspak/vfspak.cpp\
plugins/vfspk3/unzip.cpp\
plugins/vfspk3/vfs.cpp\
plugins/vfspk3/vfspk3.cpp\
radiant/bp_dlg.cpp\
radiant/brush.cpp\
radiant/brush_primit.cpp\
radiant/brushscript.cpp\
radiant/camwindow.cpp\
radiant/csg.cpp\
radiant/dialog.cpp\
radiant/dialoginfo.cpp\
radiant/drag.cpp\
radiant/eclass.cpp\
radiant/entity.cpp\
radiant/feedback.cpp\
radiant/file.cpp\
radiant/filters.cpp\
radiant/findtexturedialog.cpp\
radiant/glinterface.cpp\
radiant/glwidget.cpp\
radiant/glwindow.cpp\
radiant/groupdialog.cpp\
radiant/gtkdlgs.cpp\
radiant/gtkfilesel-darwin.c\
radiant/gtkfilesel-linux.c\
radiant/gtkfilesel.c\
radiant/gtkmisc.cpp\
radiant/iepairs.cpp\
radiant/main.cpp\
radiant/mainframe.cpp\
radiant/map.cpp\
radiant/missing.cpp\
radiant/parse.cpp\
radiant/patchdialog.cpp\
radiant/plugin.cpp\
radiant/pluginentities.cpp\
radiant/pluginmanager.cpp\
radiant/pmesh.cpp\
radiant/points.cpp\
radiant/preferences.cpp\
radiant/profile.cpp\
radiant/qe3.cpp\
radiant/qgl-mac.c\
radiant/qgl.c\
radiant/queuedraw.cpp\
radiant/select.cpp\
radiant/selectedface.cpp\
radiant/stdafx.cpp\
radiant/surfacedialog.cpp\
radiant/surfaceplugin.cpp\
radiant/texmanip.cpp\
radiant/texwindow.cpp\
radiant/ui.cpp\
radiant/undo.cpp\
radiant/vertsel.cpp\
radiant/watchbsp.cpp\
radiant/winding.cpp\
radiant/xywindow.cpp\
radiant/z.cpp\
radiant/zwindow.cpp\
tools/quake3/common/aselib.c\
tools/quake3/common/bspfile.c\
tools/quake3/common/cmdlib.c\
tools/quake3/common/imagelib.c\
tools/quake3/common/inout.c\
tools/quake3/common/l3dslib.c\
tools/quake3/common/md4.c\
tools/quake3/common/mutex.c\
tools/quake3/common/polylib.c\
tools/quake3/common/scriplib.c\
tools/quake3/common/threads.c\
tools/quake3/common/trilib.c\
tools/quake3/common/unzip.c\
tools/quake3/common/vfs.c\
tools/quake3/q3data/3dslib.c\
tools/quake3/q3data/compress.c\
tools/quake3/q3data/images.c\
tools/quake3/q3data/md3lib.c\
tools/quake3/q3data/models.c\
tools/quake3/q3data/oldstuff.c\
tools/quake3/q3data/p3dlib.c\
tools/quake3/q3data/polyset.c\
tools/quake3/q3data/q3data.c\
tools/quake3/q3data/stripper.c\
tools/quake3/q3data/video.c\
tools/quake3/q3map/NetConnect/main.c\
tools/quake3/q3map/brush.c\
tools/quake3/q3map/brush_primit.c\
tools/quake3/q3map/bsp.c\
tools/quake3/q3map/facebsp.c\
tools/quake3/q3map/fog.c\
tools/quake3/q3map/gldraw.c\
tools/quake3/q3map/glfile.c\
tools/quake3/q3map/leakfile.c\
tools/quake3/q3map/light.c\
tools/quake3/q3map/light_bounce.c\
tools/quake3/q3map/light_trace.c\
tools/quake3/q3map/lightmaps.c\
tools/quake3/q3map/lightv.c\
tools/quake3/q3map/map.c\
tools/quake3/q3map/mesh.c\
tools/quake3/q3map/misc_model.c\
tools/quake3/q3map/nodraw.c\
tools/quake3/q3map/patch.c\
tools/quake3/q3map/path_init.c\
tools/quake3/q3map/portals.c\
tools/quake3/q3map/prtfile.c\
tools/quake3/q3map/shaders.c\
tools/quake3/q3map/surface.c\
tools/quake3/q3map/terrain.c\
tools/quake3/q3map/tjunction.c\
tools/quake3/q3map/tree.c\
tools/quake3/q3map/vis.c\
tools/quake3/q3map/visflow.c\
tools/quake3/q3map/writebsp.c\
tools/quake3/q3map/NetTest/main.c\
plugins/archivepak/archive.cpp\
plugins/archivepak/plugin.cpp
module.pixmap.name=.
module.pixmap.type=
module.pixmap.expanded=0
module.pixmap.files=\
Doxygen_files/example/doxygen.gif\
Doxygen_files/example/graph_legend.gif\
Doxygen_files/images/body-left-tile.gif\
Doxygen_files/images/body-lower-left.gif\
Doxygen_files/images/body-lower-right.gif\
Doxygen_files/images/body-lower-tile.gif\
Doxygen_files/images/body-right-tile.gif\
Doxygen_files/images/body-upper-left.gif\
Doxygen_files/images/body-upper-right.gif\
Doxygen_files/images/body-upper-tile.gif\
Doxygen_files/images/gtkr_splash.jpg\
Doxygen_files/images/gtkr_splash_sm.jpg\
Doxygen_files/images/history_id_logo.gif\
Doxygen_files/images/top-right.gif\
Doxygen_files/images/top-tile.gif\
Doxygen_files/images/top-title.gif\
contrib/patches/Gtk/fileselect/back.xpm\
contrib/patches/Gtk/fileselect/forward.xpm\
contrib/patches/Gtk/fileselect/refresh.xpm\
contrib/patches/Gtk/fileselect/up.xpm\
docs/developer/Inspector/classdiagram1.gif\
docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image002.png\
docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image003.png\
docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image004.png\
docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image006.png\
docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image008.png\
docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image010.png\
docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image012.png\
docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image014.png\
docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image016.png\
docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image018.png\
docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image020.png\
docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image022.png\
docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image024.png\
docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image026.png\
docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image028.png\
docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image030.png\
docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image032.png\
docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image034.png\
docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image035.png\
docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image038.png\
docs/manual/Q3Rad_Manual/Q3Rad_Manual_files/image040.png\
docs/manual/quake3/Q3AShader_Manual/q3ashader_manual_files/image002.jpg\
docs/manual/quake3/Team_Arena_Mapping_Help/pics/CRUSADER.gif\
docs/manual/quake3/Team_Arena_Mapping_Help/pics/INTRUDER.gif\
docs/manual/quake3/Team_Arena_Mapping_Help/pics/MAINPOP.gif\
docs/manual/quake3/Team_Arena_Mapping_Help/pics/MENUBACKgif.gif\
docs/manual/quake3/Team_Arena_Mapping_Help/pics/PAGANs.gif\
docs/manual/quake3/Team_Arena_Mapping_Help/pics/STROGGS.gif\
docs/manual/quake3/Team_Arena_Mapping_Help/pics/THEFALLEN.gif\
docs/manual/quake3/Team_Arena_Mapping_Help/pics/logo.gif\
docs/manual/quake3/Terrain_Manual/pages/Image3.gif\
docs/manual/quake3/Terrain_Manual/pages/Image4.gif\
docs/manual/quake3/Terrain_Manual/pages/Image5.gif\
docs/manual/quake3/Terrain_Manual/pages/Image6.gif\
docs/manual/quake3/Terrain_Manual/pics/background.jpg\
docs/manual/quake3/Terrain_Manual/pics/start.gif\
docs/manual/quake3/Terrain_Manual/pics/terrain.jpg\
plugins/textool/Doc/Image2.jpg\
setup/linux/Help/DocsArt/toolback.jpg\
setup/linux/radiant.xpm\
setup/linux/setup.data/splash.xpm
module.data.name=.
module.data.type=
module.data.expanded=0
module.data.files=
module.help.name=.
module.help.type=
module.help.expanded=0
module.help.files=
module.doc.name=.
module.doc.type=
module.doc.expanded=0
module.doc.files=\
INSTALL\
README\
Doxygen_files/example/annotated.html\
Doxygen_files/example/classIEpair-members.html\
Doxygen_files/example/classIEpair.html\
Doxygen_files/example/classes.html\
Doxygen_files/example/files.html\
Doxygen_files/example/functions.html\
Doxygen_files/example/graph_legend.html\
Doxygen_files/example/index.html\
Doxygen_files/example/pages.html\
Doxygen_files/example/test_8c-source.html\
Doxygen_files/example/test_8c.html\
Doxygen_files/example/todo.html\
Doxygen_files/doxygen_gtkradiant_foot.html\
Doxygen_files/doxygen_gtkradiant_head.html\
Doxygen_files/doxygen_index.html\
Doxygen_files/doxygen_reference_foot.html\
Doxygen_files/doxygen_reference_head.html\
Doxygen_files/reference1.html\
contrib/patches/Gtk/fileselect/README\
docs/developer/TODO\
docs/manual/quake3/Compile_Manual/index.html\
docs/manual/quake3/Compile_Manual/q3map.html\
docs/manual/quake3/New_Teams_For_Q3TA/index.html\
docs/manual/quake3/Q3AShader_Manual/appendix/appA.html\
docs/manual/quake3/Team_Arena_Mapping_Help/pages/design_tips.html\
docs/manual/quake3/Team_Arena_Mapping_Help/pages/map_converters_checklist.html\
docs/manual/quake3/Team_Arena_Mapping_Help/pages/preface.html\
docs/manual/quake3/Team_Arena_Mapping_Help/pages/related_links.html\
docs/manual/quake3/Team_Arena_Mapping_Help/pages/ta_game_types.html\
docs/manual/quake3/Team_Arena_Mapping_Help/pages/team_arena_entity_definitions.html\
docs/manual/quake3/Team_Arena_Mapping_Help/pages/team_arena_prefabs.html\
docs/manual/quake3/Team_Arena_Mapping_Help/pages/team_powerup_bases.html\
docs/manual/quake3/Team_Arena_Mapping_Help/pages/using_new_game_entities.html\
docs/manual/quake3/Team_Arena_Mapping_Help/start.html\
docs/manual/quake3/Terrain_Manual/pages/adding_bots.html\
docs/manual/quake3/Terrain_Manual/pages/adding_buildings_to_terrain.html\
docs/manual/quake3/Terrain_Manual/pages/art_tools.html\
docs/manual/quake3/Terrain_Manual/pages/blocking_vis.html\
docs/manual/quake3/Terrain_Manual/pages/boxing_in_the_world.html\
docs/manual/quake3/Terrain_Manual/pages/clipping_the_terrain.html\
docs/manual/quake3/Terrain_Manual/pages/creating_the_alphamap.html\
docs/manual/quake3/Terrain_Manual/pages/creating_the_terrain.html\
docs/manual/quake3/Terrain_Manual/pages/entity_keys_and_values.html\
docs/manual/quake3/Terrain_Manual/pages/glossary.html\
docs/manual/quake3/Terrain_Manual/pages/height_map_into_terrain_mesh.html\
docs/manual/quake3/Terrain_Manual/pages/height_maps.html\
docs/manual/quake3/Terrain_Manual/pages/introduction.html\
docs/manual/quake3/Terrain_Manual/pages/key_changes.html\
docs/manual/quake3/Terrain_Manual/pages/lighting_the_terrain.html\
docs/manual/quake3/Terrain_Manual/pages/manipulating_the_terrain_mesh.html\
docs/manual/quake3/Terrain_Manual/pages/mapping_the_textures.html\
docs/manual/quake3/Terrain_Manual/pages/new_or_revised_q3map_shader_comm.html\
docs/manual/quake3/Terrain_Manual/pages/other_possible_height_map_tools.html\
docs/manual/quake3/Terrain_Manual/pages/related_links.html\
docs/manual/quake3/Terrain_Manual/pages/suggested_gensurf_settings.html\
docs/manual/quake3/Terrain_Manual/pages/table_of_contents.html\
docs/manual/quake3/Terrain_Manual/pages/terrain_entity.html\
docs/manual/quake3/Terrain_Manual/pages/terrain_mesh_into_terrain_entity.html\
docs/manual/quake3/Terrain_Manual/pages/terrain_related_worldspawn_features.html\
docs/manual/quake3/Terrain_Manual/pages/terrain_texture.html\
docs/manual/quake3/Terrain_Manual/pages/the_meta_shader.html\
docs/manual/quake3/Terrain_Manual/start.html\
plugins/textool/Doc/TexTool.html\
setup/PluginSDK/README.html\
setup/PluginSDK/TODO\
setup/data/tools/credits.html\
setup/linux/Help/Index.html\
setup/win32/TODO\
www/coding.html\
www/files.html\
www/gtkradiant.html\
www/hosted.html\
www/index.html\
www/reviews.html
module.po.expanded=0
module.po.files=
compiler.options.supports=
compiler.options.include.paths=\
.\
..
compiler.options.library.paths=
compiler.options.libraries=
compiler.options.libraries.selected=
compiler.options.defines=\
HAVE_CONFIG_H
compiler.options.warning.buttons=0 0 1 1 0 1 0 0 0 0 0 0 0 1 0 0
compiler.options.optimize.buttons=0 0 1 0
compiler.options.other.buttons=1 0
compiler.options.other.c.flags=
compiler.options.other.l.flags=
compiler.options.other.l.libs=
project.source.paths=

271
GtkRadiant.sln Normal file
View file

@ -0,0 +1,271 @@
Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "entityq3", "plugins\entity\entityq3.vcproj", "{49C5823A-5E50-4029-ACEE-1627EBB79E47}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GtkRadiant", "radiant\GtkRadiant.vcproj", "{8E70385C-223A-4DD1-9B99-28FF2331A2B5}"
ProjectSection(ProjectDependencies) = postProject
{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}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "l_net", "libs\l_net\l_net.vcproj", "{8845D5C1-4154-425F-8643-447FADC03449}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmdlib", "libs\cmdlib\cmdlib.vcproj", "{8845C5C1-4154-425F-8643-447FADC03449}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
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}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
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}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mapq3", "plugins\mapq3\mapq3.vcproj", "{D6130A5F-12DC-487B-BB9E-4BFDA60FBADF}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mapxml", "plugins\mapxml\mapxml.vcproj", "{B43DBA9D-6EE0-421C-83D9-9776064B66B4}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shadersq3", "plugins\shaders\shadersq3.vcproj", "{F79DCF6D-72B1-45F6-A471-5209951C0BDD}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "picomodel", "libs\picomodel\picomodel.vcproj", "{015EA9D3-85F2-4C4E-BFC3-430AC59093B9}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jpeg6", "libs\jpeg6\jpeg6.vcproj", "{0501A08E-D4D7-42C1-9E2A-BA3F2F320741}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "imagehl", "plugins\imagehl\imagehl.vcproj", "{15DEA3EA-9386-49C7-80C6-5B090DE1D536}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "imagepng", "plugins\imagepng\imagepng.vcproj", "{15DEA4EA-9386-49C7-80C6-5B090DE1D536}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
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}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mathlib", "libs\mathlib\mathlib.vcproj", "{BF0FF048-887F-4D43-A455-F8C04FB98F10}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libs", "libs\libs.vcproj", "{1C785349-866D-447D-8C55-8A51E5CA0E87}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "include", "include\include.vcproj", "{04A5D9EE-EC49-4CBC-BD05-D80BC287897C}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "profile", "libs\profile\profile.vcproj", "{853632F4-6420-40C5-B80B-38B678E472B8}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "imageq2", "plugins\imageq2\imageq2.vcproj", "{697E77F2-9E9E-4F12-973F-C1214494248C}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample", "plugins\sample\sample.vcproj", "{46B36F0C-5E17-458E-AE6F-AECE52F66EDE}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
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}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
Release = Release
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{49C5823A-5E50-4029-ACEE-1627EBB79E47}.Debug.ActiveCfg = Debug|Win32
{49C5823A-5E50-4029-ACEE-1627EBB79E47}.Debug.Build.0 = Debug|Win32
{49C5823A-5E50-4029-ACEE-1627EBB79E47}.Release.ActiveCfg = Release|Win32
{49C5823A-5E50-4029-ACEE-1627EBB79E47}.Release.Build.0 = Release|Win32
{8E70385C-223A-4DD1-9B99-28FF2331A2B5}.Debug.ActiveCfg = Debug|Win32
{8E70385C-223A-4DD1-9B99-28FF2331A2B5}.Debug.Build.0 = Debug|Win32
{8E70385C-223A-4DD1-9B99-28FF2331A2B5}.Release.ActiveCfg = Release|Win32
{8E70385C-223A-4DD1-9B99-28FF2331A2B5}.Release.Build.0 = Release|Win32
{BED4E2E5-0368-4042-9898-4914B0372468}.Debug.ActiveCfg = Debug|Win32
{BED4E2E5-0368-4042-9898-4914B0372468}.Debug.Build.0 = Debug|Win32
{BED4E2E5-0368-4042-9898-4914B0372468}.Release.ActiveCfg = Release|Win32
{BED4E2E5-0368-4042-9898-4914B0372468}.Release.Build.0 = Release|Win32
{8845D5C1-4154-425F-8643-447FADC03449}.Debug.ActiveCfg = Debug|Win32
{8845D5C1-4154-425F-8643-447FADC03449}.Debug.Build.0 = Debug|Win32
{8845D5C1-4154-425F-8643-447FADC03449}.Release.ActiveCfg = Release|Win32
{8845D5C1-4154-425F-8643-447FADC03449}.Release.Build.0 = Release|Win32
{8845C5C1-4154-425F-8643-447FADC03449}.Debug.ActiveCfg = Debug|Win32
{8845C5C1-4154-425F-8643-447FADC03449}.Debug.Build.0 = Debug|Win32
{8845C5C1-4154-425F-8643-447FADC03449}.Release.ActiveCfg = Release|Win32
{8845C5C1-4154-425F-8643-447FADC03449}.Release.Build.0 = Release|Win32
{75160E63-E642-4C71-9D4C-B733E152C418}.Debug.ActiveCfg = Debug|Win32
{75160E63-E642-4C71-9D4C-B733E152C418}.Debug.Build.0 = Debug|Win32
{75160E63-E642-4C71-9D4C-B733E152C418}.Release.ActiveCfg = Release|Win32
{75160E63-E642-4C71-9D4C-B733E152C418}.Release.Build.0 = Release|Win32
{9DC47AF9-ACFC-40A5-A4A6-FF3E7F8EFFBE}.Debug.ActiveCfg = Debug|Win32
{9DC47AF9-ACFC-40A5-A4A6-FF3E7F8EFFBE}.Debug.Build.0 = Debug|Win32
{9DC47AF9-ACFC-40A5-A4A6-FF3E7F8EFFBE}.Release.ActiveCfg = Release|Win32
{9DC47AF9-ACFC-40A5-A4A6-FF3E7F8EFFBE}.Release.Build.0 = Release|Win32
{A7E0FE03-E9BB-4478-9752-250BBD406C2D}.Debug.ActiveCfg = Debug|Win32
{A7E0FE03-E9BB-4478-9752-250BBD406C2D}.Debug.Build.0 = Debug|Win32
{A7E0FE03-E9BB-4478-9752-250BBD406C2D}.Release.ActiveCfg = Release|Win32
{A7E0FE03-E9BB-4478-9752-250BBD406C2D}.Release.Build.0 = Release|Win32
{0A0D3519-2ADD-4B47-A890-746170B2CCD8}.Debug.ActiveCfg = Debug|Win32
{0A0D3519-2ADD-4B47-A890-746170B2CCD8}.Debug.Build.0 = Debug|Win32
{0A0D3519-2ADD-4B47-A890-746170B2CCD8}.Release.ActiveCfg = Release|Win32
{0A0D3519-2ADD-4B47-A890-746170B2CCD8}.Release.Build.0 = Release|Win32
{C2A5530D-C2DB-4503-A651-4B92AEC5FE74}.Debug.ActiveCfg = Debug|Win32
{C2A5530D-C2DB-4503-A651-4B92AEC5FE74}.Debug.Build.0 = Debug|Win32
{C2A5530D-C2DB-4503-A651-4B92AEC5FE74}.Release.ActiveCfg = Release|Win32
{C2A5530D-C2DB-4503-A651-4B92AEC5FE74}.Release.Build.0 = Release|Win32
{386DBF35-2F76-4BB1-8B4B-1D69C34F8996}.Debug.ActiveCfg = Debug|Win32
{386DBF35-2F76-4BB1-8B4B-1D69C34F8996}.Debug.Build.0 = Debug|Win32
{386DBF35-2F76-4BB1-8B4B-1D69C34F8996}.Release.ActiveCfg = Release|Win32
{386DBF35-2F76-4BB1-8B4B-1D69C34F8996}.Release.Build.0 = Release|Win32
{0BB50F1C-E139-48A2-B9D8-1E781275777F}.Debug.ActiveCfg = Debug|Win32
{0BB50F1C-E139-48A2-B9D8-1E781275777F}.Debug.Build.0 = Debug|Win32
{0BB50F1C-E139-48A2-B9D8-1E781275777F}.Release.ActiveCfg = Release|Win32
{0BB50F1C-E139-48A2-B9D8-1E781275777F}.Release.Build.0 = Release|Win32
{D6130A5F-12DC-487B-BB9E-4BFDA60FBADF}.Debug.ActiveCfg = Debug|Win32
{D6130A5F-12DC-487B-BB9E-4BFDA60FBADF}.Debug.Build.0 = Debug|Win32
{D6130A5F-12DC-487B-BB9E-4BFDA60FBADF}.Release.ActiveCfg = Release|Win32
{D6130A5F-12DC-487B-BB9E-4BFDA60FBADF}.Release.Build.0 = Release|Win32
{B43DBA9D-6EE0-421C-83D9-9776064B66B4}.Debug.ActiveCfg = Debug|Win32
{B43DBA9D-6EE0-421C-83D9-9776064B66B4}.Debug.Build.0 = Debug|Win32
{B43DBA9D-6EE0-421C-83D9-9776064B66B4}.Release.ActiveCfg = Release|Win32
{B43DBA9D-6EE0-421C-83D9-9776064B66B4}.Release.Build.0 = Release|Win32
{F79DCF6D-72B1-45F6-A471-5209951C0BDD}.Debug.ActiveCfg = Debug|Win32
{F79DCF6D-72B1-45F6-A471-5209951C0BDD}.Debug.Build.0 = Debug|Win32
{F79DCF6D-72B1-45F6-A471-5209951C0BDD}.Release.ActiveCfg = Release|Win32
{F79DCF6D-72B1-45F6-A471-5209951C0BDD}.Release.Build.0 = Release|Win32
{015EA9D3-85F2-4C4E-BFC3-430AC59093B9}.Debug.ActiveCfg = Debug|Win32
{015EA9D3-85F2-4C4E-BFC3-430AC59093B9}.Debug.Build.0 = Debug|Win32
{015EA9D3-85F2-4C4E-BFC3-430AC59093B9}.Release.ActiveCfg = Release|Win32
{015EA9D3-85F2-4C4E-BFC3-430AC59093B9}.Release.Build.0 = Release|Win32
{0501A08E-D4D7-42C1-9E2A-BA3F2F320741}.Debug.ActiveCfg = Debug|Win32
{0501A08E-D4D7-42C1-9E2A-BA3F2F320741}.Debug.Build.0 = Debug|Win32
{0501A08E-D4D7-42C1-9E2A-BA3F2F320741}.Release.ActiveCfg = Release|Win32
{0501A08E-D4D7-42C1-9E2A-BA3F2F320741}.Release.Build.0 = Release|Win32
{15DEA3EA-9386-49C7-80C6-5B090DE1D536}.Debug.ActiveCfg = Debug|Win32
{15DEA3EA-9386-49C7-80C6-5B090DE1D536}.Debug.Build.0 = Debug|Win32
{15DEA3EA-9386-49C7-80C6-5B090DE1D536}.Release.ActiveCfg = Release|Win32
{15DEA3EA-9386-49C7-80C6-5B090DE1D536}.Release.Build.0 = Release|Win32
{15DEA4EA-9386-49C7-80C6-5B090DE1D536}.Debug.ActiveCfg = Debug|Win32
{15DEA4EA-9386-49C7-80C6-5B090DE1D536}.Debug.Build.0 = Debug|Win32
{15DEA4EA-9386-49C7-80C6-5B090DE1D536}.Release.ActiveCfg = Release|Win32
{15DEA4EA-9386-49C7-80C6-5B090DE1D536}.Release.Build.0 = Release|Win32
{8ED67991-58A6-44AA-9B3A-3217085EF187}.Debug.ActiveCfg = Debug|Win32
{8ED67991-58A6-44AA-9B3A-3217085EF187}.Debug.Build.0 = Debug|Win32
{8ED67991-58A6-44AA-9B3A-3217085EF187}.Release.ActiveCfg = Release|Win32
{8ED67991-58A6-44AA-9B3A-3217085EF187}.Release.Build.0 = Release|Win32
{8576EC58-4E54-49C0-879A-F054C92B1D03}.Debug.ActiveCfg = Debug|Win32
{8576EC58-4E54-49C0-879A-F054C92B1D03}.Debug.Build.0 = Debug|Win32
{8576EC58-4E54-49C0-879A-F054C92B1D03}.Release.ActiveCfg = Release|Win32
{8576EC58-4E54-49C0-879A-F054C92B1D03}.Release.Build.0 = Release|Win32
{BF0FF048-887F-4D43-A455-F8C04FB98F10}.Debug.ActiveCfg = Debug|Win32
{BF0FF048-887F-4D43-A455-F8C04FB98F10}.Debug.Build.0 = Debug|Win32
{BF0FF048-887F-4D43-A455-F8C04FB98F10}.Release.ActiveCfg = Release|Win32
{BF0FF048-887F-4D43-A455-F8C04FB98F10}.Release.Build.0 = Release|Win32
{1C785349-866D-447D-8C55-8A51E5CA0E87}.Debug.ActiveCfg = Debug|Win32
{1C785349-866D-447D-8C55-8A51E5CA0E87}.Debug.Build.0 = Debug|Win32
{1C785349-866D-447D-8C55-8A51E5CA0E87}.Release.ActiveCfg = Release|Win32
{1C785349-866D-447D-8C55-8A51E5CA0E87}.Release.Build.0 = Release|Win32
{04A5D9EE-EC49-4CBC-BD05-D80BC287897C}.Debug.ActiveCfg = Debug|Win32
{04A5D9EE-EC49-4CBC-BD05-D80BC287897C}.Debug.Build.0 = Debug|Win32
{04A5D9EE-EC49-4CBC-BD05-D80BC287897C}.Release.ActiveCfg = Release|Win32
{04A5D9EE-EC49-4CBC-BD05-D80BC287897C}.Release.Build.0 = Release|Win32
{853632F4-6420-40C5-B80B-38B678E472B8}.Debug.ActiveCfg = Debug|Win32
{853632F4-6420-40C5-B80B-38B678E472B8}.Debug.Build.0 = Debug|Win32
{853632F4-6420-40C5-B80B-38B678E472B8}.Release.ActiveCfg = Release|Win32
{853632F4-6420-40C5-B80B-38B678E472B8}.Release.Build.0 = Release|Win32
{697E77F2-9E9E-4F12-973F-C1214494248C}.Debug.ActiveCfg = Debug|Win32
{697E77F2-9E9E-4F12-973F-C1214494248C}.Debug.Build.0 = Debug|Win32
{697E77F2-9E9E-4F12-973F-C1214494248C}.Release.ActiveCfg = Release|Win32
{697E77F2-9E9E-4F12-973F-C1214494248C}.Release.Build.0 = Release|Win32
{46B36F0C-5E17-458E-AE6F-AECE52F66EDE}.Debug.ActiveCfg = Debug|Win32
{46B36F0C-5E17-458E-AE6F-AECE52F66EDE}.Debug.Build.0 = Debug|Win32
{46B36F0C-5E17-458E-AE6F-AECE52F66EDE}.Release.ActiveCfg = Release|Win32
{46B36F0C-5E17-458E-AE6F-AECE52F66EDE}.Release.Build.0 = Release|Win32
{FB80DE6C-51C8-4D56-876D-C7878A4EB10B}.Debug.ActiveCfg = Debug|Win32
{FB80DE6C-51C8-4D56-876D-C7878A4EB10B}.Debug.Build.0 = Debug|Win32
{FB80DE6C-51C8-4D56-876D-C7878A4EB10B}.Release.ActiveCfg = Release|Win32
{FB80DE6C-51C8-4D56-876D-C7878A4EB10B}.Release.Build.0 = Release|Win32
{68E2C6B6-96CA-4BBD-A485-FEE6F2E65407}.Debug.ActiveCfg = Debug|Win32
{68E2C6B6-96CA-4BBD-A485-FEE6F2E65407}.Debug.Build.0 = Debug|Win32
{68E2C6B6-96CA-4BBD-A485-FEE6F2E65407}.Release.ActiveCfg = Release|Win32
{68E2C6B6-96CA-4BBD-A485-FEE6F2E65407}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal

458
LGPL Normal file
View file

@ -0,0 +1,458 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS

36
LICENSE Normal file
View file

@ -0,0 +1,36 @@
LICENSE ( last update: Wed Feb 8 17:16:40 CST 2006 )
-----------------------------------------------------
There are 3 license types used throughout GtkRadiant source code.
BSD - modified Berkeley Software Distribution license
( each BSD licensed source file starts with the appropriate header )
LGPL - GNU Lesser General Public License v2.1
( see LGPL at the root of the tree )
GPL - GNU General Public License
( see GPL at the root of the tree )
How do I check which license applies to a given part of the source code?
Each source file in the tree comes with a license header which explains what
license applies. To sum up shortly:
GPL: ( except some files contributed by Loki Software under BSD license )
GtkRadiant Core
GtkRadiant Modules
GtkRadiant Libraries
Quake III Tools
Quake II Tools
Background2D Plugin
HydraToolz Plugin
BSD:
JPEG Library
MD5 Library
DDS Library
PicoModel Library
PrtView Plugin
LGPL
BobToolz Plugin
GenSurf Plugin

51
README.doxygen Normal file
View file

@ -0,0 +1,51 @@
Documentation for generating doxygen documentation
---------------------------------------------------------
1. Options for gendox
More up-to-date command line options are available via
the command ./gendox --help
usage: "sh gendox [ <target(s)> ] [ -o <output_dir> ]"
or "./gendox [ <target(s)> ] [ -o <output_dir> ]"
<target(s)>
The directory, or directories to generate the
documentation from.
-o
Specifies the output directory <output_dir> which
should follow the -o switch
-q --quiet
Stops the script from outputing status information,
other than errors.
-k --kill
Kills other running doxygen pids.
eg: ./gendox include/ -o ../Documentation
* This will produce documentation for the include files,
and output to the directory specified one level above the
current directory.
The target can be the current directory "./" in which case
doxygen will generate documentation for all subdirectories
of the current directory recursively.
The default output directory is currently ...
> ../GtkRadiant-doxygen
* If the script is called without any target directories
it will generate documentation for the core of radiant...
include/ libs/ radiant/ and plugins/
If there are specific options that you'd like to customise,
the DoxyConfig file is used to generate the file from which
doxygen gets its settings from. So any changes that need
to be made should be made to this file.
Gef :]
(gefdavis@dingoblue.net.au)
---------------------------------------------------------

922
SConscript Normal file
View file

@ -0,0 +1,922 @@
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')
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_env.useGtk2()
#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 DListener.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_lst.append('libs/libmathlib.a')
#bob_lst.append('libs/libcmdlib.a')
#bob_env['CPPPATH'].append('contrib/bobtoolz/dialogs')
#bob_env.SharedLibrarySafe(target='bobtoolz', source=bob_lst)
#bob_env.Install(INSTALL + '/plugins', 'bobtoolz.so')
#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_lst = build_list('contrib/prtview',
#'AboutDialog.cpp ConfigDialog.cpp LoadPortalFileDialog.cpp portals.cpp prtview.cpp')
#prtview_env = bob_env.Copy()
#prtview_env['CXXFLAGS'] += '-DGTK_PLUGIN '
#prtview_env.SharedLibrarySafe(target='prtview', source=prtview_lst)
#prtview_env.Install(INSTALL + '/plugins', 'prtview.so')
#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',
'select.cpp',
'selection.cpp',
'server.cpp',
'shaders.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']
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.Install(INSTALL, radiant_prog)
# setup -------------------------------------------------------------------------------------------
class setup_builder:
g_dryrun = 0
def system(self, cmd):
if (self.g_dryrun):
print cmd
else:
sys.stdout.write(cmd)
ret = commands.getstatusoutput(cmd)
print ret[1]
if (ret[0] != 0):
raise 'command failed'
def copy_core(self):
# binaries and misc
self.system('mkdir -p %s/modules' % self.SETUP_BIN_DIR)
self.system('mkdir -p %s/plugins' % self.SETUP_BIN_DIR)
self.system('cp install/%s %s' % (self.EDITOR_BIN, self.SETUP_BIN_DIR))
self.system('cp install/modules/*.so %s/modules' % self.SETUP_BIN_DIR )
# self.system('cp install/plugins/*.so %s/plugins' % self.SETUP_BIN_DIR )
self.system('cp install/q3map2.%s %s' % ( g_cpu, self.SETUP_BIN_DIR ) )
self.M4_STDC = ''
if (not self.g_darwin):
# fugly
# copy libgcc_s and stdc++ over to distribute it and reduce potential ABI fuckups
ret = commands.getstatusoutput('ldd -r install/' + self.EDITOR_BIN + ' 2>/dev/null | grep libgcc_s | sed -e \'s/.* => \\([^ ]*\\) .*/\\1/\'')
if (ret[0] != 0):
raise 'ldd command failed'
self.system('cp ' + ret[1] + ' ' + self.SETUP_BIN_DIR)
ret = commands.getstatusoutput('ldd -r install/' + self.EDITOR_BIN + ' 2>/dev/null | grep libstdc++ | sed -e \'s/.* => \\([^ ]*\\) .*/\\1/\'')
if (ret[0] != 0):
raise 'ldd command failed'
lines = string.split(ret[1], '\n')
self.M4_STDC = '"'
for i in lines:
self.system('cp ' + i + ' ' + self.SETUP_BIN_DIR)
self.M4_STDC += os.path.basename(i) + ' \n'
self.M4_STDC += '"'
# hack for symlink
# setup process generates the wrapper at install time
# but we need a dummy executable for symlink in loki_setup
self.system('echo -n "#!/bin/sh\necho If you read this then there was a bug during setup. Report the bug and try running %s directly from it\'s installation directory.\n" > %s/radiant' % (self.EDITOR_BIN, self.SETUP_BIN_DIR));
self.system('echo -n "#!/bin/sh\necho If you read this then there was a bug during setup. Report the bug and try running %s directly from it\'s installation directory.\n" > %s/q3map2' % (self.EDITOR_BIN, self.SETUP_BIN_DIR));
## this goes to the core install directory
DEST = self.SETUP_DIR + '/core'
self.system('mkdir -p ' + DEST + '/modules/bitmaps')
# general content stuff
self.system('cp -R plugins/model/bitmaps/* ' + DEST + '/modules/bitmaps')
self.system('cp setup/data/tools/credits.html ' + DEST)
self.system('cp setup/data/tools/links.htm ' + DEST)
self.system('cp setup/data/tools/q3data.qdt ' + DEST)
self.system('cp setup/data/tools/global.xlink ' + DEST)
self.system('cp -R radiant/bitmaps ' + DEST)
self.system('cp setup/changelog.txt ' + DEST)
self.system('cp setup/openurl.sh ' + DEST)
self.system('cp tools/quake3/q3map2/changelog.q3map2.txt ' + DEST)
# documentation
self.system('cp -R docs/manual/Q3Rad_Manual ' + DEST)
self.system('cp -R docs/manual/quake3/Compile_Manual ' + DEST)
self.system('cp -R docs/manual/quake3/Model_Manual ' + DEST)
self.system('cp -R docs/manual/quake3/Terrain_Manual ' + DEST)
# copy plugins media
#self.system('mkdir -p ' + DEST + '/plugins/bitmaps')
#self.system('cp -R contrib/bobtoolz/bitmaps/* ' + DEST + '/plugins/bitmaps')
#self.system('cp -R contrib/bobtoolz/bt ' + DEST + '/plugins')
#self.system('cp -R contrib/camera/bitmaps/* ' + DEST + '/plugins/bitmaps' )
#self.system('cp -R contrib/bkgrnd2d/bitmaps/* ' + DEST + '/plugins/bitmaps' )
# games files
self.system('mkdir -p ' + self.SETUP_DIR + '/games')
def copy_q3(self):
# binaries
self.system('mkdir -p ' + self.SETUP_BIN_DIR + '/q3')
if ( self.g_darwin == 0 ):
self.system('cp setup/linux/bspc ' + self.SETUP_BIN_DIR + '/q3')
# goes in core
DEST = self.SETUP_DIR + '/core/q3.game'
self.system('mkdir -p ' + DEST)
self.system('cp -R games/Q3Pack/tools/q3.game/* ' + DEST)
self.system('cp -R docs/manual/quake3/Team_Arena_Mapping_Help ' + DEST)
self.system('cp -R docs/manual/quake3/New_Teams_For_Q3TA ' + DEST)
self.system('cp -R docs/manual/quake3/Q3AShader_Manual ' + DEST)
# goes in the game install path
DEST = self.SETUP_DIR + '/q3'
self.system('mkdir -p ' + DEST)
self.system('cp -R games/Q3Pack/baseq3 ' + DEST)
self.system('cp -R games/Q3Pack/missionpack ' + DEST)
# game file
self.system('cp -R games/Q3Pack/tools/games/q3.game ' + self.SETUP_DIR + '/games')
def copy_wolf(self):
# binaries
self.system('mkdir -p ' + self.SETUP_BIN_DIR + '/wolf')
if ( self.g_darwin == 0 ):
self.system('cp games/WolfPack/bin/wolf.game/bspc ' + self.SETUP_BIN_DIR + '/wolf')
# goes in core
DEST = self.SETUP_DIR + '/core/wolf.game'
self.system('mkdir -p ' + DEST)
self.system('cp -R games/WolfPack/docs ' + DEST)
self.system('cp -R games/WolfPack/bin/wolf.game/* ' + DEST)
# goes in the game install path
DEST = self.SETUP_DIR + '/wolf/main'
self.system('mkdir -p ' + DEST)
self.system('cp games/WolfPack/astro-skies.pk3 ' + DEST)
self.system('cp games/WolfPack/common-astro-spog.pk3 ' + DEST)
self.system('cp games/WolfPack/lights.pk3 ' + DEST)
self.system('cp -R games/WolfPack/scripts ' + DEST)
self.system('cp -R games/WolfPack/maps ' + DEST)
self.system('cp -R games/WolfPack/models ' + DEST)
# game file
self.system('cp -R games/WolfPack/bin/games/wolf.game ' + self.SETUP_DIR + '/games')
def copy_et(self):
# goes in core
DEST = self.SETUP_DIR + '/core/et.game'
self.system('mkdir -p ' + DEST)
self.system('cp -R games/ETPack/docs ' + DEST)
self.system('cp -R games/ETPack/et.game/* ' + DEST)
# goes in game install path
DEST = self.SETUP_DIR + '/et/etmain'
self.system('mkdir -p ' + DEST)
self.system('cp games/ETPack/astro-skies.pk3 ' + DEST)
self.system('cp games/ETPack/common.pk3 ' + DEST)
self.system('cp games/ETPack/goldrush.pcx ' + DEST)
self.system('cp games/ETPack/lights.pk3 ' + DEST)
self.system('cp games/ETPack/mapmedia.pk3 ' + DEST)
self.system('cp -R games/ETPack/scripts ' + DEST)
self.system('cp -R games/ETPack/maps ' + DEST)
self.system('cp -R games/ETPack/models ' + DEST)
# game file
self.system('cp -R games/ETPack/games/et.game ' + self.SETUP_DIR + '/games')
def copy_doom3(self):
# goes in core
DEST = self.SETUP_DIR + '/core/doom3.game'
self.system('mkdir -p ' + DEST)
self.system('cp -R games/Doom3Pack/tools/doom3.game/* ' + DEST)
# game file
self.system('cp -R games/Doom3Pack/tools/games/doom3.game ' + self.SETUP_DIR + '/games')
def copy_q2(self):
# binaries
self.system('cp -R install/q2 %s' % (self.SETUP_BIN_DIR))
# goes in core
DEST = self.SETUP_DIR + '/core/q2.game'
self.system('mkdir -p ' + DEST + '/modules')
self.system('cp -R games/Q2Pack/q2.game/* ' + DEST)
self.system('cp install/q2/q2map install/q2/qdata3 ' + DEST)
# self.system('cp -R install/q2/modules ' + DEST )
# goes in game install path
DEST = self.SETUP_DIR + '/q2'
self.system('mkdir -p ' + DEST + '/baseq2')
self.system('cp -R games/Q2Pack/baseq2/* ' + DEST + '/baseq2')
# game file
self.system('cp -R games/Q2Pack/games/q2.game ' + self.SETUP_DIR + '/games')
def copy_her2(self):
# binaries
self.system('cp -R install/heretic2 %s' % (self.SETUP_BIN_DIR))
# goes in core
DEST = self.SETUP_DIR + '/core/heretic2.game'
self.system('mkdir -p ' + DEST + '/modules')
self.system('cp -R games/Her2Pack/heretic2.game/* ' + DEST)
self.system('cp install/q2/q2map install/heretic2/qdata3 ' + DEST)
# self.system('cp -R install/heretic2/modules ' + DEST )
# goes in game install path
DEST = self.SETUP_DIR + '/heretic2'
self.system('mkdir -p ' + DEST + '/base')
self.system('cp -R games/Her2Pack/base/* ' + DEST + '/base')
# game file
self.system('cp -R games/Her2Pack/games/heretic2.game ' + self.SETUP_DIR + '/games')
def build_setup(self):
self.system( 'cp -R ' + self.SETUP_IMAGE_OS + '/* ' + self.SETUP_DIR )
self.system( 'cp -fR ' + self.SETUP_IMAGE + '/* ' + self.SETUP_DIR )
self.system('cp setup/license.txt ' + self.SETUP_DIR)
self.system('cp setup/linux/README ' + self.SETUP_DIR)
OS_DEFS=''
if (self.g_darwin):
OS_DEFS='--define=M4_OSX'
M4_LINE = OS_DEFS + ' --define=M4_VER_MAJOR=' + self.major + ' --define=M4_VER_MINOR=' + self.minor + ' --define=M4_VER=' + self.line
M4_LINE += ' --define=M4_GAME_ET=%d' % self.DO_GAME_ET
M4_LINE += ' --define=M4_GAME_DOOM3=%d' % self.DO_GAME_DOOM3
M4_LINE += ' --define=M4_GAME_Q2=%d' % self.DO_GAME_Q2
if ( self.M4_STDC != '' ):
M4_LINE += ' --define=M4_STDC=' + self.M4_STDC
# setup.xml
self.system('m4 ' + M4_LINE + ' ' + self.SETUP_DIR + '/setup.data/setup.xml.in > ' + self.SETUP_DIR + '/setup.data/setup.xml')
# postinstall.sh
self.system('m4 ' + M4_LINE + ' ' + self.SETUP_DIR + '/setup.data/postinstall.sh.in > ' + self.SETUP_DIR + '/setup.data/postinstall.sh')
# config.sh
self.system('m4 ' + M4_LINE + ' ' + self.SETUP_DIR + '/setup.data/config.sh.in > ' + self.SETUP_DIR + '/setup.data/config.sh')
# setup.sh
self.system('m4 ' + M4_LINE + ' ' + self.SETUP_DIR + '/setup.sh.in > ' + self.SETUP_DIR + '/setup.sh')
self.system('chmod +x ' +self.SETUP_DIR + '/setup.sh')
self.system('find ' + self.SETUP_DIR + ' -name .svn | while read i ; do rm -r "$i" ; done')
# pack it up
self.system('setup/linux/makeself/makeself.sh ' + self.SETUP_DIR + ' ' + self.SETUP_TARGET + ' "GtkRadiant ' + self.line + ' setup" ./setup.sh')
if (self.g_darwin):
def build_fink_deb(self):
print "Building installer .deb\n"
self.F_REV = '1'
self.FINKINFO_DIR = '/sw/fink/10.2/unstable/main/finkinfo/games'
self.TARBALL_DIR='radiant-' + self.F_REV + '.' + self.major
self.TARBALL_NAME='radiant-' + self.F_REV + '.' + self.major + '.tar.gz'
self.TARBALL_DEST='/sw/src'
# prepare package description
self.system('mkdir -p ' + self.FINKINFO_DIR)
self.system('m4 ' + M4_LINE + ' --define=M4_SETUP_TARGET=' + self.SETUP_TARGET + ' --define=M4_F_REV=' + self.F_REV + ' ' + 'setup/osx/radiant.info.m4 > ' + self.FINKINFO_DIR + '/radiant-' + self.TARBALL_DIR + '.info')
# build the tarball
self.system('if [ -r /tmp/' + self.TARBALL_DIR + ' ] ; then rm -r ' '/tmp/' + self.TARBALL_DIR + ' ; fi')
self.system('mkdir -p ' '/tmp/' + self.TARBALL_DIR)
self.system('cp ' + self.SETUP_TARGET + ' ' + '/tmp/' + self.TARBALL_DIR)
self.system('cd /tmp ; tar -cvzf ' + self.TARBALL_NAME + ' ' + self.TARBALL_DIR + ' ; cp ' + self.TARBALL_NAME + ' ' + self.TARBALL_DEST + '/')
self.system('/sw/bin/fink rebuild radiant')
build_fink_deb(self)
def spawn_setup(self, env, target, source):
if ( OS == 'Darwin' ):
self.g_darwin = 1
else:
self.g_darwin = 0
(self.line, self.major, self.minor) = get_version()
print 'Setup: GtkRadiant %s' % self.line
if ( self.g_darwin ):
self.SETUP_IMAGE_OS = '../loki_setup/image'
else:
self.SETUP_IMAGE_OS = 'setup/linux/setup_image.Linux'
self.SETUP_IMAGE = 'setup/linux/setup_image'
self.SETUP_DIR = '/tmp/radiant-setup.%d' % os.getpid()
self.EDITOR_BIN='radiant.' + g_cpu
if ( self.g_darwin ):
self.SETUP_BIN_DIR = self.SETUP_DIR + '/bin/Darwin/ppc'
self.SETUP_TARGET = 'osx-radiant-%s.run' % self.line
else:
self.SETUP_BIN_DIR = self.SETUP_DIR + '/bin/Linux/x86'
self.SETUP_TARGET = 'linux-radiant-%s.run' % self.line
# TODO: eval a conf file instead
self.DO_CORE=1
self.DO_GAME_Q3=1
self.DO_GAME_WOLF=1
self.DO_GAME_ET=1
self.DO_GAME_DOOM3=1
self.DO_GAME_Q2=1
self.DO_GAME_HER2=1
if ( self.g_darwin ):
self.DO_GAME_Q2=0
self.DO_GAME_ET=0
self.DO_GAME_HER2=0
# verbose a bit
print 'version: %s major: %s minor: %s\neditor core: %d\nq3: %d\nwolf: %d\net: %d\ndoom3: %d\nq2: %d\nher2: %d' % (self.line, self.major, self.minor, self.DO_CORE, self.DO_GAME_Q3, self.DO_GAME_WOLF, self.DO_GAME_ET, self.DO_GAME_DOOM3, self.DO_GAME_Q2, self.DO_GAME_HER2)
if (self.DO_CORE):
self.copy_core()
if (self.DO_GAME_Q3):
self.copy_q3()
if (self.DO_GAME_WOLF):
self.copy_wolf()
if (self.DO_GAME_ET):
self.copy_et()
if (self.DO_GAME_DOOM3):
self.copy_doom3()
if ( OS != 'Darwin' ):
if (self.DO_GAME_Q2):
self.copy_q2()
if (self.DO_GAME_HER2):
self.copy_her2()
self.build_setup()
return 0
def spawn_setup(env, target, source):
setup = setup_builder()
setup.spawn_setup(env, target, source)
# NOTE: could modify g_env to add the deps auto when calling SharedLibrarySafe ..
if (SETUP == '1'):
g_env.Command('foo', INSTALL + '/radiant.' + g_cpu, [ spawn_setup ] )
depends_list = [
INSTALL + '/modules/archivepak.so',
INSTALL + '/modules/archivewad.so',
INSTALL + '/modules/archivezip.so',
INSTALL + '/modules/entity.so',
# INSTALL + '/modules/fgd.so',
INSTALL + '/modules/imagehl.so',
INSTALL + '/modules/imageq2.so',
INSTALL + '/modules/image.so',
INSTALL + '/modules/imagepng.so',
INSTALL + '/modules/mapq3.so',
INSTALL + '/modules/mapxml.so',
INSTALL + '/modules/model.so',
INSTALL + '/modules/md3model.so',
INSTALL + '/modules/shaders.so',
INSTALL + '/modules/vfspk3.so',
# INSTALL + '/modules/vfswad.so',
# INSTALL + '/plugins/bobtoolz.so',
# INSTALL + '/plugins/camera.so',
# INSTALL + '/plugins/prtview.so',
# INSTALL + '/plugins/gensurf.so',
# INSTALL + '/plugins/bkgrnd2d.so',
INSTALL + '/q3map2.' + g_cpu,
INSTALL + '/radiant.' + g_cpu,
INSTALL + '/q3data.' + g_cpu ]
if ( OS != 'Darwin' ):
depends_list += [
INSTALL + '/q2/q2map',
INSTALL + '/q2/qdata3',
INSTALL + '/heretic2/qdata3',
INSTALL + '/heretic2/q2map' ]
g_env.Depends( 'foo', depends_list )
# end setup ---------------------------------------------------------------------------------------

332
SConstruct Normal file
View file

@ -0,0 +1,332 @@
# scons build script
# http://scons.sourceforge.net
import commands, re, sys, os, pickle, string, popen2
from makeversion import radiant_makeversion, get_version
from osx_setup import do_osx_setup
# to access some internal stuff
import SCons
conf_filename='site.conf'
# there is a default hardcoded value, you can override on command line, those are saved between runs
# we only handle strings
serialized=['CC', 'CXX', 'JOBS', 'BUILD', 'SETUP']
# help -------------------------------------------
Help("""
Usage: scons [OPTIONS] [TARGET] [CONFIG]
[OPTIONS] and [TARGET] are covered in command line options, use scons -H
[CONFIG]: KEY="VALUE" [...]
a number of configuration options saved between runs in the """ + conf_filename + """ file
erase """ + conf_filename + """ to start with default settings again
CC
CXX
Specify C and C++ compilers (defaults gcc and g++)
ex: CC="gcc-3.2"
You can use ccache and distcc, for instance:
CC="ccache distcc gcc" CXX="ccache distcc g++"
JOBS
Parallel build
ex: JOBS="4" is a good setting on SMP machines
BUILD
Use debug/release to select build settings
ex: BUILD="release" - default is debug
OSX: use BUILD="info" to generate the set of release files
SETUP
Build a setup - default 0
"""
)
# end help ---------------------------------------
# sanity -----------------------------------------
# get a recent python release
# that is broken in current version:
# http://sourceforge.net/tracker/index.php?func=detail&aid=794145&group_id=30337&atid=398971
#EnsurePythonVersion(2,1)
# above 0.90
EnsureSConsVersion( 0, 96 )
print 'SCons ' + SCons.__version__
# end sanity -------------------------------------
# system detection -------------------------------
# TODO: detect Darwin / OSX
# CPU type
g_cpu = commands.getoutput('uname -m')
exp = re.compile('.*i?86.*')
if (g_cpu == 'Power Macintosh' or g_cpu == 'ppc'):
g_cpu = 'ppc'
elif exp.match(g_cpu):
g_cpu = 'x86'
else:
g_cpu = 'cpu'
# OS
OS = commands.getoutput('uname')
print "OS=\"" + OS + "\""
if (OS == 'Linux'):
# libc .. do the little magic!
libc = commands.getoutput('/lib/libc.so.6 |grep "GNU C "|grep version|awk -F "version " \'{ print $2 }\'|cut -b -3')
# end system detection ---------------------------
# default settings -------------------------------
CC='gcc'
CXX='g++'
JOBS='1'
BUILD='debug'
INSTALL='#install'
SETUP='0'
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 -----------------------------------
if (SETUP == '1' and BUILD != 'release' and BUILD != 'info'):
print 'Forcing release build for setup'
BUILD = 'release'
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
CCFLAGS = '' + warningFlags
CXXFLAGS = '-pipe -DQ_NO_STLPORT ' + warningFlags + warningFlagsCXX
CPPPATH = []
if (BUILD == 'debug'):
CXXFLAGS += '-g -D_DEBUG '
CCFLAGS += '-g -D_DEBUG '
elif (BUILD == 'release'):
CXXFLAGS += '-O2 '
CCFLAGS += '-O2 '
elif ( BUILD == 'info' ):
print 'Preparing OSX release'
( line, major, minor ) = get_version()
do_osx_setup( major, minor, 'osx-radiant-%s.run' % line )
sys.exit( 0 )
else:
print 'Unknown build configuration ' + BUILD
sys.exit( 0 )
LINKFLAGS = ''
if ( OS == 'Linux' ):
# 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")
CXXFLAGS += '-fno-exceptions -fno-rtti '
LINKFLAGS += '-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` '
self['LINKFLAGS'] += '-lglib-2.0 '
def useXML2(self):
self['CXXFLAGS'] += '`xml2-config --cflags` '
self['CCFLAGS'] += '`xml2-config --cflags` '
self['LINKFLAGS'] += '-lxml2 '
def useGtk2(self):
self['CXXFLAGS'] += '`pkg-config gtk+-2.0 --cflags` '
self['CCFLAGS'] += '`pkg-config gtk+-2.0 --cflags` '
self['LINKFLAGS'] += '-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lpango-1.0 -lgdk_pixbuf-2.0 '
def useGtkGLExt(self):
self['CXXFLAGS'] += '`pkg-config gtkglext-1.0 --cflags` '
self['CCFLAGS'] += '`pkg-config gtkglext-1.0 --cflags` '
self['LINKFLAGS'] += '-lgtkglext-x11-1.0 -lgdkglext-x11-1.0 '
def usePNG(self):
self['CXXFLAGS'] += '`libpng-config --cflags` '
self['CCFLAGS'] += '`libpng-config --cflags` '
self['LINKFLAGS'] += '`libpng-config --ldflags` '
def useMHash(self):
self['LINKFLAGS'] += '-lmhash '
def useZLib(self):
self['LINKFLAGS'] += '-lz '
def usePThread(self):
if ( OS == 'Darwin' ):
self['LINKFLAGS'] += '-lpthread -Wl,-stack_size,0x400000 '
else:
self['LINKFLAGS'] += '-lpthread '
def CheckLDD(self, target, source, env):
file = target[0]
if (not os.path.isfile(file.abspath)):
print('ERROR: CheckLDD: target %s not found\n' % target[0])
Exit(1)
# not using os.popen3 as I want to check the return code
ldd = popen2.Popen3('`which ldd` -r %s' % target[0], 1)
stdout_lines = ldd.fromchild.readlines()
stderr_lines = ldd.childerr.readlines()
ldd_ret = ldd.wait()
del ldd
have_undef = 0
if ( ldd_ret != 0 ):
print "ERROR: ldd command returned with exit code %d" % ldd_ret
os.system('rm %s' % target[0])
Exit()
for i_line in stderr_lines:
print repr(i_line)
regex = re.compile('undefined symbol: (.*)\t\\((.*)\\)\n')
if ( regex.match(i_line) ):
symbol = regex.sub('\\1', i_line)
try:
env['ALLOWED_SYMBOLS'].index(symbol)
except:
have_undef = 1
else:
print "ERROR: failed to parse ldd stderr line: %s" % i_line
os.system('rm %s' % target[0])
Exit(1)
if ( have_undef ):
print "ERROR: undefined symbols"
os.system('rm %s' % target[0])
Exit(1)
def SharedLibrarySafe(self, target, source, LIBS=[], LIBPATH='.'):
result = self.SharedLibrary(target, source, LIBS=LIBS, LIBPATH=LIBPATH)
if (OS != 'Darwin'):
AddPostAction(target + '.so', self.CheckLDD)
return result
g_env = idEnvironment()
# export the globals
GLOBALS = 'g_env INSTALL SETUP g_cpu'
radiant_makeversion('\\ngcc version: %s.%s.%s' % ( ver_cc[0], ver_cc[1], ver_cc[2] ) )
# end general configuration ----------------------
# targets ----------------------------------------
Default('.')
Export('GLOBALS ' + GLOBALS)
BuildDir(g_build, '.', duplicate = 0)
SConscript(g_build + '/SConscript')
# end targets ------------------------------------

165
TODO Normal file
View file

@ -0,0 +1,165 @@
BUGS
MSI: installer bug with new folders? : create custom dir, click New Folder icon, type "FOLDER\" - gets stuck
GTK2: gtk2 crashes when trying to use bitmap fonts such as MS Sans Serif http://bugzilla.gnome.org/show_bug.cgi?id=142579
GTK2: alt+tab while mouse button is held down: see http://bugzilla.gnome.org/show_bug.cgi?id=145156
UI: changing resolution in floating-windows mode can screw up window positions.
HalfLife: half-life maps saved in q1 map format are not supported - currently have to convert them to hammer map format using hammer editor. And vice versa.
Entity: creating a new entity with all the brushes of another entity selected results in the latter entity having no brushes.
SConscript: build fails if SETUP=1
Brush: non-BP auto-texture-fit fails when rotation is 90
Doom3 startup asserts:
> .\eclass_doom3.cpp:342
> assertion failure: editor_color: parse error.
> .\eclass_doom3.cpp:357
> assertion failure: editor_mins: parse error.
> .\eclass_doom3.cpp:368
> assertion failure: editor_maxs: parse error.
can't use arrow keys to navigate in camera view when capslock is enabled
- connecting an entity to a path-corner renames the targetname of the path-corner, so if another entity E was linked to the path-corner, the link will be broken and you'll have to edit E and modify the target value
<gibbie> was looking around in 3dview and then autosave thingy came up and now i cant do anything anymore :(
HIGH priority 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.
- texture sizes sometimes vary wildly. It would be nice to find a way to normalize their display size so that very big textures are shrunk a little, and very small textures are blown-up a little.
- need some equivalent to select-inside.
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>
Doom3: add light-radius resizing using mouse drag.
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.
Toolbar: add button for refresh-models.
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.
Camera: option to toggle stats on/off.
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.
Brush: enable per-face filtering
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.
GUI: detachable submenus.
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-resizing for doom3 light_radius and light_center keys
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
Renderer: add shortcut to toggle between lighting/textured modes.
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.
Toolbar: add shortcut to tooltips for toolbar buttons
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
Textures: remove "shaders only" option for doom3
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: add merge-patches feature or resurrect bobtoolz
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
XYWindow: save show-workzone option
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.
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.
Selection: grow-brush-selection feature - select all neighbouring brushes
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.
Camera: Strafe while holding ctrl.
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?

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

View file

@ -0,0 +1,318 @@
/*
Copyright (C) 2003 Reed Mideke.
This file is part of GtkRadiant.
GtkRadiant is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GtkRadiant is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
//
// bkgrnd2d Plugin
//
// Code by reyalP aka Reed Mideke
//
// Based on various other plugins
//
#include "bkgrnd2d.h"
CBackgroundRender render;
CBackgroundImage backgroundXY(XY),backgroundXZ(XZ),backgroundYZ(YZ);
CBackgroundRender::CBackgroundRender()
{
refCount = 1;
}
CBackgroundRender::~CBackgroundRender()
{
}
void CBackgroundRender::Register()
{
g_QglTable.m_pfnHookGL2DWindow( this );
}
void CBackgroundRender::Draw2D( VIEWTYPE vt )
{
switch(vt)
{
case XY:
backgroundXY.Render();
break;
case XZ:
backgroundXZ.Render();
break;
case YZ:
backgroundYZ.Render();
break;
}
}
CBackgroundImage::CBackgroundImage(VIEWTYPE vt)
{
m_tex = NULL;
m_alpha = 0.5;
// TODO, sensible defaults ? Or not show until we have extents ?
m_xmin = m_ymin = 0.0f;
m_xmax = m_ymax = 0.0f;
m_bActive = false;
m_vt = vt;
switch(m_vt)
{
case XY:
m_ix = 0;
m_iy = 1;
break;
case XZ:
m_ix = 0;
m_iy = 2;
break;
case YZ:
m_ix = 1;
m_iy = 2;
break;
}
}
/*
* should cleanup, but I don't think we can be sure it happens before our
* interfaces are gone
CBackgroundImage::~CBackgroundImage()
{
}
*/
void CBackgroundImage::Cleanup()
{
if(m_tex) {
g_QglTable.m_pfn_qglDeleteTextures(1,&m_tex->texture_number);
g_free(m_tex);
m_tex = NULL;
}
}
void CBackgroundImage::Render()
{
if (!m_bActive || !Valid())
return;
g_QglTable.m_pfn_qglPushAttrib(GL_ALL_ATTRIB_BITS);
g_QglTable.m_pfn_qglEnable(GL_TEXTURE_2D);
g_QglTable.m_pfn_qglEnable(GL_BLEND);
g_QglTable.m_pfn_qglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
g_QglTable.m_pfn_qglTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
g_QglTable.m_pfn_qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
g_QglTable.m_pfn_qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
g_QglTable.m_pfn_qglPolygonMode(GL_FRONT,GL_FILL);
// TODO, just so we can tell if we end up going the wrong way
// g_QglTable.m_pfn_qglPolygonMode(GL_BACK,GL_LINE);
// TODO any other state we should not assume ?
g_QglTable.m_pfn_qglBindTexture(GL_TEXTURE_2D, m_tex->texture_number);
g_QglTable.m_pfn_qglBegin(GL_QUADS);
g_QglTable.m_pfn_qglColor4f(1.0,1.0,1.0,m_alpha);
g_QglTable.m_pfn_qglTexCoord2f(0.0,1.0);
g_QglTable.m_pfn_qglVertex2f(m_xmin,m_ymin);
g_QglTable.m_pfn_qglTexCoord2f(1.0,1.0);
g_QglTable.m_pfn_qglVertex2f(m_xmax,m_ymin);
g_QglTable.m_pfn_qglTexCoord2f(1.0,0.0);
g_QglTable.m_pfn_qglVertex2f(m_xmax,m_ymax);
g_QglTable.m_pfn_qglTexCoord2f(0.0,0.0);
g_QglTable.m_pfn_qglVertex2f(m_xmin,m_ymax);
g_QglTable.m_pfn_qglEnd();
g_QglTable.m_pfn_qglBindTexture(GL_TEXTURE_2D, 0);
g_QglTable.m_pfn_qglPopAttrib();
}
bool CBackgroundImage::Load(const char *filename)
{
qtexture_t *newtex;
unsigned char *image = NULL; // gets allocated with what ? g_malloc
int width = 0, height = 0;
g_FuncTable.m_pfnLoadImage(filename,&image,&width,&height);
if(!image) {
Syn_Printf(MSG_WARN "load %s failed\n",filename);
return false;
}
// just in case we want to build for an old version
// http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=900
#ifdef BKGRND2D_JPG_WORKAROUND
if ( strlen(filename) > 4 && !strcmp(".jpg",filename + strlen(filename) - 4)) {
Syn_Printf(MSG_PREFIX ".jpg workaround, clearing alpha channel\n");
int size = width*height*4;
int i;
for (i = 3; i < size; i+=4) {
image[i] = 255;
}
}
#endif
//TODO bug for stored texture size
//TODO whose gl context are we in, anyway ?
newtex = g_FuncTable.m_pfnLoadTextureRGBA(image,width,height);
g_free(image);
if(!newtex) {
Syn_Printf(MSG_WARN "image to texture failed\n");
return false;
}
Cleanup();
m_tex = newtex;
g_FuncTable.m_pfnSysUpdateWindows(W_XY);
return true;
}
bool CBackgroundImage::SetExtentsMM()
{
entity_s *worldentity;
const char *val;
int xmin = 0, ymin = 0, xmax = 0, ymax = 0;
worldentity = (entity_s *)g_FuncTable.m_pfnGetEntityHandle(0);
if(!worldentity) {
Syn_Printf(MSG_WARN "SetExtentsMM worldspawn not found\n");
return false;
}
//TODO val is not NULL even if key does not exist
val = g_EntityTable.m_pfnValueForKey(worldentity,"mapcoordsmins");
if(!val || !val[0]) {
Syn_Printf(MSG_WARN "SetExtentsMM mapcoordsmins not found\n");
return false;
}
// we could be more robust
// note contortions due to splashs strange idea of min and max
if(sscanf(val, "%d %d",&xmin,&ymax) != 2)
{
Syn_Printf(MSG_WARN "SetExtentsMM mapcoordsmins malformed\n");
return false;
}
val = g_EntityTable.m_pfnValueForKey(worldentity,"mapcoordsmaxs");
if(!val || !val[0]) {
Syn_Printf(MSG_WARN "SetExtentsMM mapcoordsmaxs not found\n");
return false;
}
if(sscanf(val, "%d %d",&xmax,&ymin) != 2)
{
Syn_Printf(MSG_WARN "SetExtentsMM mapcoordsmaxs malformed\n");
return false;
}
//might do sanity check before we commit
m_xmin = (float)xmin;
m_ymin = (float)ymin;
m_xmax = (float)xmax;
m_ymax = (float)ymax;
g_FuncTable.m_pfnSysUpdateWindows(W_XY);
return true;
}
// TODO, this should just be exported from core
// ripped directly from radiant/select.cpp:Select_GetBounds
//
static bool get_selection_bounds (vec3_t mins, vec3_t maxs)
{
brush_t *b;
int i;
brush_t *selected_brushes = g_DataTable.m_pfnSelectedBrushes();
//TODO should never happen
if(!selected_brushes) {
Sys_Printf (MSG_PREFIX "selected_brushes = NULL\n");
return false;
}
// this should mean no selection
if(selected_brushes == selected_brushes->next) {
Sys_Printf (MSG_PREFIX "nothing selected\n");
return false;
}
for (i=0 ; i<3 ; i++)
{
mins[i] = 99999;
maxs[i] = -99999;
}
for (b=selected_brushes->next ; b != selected_brushes ; b=b->next)
{
if (b->owner->eclass->fixedsize)
{
for (i=0 ; i<3 ; i++)
{
if (b->owner->origin[i] < mins[i])
mins[i] = b->owner->origin[i];
if (b->owner->origin[i] > maxs[i])
maxs[i] = b->owner->origin[i];
}
}
else
{
for (i=0 ; i<3 ; i++)
{
if (b->mins[i] < mins[i])
mins[i] = b->mins[i];
if (b->maxs[i] > maxs[i])
maxs[i] = b->maxs[i];
}
}
}
return true;
}
bool CBackgroundImage::SetExtentsSel()
{
vec3_t mins,maxs;
if(!get_selection_bounds(mins,maxs))
return false;
if(((int)mins[m_ix] == (int)maxs[m_ix]) ||
((int)mins[m_iy] == (int)maxs[m_iy])) {
Syn_Printf(MSG_PREFIX "tiny selection\n");
return false;
}
m_xmin = mins[m_ix];
m_ymin = mins[m_iy];
m_xmax = maxs[m_ix];
m_ymax = maxs[m_iy];
g_FuncTable.m_pfnSysUpdateWindows(W_XY);
return true;
}

View file

@ -0,0 +1,8 @@
; bkgrnd2d.def : Declares the module parameters for the DLL.
LIBRARY "BKGRND2D"
DESCRIPTION 'BKGRND2D Windows Dynamic Link Library'
EXPORTS
; Explicit exports can go here
Synapse_EnumerateInterfaces @1

View file

@ -0,0 +1,133 @@
# Microsoft Developer Studio Project File - Name="bkgrnd2d" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=bkgrnd2d - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "bkgrnd2d.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "bkgrnd2d.mak" CFG="bkgrnd2d - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "bkgrnd2d - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "bkgrnd2d - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "bkgrnd2d - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
F90=df.exe
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BKGRND2D_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\shared" /I "..\..\..\libxml2\include" /I "..\..\..\gtk2-win32\include\glib-2.0" /I "..\..\..\gtk2-win32\lib\glib-2.0\include" /I "..\..\..\gtk2-win32\lib\gtk-2.0\include" /I "..\..\..\gtk2-win32\include\gtk-2.0" /I "..\..\..\gtk2-win32\include\gtk-2.0\gdk" /I "..\..\..\gtk2-win32\include\pango-1.0" /I "..\..\..\gtk2-win32\include\atk-1.0" /I "..\..\include" /I "..\common" /I "..\..\libs" /I "..\..\libs\nvtristrip" /I "..\..\..\STLPort\stlport" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BKGRND2D_EXPORTS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 gobject-2.0.lib gdk-win32-2.0.lib gtk-win32-2.0.lib pango-1.0.lib glib-2.0.lib synapse.lib /nologo /dll /machine:I386 /libpath:"..\..\libs\synapse\release" /libpath:"..\..\..\gtk2-win32\lib\\"
!ELSEIF "$(CFG)" == "bkgrnd2d - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
F90=df.exe
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BKGRND2D_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\shared" /I "..\..\..\libxml2\include" /I "..\..\..\gtk2-win32\include\glib-2.0" /I "..\..\..\gtk2-win32\lib\glib-2.0\include" /I "..\..\..\gtk2-win32\lib\gtk-2.0\include" /I "..\..\..\gtk2-win32\include\gtk-2.0" /I "..\..\..\gtk2-win32\include\gtk-2.0\gdk" /I "..\..\..\gtk2-win32\include\pango-1.0" /I "..\..\..\gtk2-win32\include\atk-1.0" /I "..\..\include" /I "..\common" /I "..\..\libs" /I "..\..\libs\nvtristrip" /I "..\..\..\STLPort\stlport" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BKGRND2D_EXPORTS" /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 gobject-2.0.lib gdk-win32-2.0.lib gtk-win32-2.0.lib pango-1.0.lib glib-2.0.lib synapse.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"..\..\libs\synapse\debug" /libpath:"..\..\..\gtk2-win32\lib\\"
!ENDIF
# Begin Target
# Name "bkgrnd2d - Win32 Release"
# Name "bkgrnd2d - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\bkgrnd2d.cpp
# End Source File
# Begin Source File
SOURCE=.\bkgrnd2d.def
# End Source File
# Begin Source File
SOURCE=.\dialog.cpp
# End Source File
# Begin Source File
SOURCE=.\plugin.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\bkgrnd2d.h
# End Source File
# Begin Source File
SOURCE=.\dialog.h
# End Source File
# Begin Source File
SOURCE=.\plugin.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View file

@ -0,0 +1,82 @@
/*
Copyright (C) 2003 Reed Mideke.
This file is part of GtkRadiant.
GtkRadiant is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GtkRadiant is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
//
// bkgrnd2d Plugin
//
// Code by reyalP aka Reed Mideke
//
// Based on spritemodel source code by hydra
//
#include "plugin.h"
class CBackgroundImage {
private:
qtexture_t *m_tex;
VIEWTYPE m_vt;
// which components of a vec3_t correspond to x and y in the image
unsigned m_ix,m_iy;
public:
CBackgroundImage(VIEWTYPE vt);
// ~CBackgroundImage();
float m_alpha; // vertex alpha
bool m_bActive;
// x and y axis are in relation to the screen, not world, making rendering
// the same for each view type. Whoever sets them is responsible for
// shuffling.
// units are world units.
// TODO should be private
float m_xmin,m_ymin,m_xmax,m_ymax;
// load file, create new tex, cleanup old tex, set new tex
bool Load(const char *filename);
void Cleanup(); // free texture, free tex, set make tex NULL
bool SetExtentsMM(); // set extents by ET mapcoordsmaxs/mapcoordsmins
bool SetExtentsSel(); // set extents by selection
void Render();
bool Valid() { return (m_tex && (m_xmin != m_xmax) && (m_ymin != m_ymax)); }
};
class CBackgroundRender : public IGL2DWindow {
public:
CBackgroundRender();
virtual ~CBackgroundRender();
protected:
int refCount;
public:
// IGL2DWindow IGL3DWindow interface
void IncRef() { refCount++; }
void DecRef() { refCount--; if (refCount <= 0) delete this; }
void Draw2D( VIEWTYPE vt );
void Register();
};
extern CBackgroundImage backgroundXY,backgroundXZ,backgroundYZ;
extern CBackgroundRender render;

View file

@ -0,0 +1,171 @@
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.00"
Name="bkgrnd2d"
ProjectGUID="{356A36AA-1F10-48A0-BF63-227DFB46F208}"
>
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="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"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;BKGRND2D_EXPORTS"
StringPooling="TRUE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Release/bkgrnd2d.pch"
AssemblerListingLocation=".\Release/"
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
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
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"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;BKGRND2D_EXPORTS"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Debug/bkgrnd2d.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
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>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath=".\bkgrnd2d.cpp">
</File>
<File
RelativePath=".\bkgrnd2d.def">
</File>
<File
RelativePath=".\dialog.cpp">
</File>
<File
RelativePath=".\plugin.cpp">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath=".\bkgrnd2d.h">
</File>
<File
RelativePath=".\dialog.h">
</File>
<File
RelativePath=".\plugin.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

364
contrib/bkgrnd2d/dialog.cpp Normal file
View file

@ -0,0 +1,364 @@
/*
Copyright (C) 2003 Reed Mideke.
This file is part of GtkRadiant.
GtkRadiant is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GtkRadiant is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
//
// bkgrnd2d Plugin dialog
//
// Code by reyalP aka Reed Mideke
//
// Based on various other plugins
//
#include <gtk/gtk.h>
#include "bkgrnd2d.h"
#include "dialog.h"
// spaces to make label nice and big
#define NO_FILE_MSG " (no file loaded) "
static GtkWidget *pDialogWnd;
static GtkWidget *pNotebook;
static GtkTooltips *pTooltips;
class CBackgroundDialogPage
{
private:
GtkWidget *m_pWidget;
GtkWidget *m_pTabLabel;
GtkWidget *m_pFileLabel;
GtkWidget *m_pPosLabel;
VIEWTYPE m_vt;
bool m_bValidFile;
public:
CBackgroundImage *m_pImage;
CBackgroundDialogPage( VIEWTYPE vt );
void Append(GtkWidget *notebook);
void Browse();
void Reload();
void SetPosLabel();
// ~BackgroundDialogPage();
};
// dialog page callbacks
static void browse_callback( GtkWidget *widget, gpointer data )
{
((CBackgroundDialogPage *)data)->Browse();
}
static void reload_callback( GtkWidget *widget, gpointer data )
{
((CBackgroundDialogPage *)data)->Reload();
}
static void size_sel_callback( GtkWidget *widget, gpointer data )
{
CBackgroundDialogPage *pPage = (CBackgroundDialogPage *)data;
if (pPage->m_pImage->SetExtentsSel())
pPage->SetPosLabel();
}
static void size_mm_callback( GtkWidget *widget, gpointer data )
{
CBackgroundDialogPage *pPage = (CBackgroundDialogPage *)data;
if(pPage->m_pImage->SetExtentsMM())
pPage->SetPosLabel();
}
static void alpha_adjust_callback( GtkWidget *widget, gpointer data )
{
CBackgroundDialogPage *pPage = (CBackgroundDialogPage *)data;
pPage->m_pImage->m_alpha = (float)gtk_range_get_value (GTK_RANGE(widget));
g_FuncTable.m_pfnSysUpdateWindows(W_XY);
}
void CBackgroundDialogPage::Reload()
{
if(m_bValidFile)
m_pImage->Load(gtk_label_get_text(GTK_LABEL(m_pFileLabel)));
}
void CBackgroundDialogPage::Browse()
{
char browsedir[PATH_MAX];
const char *ct;
const char *newfile;
char *t;
//TODO GetMapName saves the map. eeep!
//also with no map, returns unnamed.map, otherwise returns full path
// Syn_Printf(MSG_PREFIX "GetMapName() %s\n",
// g_FuncTable.m_pfnGetMapName());
ct = g_FuncTable.m_pfnReadProjectKey("basepath");
// TODO shouldn't need this stuff
if(!ct || !strlen(ct)) {
Syn_Printf(MSG_PREFIX "basepath = NULL or empty\n");
return;
}
Syn_Printf(MSG_PREFIX "basepath: %s\n",ct);
if(strlen(ct) >= PATH_MAX) {
Syn_Printf(MSG_PREFIX "base game dir too long\n");
return;
}
strcpy(browsedir,ct);
// make sure we have a trailing /
if(browsedir[strlen(browsedir) - 1] != '/')
strcat(browsedir,"/");
//if we dont have a file yet, don't try to use it for default dir
if(m_bValidFile) {
// filename should always be a nice clean unix style relative path
ct = gtk_label_get_text(GTK_LABEL(m_pFileLabel));
strcat(browsedir,ct);
Syn_Printf(MSG_PREFIX "full path: %s\n",browsedir);
// lop off the file part
t = browsedir + strlen(browsedir) - 1;
while (t != browsedir && *t != '/')
t--;
*t = 0;
}
Syn_Printf(MSG_PREFIX "browse directory %s\n",browsedir);
//does NOT need freeing contrary to include/qerplugin.h comments
//TODO bug/patch for comments
//TODO patern gets fucked up sometimes if empty
//http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=915
newfile = g_FuncTable.m_pfnFileDialog(pDialogWnd,TRUE,
"Load Background Image",browsedir,FILETYPE_KEY);
if(!newfile) {
Syn_Printf(MSG_PREFIX "newfile = NULL\n");
return;
}
Syn_Printf(MSG_PREFIX "newfile: %s\n",newfile);
newfile = g_FileSystemTable.m_pfnExtractRelativePath(newfile);
if(!newfile) {
Syn_Printf(MSG_PREFIX "newfile = NULL\n");
return;
}
Syn_Printf(MSG_PREFIX "newfile: %s\n",newfile);
if(m_pImage->Load(newfile)) {
m_bValidFile = true;
gtk_label_set_text(GTK_LABEL(m_pFileLabel),newfile);
}
}
void CBackgroundDialogPage::SetPosLabel()
{
char s[64];
// TODO no snprintf ?
sprintf(s, "Size/Position (%d,%d) (%d,%d)",(int)(m_pImage->m_xmin),
(int)(m_pImage->m_ymin),(int)(m_pImage->m_xmax),(int)(m_pImage->m_ymax));
gtk_label_set_text(GTK_LABEL(m_pPosLabel),s);
}
CBackgroundDialogPage::CBackgroundDialogPage(VIEWTYPE vt )
{
GtkWidget *frame;
GtkWidget *hbox;
GtkWidget *w;
m_vt = vt;
m_bValidFile = false;
switch(m_vt)
{
case XY:
m_pTabLabel = gtk_label_new("X/Y");
m_pImage = &backgroundXY;
break;
case XZ:
m_pTabLabel = gtk_label_new("X/Z");
m_pImage = &backgroundXZ;
break;
case YZ:
m_pTabLabel = gtk_label_new("Y/Z");
m_pImage = &backgroundYZ;
break;
}
// A vbox to hold everything
m_pWidget = gtk_vbox_new(FALSE,0);
// Frame for file row
frame = gtk_frame_new("File");
gtk_box_pack_start (GTK_BOX (m_pWidget),frame, FALSE, FALSE, 2);
// hbox for first row
hbox = gtk_hbox_new(FALSE,5);
gtk_container_set_border_width(GTK_CONTAINER (hbox),4);
gtk_container_add (GTK_CONTAINER (frame), hbox);
// label to display filename
m_pFileLabel = gtk_label_new(NO_FILE_MSG);
gtk_label_set_selectable(GTK_LABEL(m_pFileLabel),TRUE);
//TODO set min size ? done with spaces right now
gtk_box_pack_start (GTK_BOX (hbox),m_pFileLabel, TRUE, TRUE, 5);
gtk_widget_show (m_pFileLabel);
w = gtk_button_new_with_label ("Browse...");
g_signal_connect (G_OBJECT (w), "clicked", G_CALLBACK (browse_callback),
(gpointer)this);
gtk_box_pack_start (GTK_BOX (hbox),w, FALSE, FALSE, 5);
gtk_tooltips_set_tip (pTooltips, w, "Select a file", NULL);
gtk_widget_show (w);
w = gtk_button_new_with_label ("Reload");
g_signal_connect (G_OBJECT (w), "clicked", G_CALLBACK (reload_callback),
(gpointer)this);
// TODO disable until we have file
// gtk_widget_set_sensitive(w,FALSE);
gtk_tooltips_set_tip (pTooltips, w, "Reload current file", NULL);
gtk_box_pack_start (GTK_BOX (hbox),w, FALSE, FALSE, 5);
gtk_widget_show (w);
gtk_widget_show (hbox);
gtk_widget_show (frame);
// second row (rendering options)
frame = gtk_frame_new("Rendering");
gtk_box_pack_start (GTK_BOX (m_pWidget),frame, FALSE, FALSE, 2);
hbox = gtk_hbox_new(FALSE,5);
gtk_container_set_border_width(GTK_CONTAINER (hbox),4);
gtk_container_add (GTK_CONTAINER (frame), hbox);
w = gtk_label_new("Vertex alpha:");
gtk_box_pack_start (GTK_BOX (hbox),w, FALSE, FALSE, 5);
gtk_widget_show (w);
w = gtk_hscale_new_with_range(0.0,1.0,0.01);
gtk_range_set_value(GTK_RANGE(w),0.5);
gtk_scale_set_value_pos(GTK_SCALE(w),GTK_POS_LEFT);
g_signal_connect (G_OBJECT (w), "value-changed",
G_CALLBACK (alpha_adjust_callback), (gpointer)this);
gtk_box_pack_start (GTK_BOX (hbox),w, TRUE, TRUE, 5);
gtk_tooltips_set_tip (pTooltips, w, "Set image transparancy", NULL);
gtk_widget_show (w);
gtk_widget_show (hbox);
gtk_widget_show (frame);
// Third row (size and position)
frame = gtk_frame_new("Size/Position (undefined)");
m_pPosLabel = gtk_frame_get_label_widget (GTK_FRAME(frame));
gtk_box_pack_start ( GTK_BOX (m_pWidget), frame, FALSE, FALSE, 2);
hbox = gtk_hbox_new(FALSE,5);
gtk_container_add (GTK_CONTAINER (frame), hbox);
gtk_container_set_border_width(GTK_CONTAINER (hbox),4);
w = gtk_button_new_with_label ("from selection");
gtk_box_pack_start (GTK_BOX (hbox),w, TRUE, FALSE, 5);
g_signal_connect (G_OBJECT (w), "clicked", G_CALLBACK (size_sel_callback),
(gpointer)this);
gtk_tooltips_set_tip (pTooltips, w, "Set the size of the image to the bounding rectangle of all selected brushes and entities", NULL);
gtk_widget_show (w);
if(m_vt == XY) {
w = gtk_button_new_with_label ("from map mins/maxs");
gtk_box_pack_start ( GTK_BOX (hbox),w, TRUE, FALSE, 2);
g_signal_connect (G_OBJECT (w), "clicked", G_CALLBACK (size_mm_callback),
(gpointer)this);
gtk_tooltips_set_tip (pTooltips, w, "Set the size of the image using the mapcoordsmins and mapcoordsmaxs keys of the worldspawn entity", NULL);
gtk_widget_show (w);
}
gtk_widget_show (hbox);
gtk_widget_show (frame);
gtk_widget_show ( m_pWidget );
}
void CBackgroundDialogPage::Append(GtkWidget *notebook)
{
gtk_notebook_append_page( GTK_NOTEBOOK(notebook), m_pWidget, m_pTabLabel);
}
// dialog global callbacks
/*
static gint expose_callback( GtkWidget *widget, gpointer data )
{
return FALSE;
}
*/
static void response_callback( GtkWidget *widget, gint response, gpointer data )
{
if( response == GTK_RESPONSE_CLOSE )
gtk_widget_hide( pDialogWnd );
}
static gint close_callback( GtkWidget *widget, gpointer data )
{
gtk_widget_hide( pDialogWnd );
return TRUE;
}
void InitBackgroundDialog()
{
CBackgroundDialogPage *pPage;
pDialogWnd = gtk_dialog_new_with_buttons ("Background Images",
GTK_WINDOW(g_pMainWidget),
(GtkDialogFlags)(GTK_DIALOG_DESTROY_WITH_PARENT),
// TODO dialog with no buttons
// GTK_STOCK_CLOSE,
// GTK_RESPONSE_CLOSE,
NULL);
gtk_signal_connect( GTK_OBJECT (pDialogWnd), "delete_event",
GTK_SIGNAL_FUNC( close_callback ), NULL );
gtk_signal_connect( GTK_OBJECT (pDialogWnd), "response",
GTK_SIGNAL_FUNC( response_callback ), NULL );
// gtk_signal_connect( GTK_OBJECT (pDialogWnd), "expose_event", GTK_SIGNAL_FUNC( ci_expose ), NULL );
pTooltips = gtk_tooltips_new();
pNotebook = gtk_notebook_new();
pPage = new CBackgroundDialogPage(XY);
pPage->Append(pNotebook);
pPage = new CBackgroundDialogPage(XZ);
pPage->Append(pNotebook);
pPage = new CBackgroundDialogPage(YZ);
pPage->Append(pNotebook);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG(pDialogWnd)->vbox), pNotebook, TRUE, TRUE, 0);
gtk_widget_show ( pNotebook );
gtk_widget_realize( pDialogWnd );
}
void ShowBackgroundDialog()
{
gtk_window_present( GTK_WINDOW(pDialogWnd) );
}
void ShowBackgroundDialogPG(int page)
{
gtk_notebook_set_current_page(GTK_NOTEBOOK(pNotebook),page);
ShowBackgroundDialog();
}

35
contrib/bkgrnd2d/dialog.h Normal file
View file

@ -0,0 +1,35 @@
/*
Copyright (C) 2003 Reed Mideke.
This file is part of GtkRadiant.
GtkRadiant is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GtkRadiant is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
//
// bkgrnd2d Plugin dialog box
//
// Code by reyalP aka Reed Mideke
//
//
#ifndef _BKGRND2D_DIALOG_H_
#define _BKGRND2D_DIALOG_H_
void InitBackgroundDialog();
void ShowBackgroundDialog();
void ShowBackgroundDialogPG(int page);
#endif // _BKGRND2D_DIALOG_H_

319
contrib/bkgrnd2d/plugin.cpp Normal file
View file

@ -0,0 +1,319 @@
/*
Copyright (C) 2003 Reed Mideke.
This file is part of GtkRadiant.
GtkRadiant is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GtkRadiant is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
//
// 2d background Plugin
//
// Code by reyalP aka Reed Mideke
//
// Based on
//
/*
Overview
========
This little plugin allows you to display an image in the background of the
gtkradiant XY window.
Version History
===============
v0.1
- Initial version.
v0.2
- three views, dialog box, toolbar
v0.25
- tooltips, follow gtkradiant coding conventions
Why ?
-----
http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=88
How ?
-----
- textures 'n widgets 'n stuff.
*/
//#include "plugin.h"
//TODO we just poke the objects directly
#include "bkgrnd2d.h"
#include "dialog.h"
#define CMD_SEP "-"
#define CMD_CONFIG "Configure..."
#define CMD_ABOUT "About..."
// =============================================================================
// Globals
// function tables
_QERFuncTable_1 g_FuncTable;
_QERQglTable g_QglTable;
_QERFileSystemTable g_FileSystemTable;
_QEREntityTable g_EntityTable;
_QERAppDataTable g_DataTable;
// for the file load dialog
void *g_pMainWidget;
// =============================================================================
// plugin implementation
static const char *PLUGIN_NAME = "2d window background plugin";
//backwards for some reason
static const char *PLUGIN_COMMANDS = CMD_ABOUT ";"
CMD_SEP ";"
CMD_CONFIG
;
static const char *PLUGIN_ABOUT = "2d window background v0.25\n\n"
"By reyalP (hellsownpuppy@yahoo.com)";
void DoBkgrndToggleXY();
void DoBkgrndToggleXZ();
void DoBkgrndToggleYZ();
#define NUM_TOOLBAR_BUTTONS 4
struct toolbar_button_info_s
{
char *image;
char *text;
char *tip;
void (*func)();
IToolbarButton::EType type;
};
struct toolbar_button_info_s toolbar_buttons[NUM_TOOLBAR_BUTTONS] =
{
{
"bkgrnd2d_xy_toggle.bmp",
"xy background",
"Toggle xy background image",
DoBkgrndToggleXY,
IToolbarButton::eToggleButton
},
{
"bkgrnd2d_xz_toggle.bmp",
"xz background",
"Toggle xz background image",
DoBkgrndToggleXZ,
IToolbarButton::eToggleButton
},
{
"bkgrnd2d_yz_toggle.bmp",
"yz background",
"Toggle yz background image",
DoBkgrndToggleYZ,
IToolbarButton::eToggleButton
},
{
"bkgrnd2d_conf.bmp",
"Configure",
"Configure background images",
ShowBackgroundDialog,
IToolbarButton::eButton
},
};
class Bkgrnd2dButton : public IToolbarButton
{
public:
const toolbar_button_info_s *bi;
virtual const char* getImage() const
{
return bi->image;
}
virtual const char* getText() const
{
return bi->text;
}
virtual const char* getTooltip() const
{
return bi->tip;
}
virtual void activate() const
{
bi->func();
return ;
}
virtual EType getType() const
{
return bi->type;
}
};
Bkgrnd2dButton g_bkgrnd2dbuttons[NUM_TOOLBAR_BUTTONS];
unsigned int ToolbarButtonCount()
{
return NUM_TOOLBAR_BUTTONS;
}
const IToolbarButton* GetToolbarButton(unsigned int index)
{
g_bkgrnd2dbuttons[index].bi = &toolbar_buttons[index];
return &g_bkgrnd2dbuttons[index];
}
extern "C" const char* QERPlug_Init (void *hApp, void* pMainWidget)
{
g_pMainWidget = pMainWidget;
InitBackgroundDialog();
render.Register();
//TODO is it right ? is it wrong ? it works
//TODO figure out supported image types
GetFileTypeRegistry()->addType(FILETYPE_KEY, filetype_t("all files", "*.*"));
GetFileTypeRegistry()->addType(FILETYPE_KEY, filetype_t("jpeg files", "*.jpg"));
GetFileTypeRegistry()->addType(FILETYPE_KEY, filetype_t("targa files", "*.tga"));
return (char *) PLUGIN_NAME;
}
extern "C" const char* QERPlug_GetName ()
{
return (char *) PLUGIN_NAME;
}
extern "C" const char* QERPlug_GetCommandList ()
{
return (char *) PLUGIN_COMMANDS;
}
extern "C" void QERPlug_Dispatch (const char *p, vec3_t vMin, vec3_t vMax, bool bSingleBrush)
{
Sys_Printf (MSG_PREFIX "Command \"%s\"\n",p);
if(!strcmp(p, CMD_ABOUT)) {
g_FuncTable.m_pfnMessageBox(NULL, PLUGIN_ABOUT, "About", MB_OK, NULL);
}
else if(!strcmp(p,CMD_CONFIG)) {
ShowBackgroundDialog();
}
}
//TODO these three suck
void DoBkgrndToggleXY()
{
Sys_Printf (MSG_PREFIX "DoBkgrndToggleXY\n");
// always toggle, since the buttons do
backgroundXY.m_bActive = (backgroundXY.m_bActive) ? false:true;
// if we don't have image or extents, and we activated,
// bring up the dialog with the corresponding page
// would be better to hide or grey out button, but we can't
if(backgroundXY.m_bActive && !backgroundXY.Valid())
ShowBackgroundDialogPG(0);
else
g_FuncTable.m_pfnSysUpdateWindows(W_XY);
}
void DoBkgrndToggleXZ()
{
Sys_Printf (MSG_PREFIX "DoBkgrndToggleXZ\n");
backgroundXZ.m_bActive = (backgroundXZ.m_bActive) ? false:true;
if(backgroundXZ.m_bActive && !backgroundXZ.Valid())
ShowBackgroundDialogPG(1);
else
g_FuncTable.m_pfnSysUpdateWindows(W_XY);
}
void DoBkgrndToggleYZ()
{
Sys_Printf (MSG_PREFIX "DoBkgrndToggleYZ\n");
backgroundYZ.m_bActive = (backgroundYZ.m_bActive) ? false:true;
if(backgroundYZ.m_bActive && !backgroundYZ.Valid())
ShowBackgroundDialogPG(2);
else
g_FuncTable.m_pfnSysUpdateWindows(W_XY);
}
// =============================================================================
// SYNAPSE
CSynapseServer* g_pSynapseServer = NULL;
CSynapseClientBkgrnd2d g_SynapseClient;
extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces (const char *version, CSynapseServer *pServer)
{
if (strcmp(version, SYNAPSE_VERSION))
{
Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version);
return NULL;
}
g_pSynapseServer = pServer;
g_pSynapseServer->IncRef();
Set_Syn_Printf(g_pSynapseServer->Get_Syn_Printf());
g_SynapseClient.AddAPI(TOOLBAR_MAJOR, BKGRND2D_MINOR, sizeof(_QERPlugToolbarTable));
g_SynapseClient.AddAPI(PLUGIN_MAJOR, BKGRND2D_MINOR, sizeof( _QERPluginTable ) );
g_SynapseClient.AddAPI( RADIANT_MAJOR, NULL, sizeof( g_FuncTable ), SYN_REQUIRE, &g_FuncTable );
g_SynapseClient.AddAPI( QGL_MAJOR, NULL, sizeof( g_QglTable ), SYN_REQUIRE, &g_QglTable );
// TODO is this the right way to ask for 'whichever VFS we have loaded' ? Seems to work
// for misc filename functions
g_SynapseClient.AddAPI( VFS_MAJOR, "*", sizeof( g_FileSystemTable ), SYN_REQUIRE, &g_FileSystemTable );
// get worldspawn
g_SynapseClient.AddAPI( ENTITY_MAJOR, NULL, sizeof( g_EntityTable ), SYN_REQUIRE, &g_EntityTable );
// selected brushes
g_SynapseClient.AddAPI( DATA_MAJOR, NULL, sizeof( g_DataTable ), SYN_REQUIRE, &g_DataTable );
return &g_SynapseClient;
}
bool CSynapseClientBkgrnd2d::RequestAPI(APIDescriptor_t *pAPI)
{
if (!strcmp(pAPI->major_name, PLUGIN_MAJOR))
{
_QERPluginTable* pTable= static_cast<_QERPluginTable*>(pAPI->mpTable);
pTable->m_pfnQERPlug_Init = QERPlug_Init;
pTable->m_pfnQERPlug_GetName = QERPlug_GetName;
pTable->m_pfnQERPlug_GetCommandList = QERPlug_GetCommandList;
pTable->m_pfnQERPlug_Dispatch = QERPlug_Dispatch;
return true;
}
if (!strcmp(pAPI->major_name, TOOLBAR_MAJOR))
{
_QERPlugToolbarTable* pTable= static_cast<_QERPlugToolbarTable*>(pAPI->mpTable);
pTable->m_pfnToolbarButtonCount = &ToolbarButtonCount;
pTable->m_pfnGetToolbarButton = &GetToolbarButton;
return true;
}
Syn_Printf("ERROR: RequestAPI( '%s' ) not found in '%s'\n", pAPI->major_name, GetInfo());
return false;
}
#include "version.h"
const char* CSynapseClientBkgrnd2d::GetInfo()
{
return "2d Background plugin built " __DATE__ " " RADIANT_VERSION;
}
const char* CSynapseClientBkgrnd2d::GetName()
{
return "bkgrnd2d";
}

79
contrib/bkgrnd2d/plugin.h Normal file
View file

@ -0,0 +1,79 @@
/*
Copyright (C) 2003 Reed Mideke.
This file is part of GtkRadiant.
GtkRadiant is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GtkRadiant is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
//
// bkgrnd2d Plugin
//
// Code by reyalP aka Reed Mideke
//
// Based on spritemodel source code by hydra
//
#ifndef _PLUGIN_H_
#define _PLUGIN_H_
/*!
\todo need general notice about lib purpose etc.
and the external dependencies (such as GLib, STL, mathlib etc.)
*/
#include <stdio.h>
// for CPtrArray for idata.h
#include "missing.h"
#include "synapse.h"
#include "iplugin.h"
#include "itoolbar.h"
#define USE_QERTABLE_DEFINE
#include "qerplugin.h"
#include "igl.h"
#include "ifilesystem.h"
#include "ientity.h"
#include "idata.h"
// verbose messages
#define BKGRND2D_DEBUG
extern _QERFuncTable_1 g_FuncTable;
extern _QERQglTable g_QglTable;
extern _QERFileSystemTable g_FileSystemTable;
extern _QEREntityTable g_EntityTable;
extern _QERAppDataTable g_DataTable;
extern void *g_pMainWidget;
extern CSynapseServer* g_pSynapseServer;
class CSynapseClientBkgrnd2d : public CSynapseClient
{
public:
// CSynapseClient API
bool RequestAPI(APIDescriptor_t *pAPI);
const char* GetInfo();
const char* GetName();
CSynapseClientBkgrnd2d() { }
virtual ~CSynapseClientBkgrnd2d() { }
};
#define MSG_PREFIX "bkgrnd2d: "
#define MSG_WARN "bkgrnd2d WARNING: "
#define BKGRND2D_MINOR "bkgrnd2d"
#define FILETYPE_KEY "bkgrnd2d"
#endif // _PLUGIN_H_

View file

@ -0,0 +1,131 @@
November 25 2003
bkgrnd2d v 0.25 beta for radiant 1.3.13
by SCDS_reyalP (email hellsownpuppy@yahoo.com)
WARNING:
This is an beta release. It is provided with absolutely NO WARRANTY.
If it turns your data to mush and melts your CPU, don't blame me.
Overview:
This little plugin allows you to display an image in the the gtkradiant 2d
windows. This is useful for layout sketches, maps made from
existing plans, building geometry based on photgraphs, viewing terrain
alphamaps in relation to your terrain, and so on.
Installation:
extract the .dll and bitmaps into your gtkradiant/plugins directory, and
restart radiant. Be sure to use directory names, to ensure the bitmaps go
in your plugins/bitmaps directory.
Uninstallation:
Close radiant, delete the bkgrnd2d.dll from the plugins directory, and
delete the bkgrnd2*.bmp files from the plugins/bitmaps directory.
User Interface:
- The plugin adds 4 buttons to the radiant plugin toolbar. The first 3
toggle the display of a background image in the specified view. The fourth
brings up a configuration dialog. The configuration dialog can also be
opened from the plugins menu.
- If an image has not been loaded, or it's display size and location have
not been set, pushing one of the toggle buttons will bring up the dialog
with the corresponding page selected.
- The configuration dialog is non-modal, meaning that you can leave it open
while you work in radiant. If it gets lost behind another window, clicking
on the configuration button will bring it to the forground.
Usage:
- bring up the configuration dialog.
- Choose the "Browse..." button. This will prompt you for an image file.
The file *MUST* be inside your basegame directory (baseq3, main, etmain or
whatever your chosen game uses). The image must be in a format supported by
the game in use. For q3 based games this is truecolor .jpg, .tga and
sometimes .png. For q2 this is .wal
- Use one of the following methods to set the size (in game units) that the
file is displayed.
1) select 1 or more brushes or entities and choose "from selection"
This will use the total dimensions off all selected brushes and entities
to size the image.
2) For the X/Y view only, choose 'Size to min/max keys' This will look in
the worldspawn entity for the keys mapcoordsmins and mapcoordsmaxs (also
used for ET tracemap generation and command map sizing) and use those
dimensions to size the image.
- Use the toggle buttons to show or hide the loaded images. The buttons will
press or unpress whenever you click them, but an image will only be
displayed once you have successfully loaded a file and set its size/postion.
- Set the opacity of the image using the slider in the configuration dialog.
- If any of these commands do not produce the expected results, there may be
an information in the radiant console. Please include this when reporting
bugs.
Notes and limitations:
- This plugin is compiled for GtkRadiant 1.3.13. It may or may not work with
later versions. It will *NOT* work with version 1.3.12 and below. If you
build from source (see below) you can build it for other versions.
- As mentioned above, the image *MUST* be inside your basegame directory, or
another directory in which radiant looks for game files.
- To prevent the image from being distorted, you should size it to the
original images aspect ratio. mapcoordsmaxs/mapcoordsmins and command maps
should always be square.
- If you want a specific pixel to world unit relationship, you must arrange
that yourself.
- On load, the image is converted to a texture whose dimensions are powers
of 2. If the original image dimensions are not powers of 2, some detail will
be lost due to resampling. If it is too large to fit on a single texture,
resolution is reduced.
- radiants gamma and mipmap options are applied to the image.
- If the image has an alpha channel, it will be included in the blending
process. 0 is transparent, 255 is opaque. .tga images are recommended if
you want to have an alpha channel.
- since the plugin will only use true color files, you cannot use a terrain
indexmap (aka alphamap) or heightmap directly. You can of course, save a
copy of your indexmap in a 32 bit format.
- There is no unload command.
- You put the plugin in a game specific plugin directory, rather than the
radiant plugin directory.
- You cannot set the image size with sub-unit precision.
- Only win32 binaries are included. The source is available from:
http://www.cyberonic.net/~gdevault/rfm/mapstuff/bkgrnd2d-b0.25-src.zip
If you want to use it on another platform you will need a buildable gtkradiant
source tree to build it. For any non-windows platform you will also have to
figure out the compile options. I suggest ripping those off from some other
plugin.
TODO:
- make file selection paterns match supported filetypes
- large images without downsampling
- bitmap and pcx support for indexmaps
- automatic size from indexmapped entities
- render under the grid instead of blending
- mac/*nix support
- remember/save/restore settings
- texture options independant of radiant prefs
- clean up icky code
Changes from 0.1
- all 2d views supported
- new ui
- file selection patterns, default directory improved
Changes from 0.2
- tooltips in dialog
- various code cleanup

View file

@ -0,0 +1,63 @@
/*
BobToolz plugin for GtkRadiant
Copyright (C) 2001 Gordon Biggans
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "StdAfx.h" // Added by ClassView
class CBspPoint {
public:
float p[3];
};
class CBspPortal {
public:
CBspPortal();
~CBspPortal();
unsigned point_count;
CBspPoint *point;
bool Build(char *def, unsigned int pointCnt, bool bInverse);
};
class CBspNode {
public:
CBspPortal *portal;
unsigned int portal_count;
bool AddPortal(char* def, unsigned int pointCnt, bool bInverse);
unsigned int portal_next;
CBspNode();
~CBspNode();
};
class CPortals {
public:
CPortals();
~CPortals();
void Load(); // use filename in fn
void Purge();
char fn[NAME_MAX];
CBspNode *node;
unsigned int node_count;
};

View file

@ -0,0 +1,366 @@
/*
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
*/
// BobView.cpp: implementation of the DBobView class.
//
//////////////////////////////////////////////////////////////////////
#include "StdAfx.h"
#include "DBobView.h"
#include "DListener.h"
//#include "misc.h"
#include "funchandlers.h"
#include "gtkr_list.h"
#include "str.h"
#include "misc.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
DBobView::DBobView()
{
nPathCount = 0;
refCount = 1;
m_bHooked = FALSE;
path = NULL;
eyes = NULL;
boundingShow = BOUNDS_APEX;
}
DBobView::~DBobView()
{
if(path)
delete[] path;
// oops forgot to remove our eyes, was causing access violation when it tried
// to talk to it's parent
if(eyes)
delete eyes;
if(m_bHooked)
UnRegister();
g_PathView = NULL;
}
//////////////////////////////////////////////////////////////////////
// Implementation
//////////////////////////////////////////////////////////////////////
void DBobView::Draw2D(VIEWTYPE vt)
{
if(!path)
return;
__QGLTABLENAME.m_pfn_qglPushAttrib(GL_ALL_ATTRIB_BITS);
__QGLTABLENAME.m_pfn_qglDisable(GL_BLEND);
__QGLTABLENAME.m_pfn_qglEnable(GL_LINE_SMOOTH);
__QGLTABLENAME.m_pfn_qglPushMatrix();
switch(vt)
{
case XY:
break;
case XZ:
__QGLTABLENAME.m_pfn_qglRotatef(270.0f, 1.0f, 0.0f, 0.0f);
break;
case YZ:
__QGLTABLENAME.m_pfn_qglRotatef(270.0f, 1.0f, 0.0f, 0.0f);
__QGLTABLENAME.m_pfn_qglRotatef(270.0f, 0.0f, 0.0f, 1.0f);
break;
}
__QGLTABLENAME.m_pfn_qglLineWidth(1.0f);
__QGLTABLENAME.m_pfn_qglColor4f(1.0f, 0.0f, 0.0f, 1.0f);
int i;
__QGLTABLENAME.m_pfn_qglBegin(GL_LINE_STRIP);
for(i = 0; i < nPathCount; i++)
__QGLTABLENAME.m_pfn_qglVertex3fv(path[i]);
__QGLTABLENAME.m_pfn_qglEnd();
if(m_bShowExtra)
{
// +mars
// for the bounding box stuff
__QGLTABLENAME.m_pfn_qglColor4f(0.25f, 0.75f, 0.75f, 1.0f);
__QGLTABLENAME.m_pfn_qglTranslatef( 16.0f, 16.0f, 28.0f );
__QGLTABLENAME.m_pfn_qglBegin( GL_LINE_STRIP );
for ( i = 0; i < nPathCount; i++ )
__QGLTABLENAME.m_pfn_qglVertex3fv( path[i] );
__QGLTABLENAME.m_pfn_qglEnd();
// ---------------
__QGLTABLENAME.m_pfn_qglTranslatef( -16.0f, -16.0f, -28.0f ); // back to where we were
__QGLTABLENAME.m_pfn_qglTranslatef( -16.0f, 16.0f, 28.0f ); // move to new postion
__QGLTABLENAME.m_pfn_qglBegin( GL_LINE_STRIP );
for ( i = 0; i < nPathCount; i++ )
__QGLTABLENAME.m_pfn_qglVertex3fv( path[i] );
__QGLTABLENAME.m_pfn_qglEnd();
// --------------
__QGLTABLENAME.m_pfn_qglTranslatef( 16.0f, -16.0f, -28.0f ); // back to where we were
__QGLTABLENAME.m_pfn_qglTranslatef( 16.0f, -16.0f, -28.0f ); // new pos
__QGLTABLENAME.m_pfn_qglBegin( GL_LINE_STRIP );
for ( i = 0; i < nPathCount; i++ )
__QGLTABLENAME.m_pfn_qglVertex3fv( path[i] );
__QGLTABLENAME.m_pfn_qglEnd();
// ----------------
__QGLTABLENAME.m_pfn_qglTranslatef( -16.0f, 16.0f, 28.0f ); // back to where we were
/* __QGLTABLENAME.m_pfn_qglTranslatef( -16.0f, -16.0f, -28.0f ); // new pos
__QGLTABLENAME.m_pfn_qglBegin( GL_LINE_STRIP );
if ( boundingShow == BOUNDS_ALL )
{
for ( i = 0; i < nPathCount; i++ )
__QGLTABLENAME.m_pfn_qglVertex3fv( path[i] );
}
else if ( boundingShow == BOUNDS_APEX )
{
for ( i = (nPathCount/4); i < (nPathCount/4) * 3; i++ )
__QGLTABLENAME.m_pfn_qglVertex3fv( path[i] );
}
__QGLTABLENAME.m_pfn_qglEnd();*/ // djbob: er, um doesn't really seem to do anyhting
}
// -mars
__QGLTABLENAME.m_pfn_qglPopMatrix();
__QGLTABLENAME.m_pfn_qglPopAttrib();
}
void DBobView::Draw3D()
{
if(!path)
return;
__QGLTABLENAME.m_pfn_qglPushAttrib(GL_ALL_ATTRIB_BITS);
__QGLTABLENAME.m_pfn_qglDisable(GL_BLEND);
__QGLTABLENAME.m_pfn_qglEnable(GL_LINE_SMOOTH);
__QGLTABLENAME.m_pfn_qglLineWidth(1.0f);
__QGLTABLENAME.m_pfn_qglColor4f(1.0f, 0.0f, 0.0f, 1.0f);
__QGLTABLENAME.m_pfn_qglBegin(GL_LINE_STRIP);
for(int i = 0; i < nPathCount; i++)
__QGLTABLENAME.m_pfn_qglVertex3fv(path[i]);
__QGLTABLENAME.m_pfn_qglEnd();
if(m_bShowExtra)
{
// +mars
// ahhh -- a nice C&P job :)
// for the bounding box stuff
__QGLTABLENAME.m_pfn_qglColor4f(0.25f, 0.75f, 0.75f, 1.0f);
__QGLTABLENAME.m_pfn_qglTranslatef( 16.0f, 16.0f, 28.0f );
__QGLTABLENAME.m_pfn_qglBegin( GL_LINE_STRIP );
int i;
for ( i = 0; i < nPathCount; i++ )
__QGLTABLENAME.m_pfn_qglVertex3fv( path[i] );
__QGLTABLENAME.m_pfn_qglEnd();
// ---------------
__QGLTABLENAME.m_pfn_qglTranslatef( -16.0f, -16.0f, -28.0f ); // back to where we were
__QGLTABLENAME.m_pfn_qglTranslatef( -16.0f, 16.0f, 28.0f ); // move to new postion
__QGLTABLENAME.m_pfn_qglBegin( GL_LINE_STRIP );
for ( i = 0; i < nPathCount; i++ )
__QGLTABLENAME.m_pfn_qglVertex3fv( path[i] );
__QGLTABLENAME.m_pfn_qglEnd();
// --------------
__QGLTABLENAME.m_pfn_qglTranslatef( 16.0f, -16.0f, -28.0f ); // back to where we were
__QGLTABLENAME.m_pfn_qglTranslatef( 16.0f, -16.0f, -28.0f ); // new pos
__QGLTABLENAME.m_pfn_qglBegin( GL_LINE_STRIP );
for ( i = 0; i < nPathCount; i++ )
__QGLTABLENAME.m_pfn_qglVertex3fv( path[i] );
__QGLTABLENAME.m_pfn_qglEnd();
// ----------------
__QGLTABLENAME.m_pfn_qglTranslatef( -16.0f, 16.0f, 28.0f ); // back to where we were
__QGLTABLENAME.m_pfn_qglTranslatef( -16.0f, -16.0f, -28.0f ); // new pos
__QGLTABLENAME.m_pfn_qglBegin( GL_LINE_STRIP );
for ( i = 0; i < nPathCount; i++ )
__QGLTABLENAME.m_pfn_qglVertex3fv( path[i] );
__QGLTABLENAME.m_pfn_qglEnd();
}
// -mars
__QGLTABLENAME.m_pfn_qglPopAttrib();
}
void DBobView::Register()
{
__QGLTABLENAME.m_pfnHookGL2DWindow( this );
__QGLTABLENAME.m_pfnHookGL3DWindow( this );
m_bHooked = TRUE;
}
void DBobView::UnRegister()
{
__QGLTABLENAME.m_pfnUnHookGL2DWindow( this );
__QGLTABLENAME.m_pfnUnHookGL3DWindow( this );
m_bHooked = FALSE;
}
void DBobView::SetPath(vec3_t *pPath)
{
if(path)
delete[] path;
path = pPath;
}
#define LOCAL_GRAVITY -800.0f
bool DBobView::CalculateTrajectory(vec3_t start, vec3_t apex, float multiplier, int points, float varGravity)
{
if(apex[2] <= start[2])
{
SetPath(NULL);
return FALSE;
}
// ----think q3a actually would allow these
//scrub that, coz the plugin wont :]
vec3_t dist, speed;
VectorSubtract(apex, start, dist);
vec_t speed_z = (float)sqrt(-2*LOCAL_GRAVITY*dist[2]);
float flight_time = -speed_z/LOCAL_GRAVITY;
VectorScale(dist, 1/flight_time, speed);
speed[2] = speed_z;
// Sys_Printf("Speed: (%.4f %.4f %.4f)\n", speed[0], speed[1], speed[2]);
vec3_t* pPath = new vec3_t[points];
float interval = multiplier*flight_time/points;
for(int i = 0; i < points; i++)
{
float ltime = interval*i;
VectorScale(speed, ltime, pPath[i]);
VectorAdd(pPath[i], start, pPath[i]);
// could do this all with vectors
// vGrav = {0, 0, -800.0f}
// VectorScale(vGrav, 0.5f*ltime*ltime, vAdd);
// VectorScale(speed, ltime, pPath[i]);
// _VectorAdd(pPath[i], start, pPath[i])
// _VectorAdd(pPath[i], vAdd, pPath[i])
pPath[i][2] = start[2] + (speed_z*ltime) + (varGravity*0.5f*ltime*ltime);
}
SetPath(pPath);
return TRUE;
}
void DBobView::Begin(const char* trigger, const char *target, float multiplier, int points, float varGravity, bool bNoUpdate, bool bShowExtra)
{
strcpy(entTrigger, trigger);
strcpy(entTarget, target);
fMultiplier = multiplier;
fVarGravity = varGravity;
nPathCount = points;
m_bShowExtra = bShowExtra;
Register();
if(UpdatePath())
{
if(!bNoUpdate)
{
eyes = new DListener;
eyes->parent = this;
eyes->Register();
}
}
else
{
Sys_ERROR("Initialization Failure in DBobView::Begin");
delete this;
}
}
bool DBobView::UpdatePath()
{
vec3_t start, apex;
if(GetEntityCentre(entTrigger, start))
{
if(GetEntityCentre(entTarget, apex))
{
CalculateTrajectory(start, apex, fMultiplier, nPathCount, fVarGravity);
return TRUE;
}
}
return FALSE;
}

View file

@ -0,0 +1,72 @@
/*
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
*/
// DBobView.h: interface for the DBobView class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_BOBVIEW_H__6E36062A_EF0B_11D4_ACF7_004095A18133__INCLUDED_)
#define AFX_BOBVIEW_H__6E36062A_EF0B_11D4_ACF7_004095A18133__INCLUDED_
class DListener;
#define BOUNDS_ALL 0
#define BOUNDS_APEX 1
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class DBobView :
public IGL2DWindow,
public IGL3DWindow
{
public:
DBobView();
virtual ~DBobView();
protected:
vec3_t* path;
int refCount;
public:
bool m_bShowExtra;
int boundingShow;
DListener* eyes;
float fVarGravity;
bool UpdatePath();
char entTarget[256];
char entTrigger[256];
void Begin(const char*, const char*, float, int, float, bool, bool);
bool CalculateTrajectory(vec3_t, vec3_t, float, int, float);
void SetPath(vec3_t* pPath);
void UnRegister();
void Register();
void Draw3D();
void Draw2D(VIEWTYPE vt);
void IncRef() { refCount++; }
void DecRef() { refCount--; if (refCount <= 0) delete this; }
float fMultiplier;
bool m_bHooked;
int nPathCount;
};
#endif // !defined(AFX_BOBVIEW_H__6E36062A_EF0B_11D4_ACF7_004095A18133__INCLUDED_)

867
contrib/bobtoolz/DBrush.cpp Normal file
View file

@ -0,0 +1,867 @@
/*
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
*/
// DBrush.cpp: implementation of the DBrush class.
//
//////////////////////////////////////////////////////////////////////
#include "StdAfx.h"
#ifdef WIN32
#pragma warning(disable : 4786)
#endif
#include "StdAfx.h"
#include "gtkr_list.h"
#include "str.h"
#include "DPoint.h"
#include "DPlane.h"
#include "DBrush.h"
#include "DEPair.h"
#include "DPatch.h"
#include "DEntity.h"
#include "DWinding.h"
#include "dialogs-gtk.h"
#include "misc.h"
#include "iundo.h"
#include "refcounted_ptr.h"
#include "scenelib.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
DBrush::DBrush(int ID)
{
m_nBrushID = ID;
bBoundsBuilt = FALSE;
QER_brush = NULL;
}
DBrush::~DBrush()
{
ClearFaces();
ClearPoints();
}
//////////////////////////////////////////////////////////////////////
// Implementation
//////////////////////////////////////////////////////////////////////
DPlane* DBrush::AddFace(vec3_t va, vec3_t vb, vec3_t vc, _QERFaceData* texData)
{
#ifdef _DEBUG
// Sys_Printf("(%f %f %f) (%f %f %f) (%f %f %f)\n", va[0], va[1], va[2], vb[0], vb[1], vb[2], vc[0], vc[1], vc[2]);
#endif
bBoundsBuilt = FALSE;
DPlane* newFace = new DPlane(va, vb, vc, texData);
faceList.push_back(newFace);
return newFace;
}
int DBrush::BuildPoints()
{
ClearPoints();
if(faceList.size() <= 3) // if less than 3 faces, there can be no points
return 0; // with only 3 faces u can't have a bounded soild
for(list<DPlane *>::const_iterator p1=faceList.begin(); p1!=faceList.end(); p1++)
{
list<DPlane *>::const_iterator p2=p1;
for(p2++; p2!=faceList.end(); p2++)
{
list<DPlane *>::const_iterator p3=p2;
for(p3++; p3!=faceList.end(); p3++)
{
vec3_t pnt;
if((*p1)->PlaneIntersection(*p2, *p3, pnt))
{
int pos = PointPosition(pnt);
if(pos == POINT_IN_BRUSH)
{ // ???? shouldn't happen here
Sys_Printf("ERROR:: Build Brush Points: Point IN brush!!!\n");
}
else if(pos == POINT_ON_BRUSH)
{ // normal point
if(!HasPoint(pnt))
AddPoint(pnt);
/* else
Sys_Printf("Duplicate Point Found, pyramids ahoy!!!!!\n");*/
// point lies on more that 3 planes
}
// otherwise point is removed due to another plane..
// Sys_Printf("(%f, %f, %f)\n", pnt[0], pnt[1], pnt[2]);
}
}
}
}
#ifdef _DEBUG
// Sys_Printf("%i points on brush\n", pointList.size());
#endif
return pointList.size();
}
void DBrush::LoadFromBrush(scene::Node* brush, bool textured)
{
ClearFaces();
ClearPoints();
#if 0
for(int i = g_FuncTable.m_pfnGetFaceCount(brush)-1; i >= 0 ; i--)
{ // running backwards so i dont have to use the count function each time (OPT)
_QERFaceData* faceData = g_FuncTable.m_pfnGetFaceData(brush, i);
if(faceData == NULL)
DoMessageBox("Null pointer returned", "WARNING!", MB_OK);
if(textured)
AddFace(faceData->m_v1, faceData->m_v2, faceData->m_v3, faceData);
else
AddFace(faceData->m_v1, faceData->m_v2, faceData->m_v3, NULL);
}
#endif
QER_brush = brush;
}
int DBrush::PointPosition(vec3_t pnt)
{
int state = POINT_IN_BRUSH; // if nothing happens point is inside brush
for(list<DPlane *>::const_iterator chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++)
{
float dist = (*chkPlane)->DistanceToPoint(pnt);
if(dist > MAX_ROUND_ERROR)
return POINT_OUT_BRUSH; // if point is in front of plane, it CANT be in the brush
else if(fabs(dist) < MAX_ROUND_ERROR)
state = POINT_ON_BRUSH; // if point is ON plane point is either ON the brush
// or outside it, it can no longer be in it
}
return state;
}
void DBrush::ClearPoints()
{
for(list<DPoint *>::const_iterator deadPoint=pointList.begin(); deadPoint!=pointList.end(); deadPoint++) {
delete *deadPoint;
}
pointList.clear();
}
void DBrush::ClearFaces()
{
bBoundsBuilt = FALSE;
for(list<DPlane *>::const_iterator deadPlane=faceList.begin(); deadPlane!=faceList.end(); deadPlane++)
{
delete *deadPlane;
}
faceList.clear();
}
void DBrush::AddPoint(vec3_t pnt)
{
DPoint* newPoint = new DPoint;
VectorCopy(pnt, newPoint->_pnt);
pointList.push_back(newPoint);
}
bool DBrush::HasPoint(vec3_t pnt)
{
for(list<DPoint *>::const_iterator chkPoint=pointList.begin(); chkPoint!=pointList.end(); chkPoint++)
{
if(**chkPoint == pnt)
return TRUE;
}
return FALSE;
}
int DBrush::RemoveRedundantPlanes()
{
int cnt = 0;
list<DPlane *>::iterator chkPlane;
// find duplicate planes
list<DPlane *>::iterator p1=faceList.begin();
while( p1!=faceList.end() )
{
list<DPlane *>::iterator p2 = p1;
for(p2++; p2!=faceList.end(); p2++)
{
if(**p1 == **p2)
{
if(!strcmp((*p1)->texInfo.m_texdef.GetName(), "textures/common/caulk"))
{
delete *p1;
p1 = faceList.erase(p1); // duplicate plane
}
else
{
delete *p2;
p2 = faceList.erase(p2); // duplicate plane
}
cnt++;
break;
}
}
if( p2 == faceList.end() )
p1++;
}
//+djbob kill planes with bad normal, they are more of a nuisance than losing a brush
chkPlane=faceList.begin();
while( chkPlane!=faceList.end() )
{
if(VectorLength((*chkPlane)->normal) == 0) // plane has bad normal
{
delete *chkPlane;
chkPlane = faceList.erase(chkPlane);
cnt++;
} else {
chkPlane++;
}
}
//-djbob
if(pointList.size() == 0) // if points may not have been built, build them
/* if(BuildPoints() == 0) // just let the planes die if they are all bad
return cnt;*/
BuildPoints();
chkPlane=faceList.begin();
while(chkPlane != faceList.end())
{
if((*chkPlane)->IsRedundant(pointList)) // checks that plane "0wnz" :), 3 or more points
{
delete *chkPlane;
chkPlane = faceList.erase(chkPlane);
cnt++;
}
else
chkPlane++;
}
return cnt;
}
bool DBrush::GetBounds(vec3_t min, vec3_t max)
{
BuildBounds();
if(!bBoundsBuilt)
return FALSE;
VectorCopy(bbox_min, min);
VectorCopy(bbox_max, max);
return TRUE;
}
bool DBrush::BBoxCollision(DBrush* chkBrush)
{
vec3_t min1, min2;
vec3_t max1, max2;
GetBounds(min1, max1);
chkBrush->GetBounds(min2, max2);
if(min1[0] >= max2[0])
return FALSE;
if(min1[1] >= max2[1])
return FALSE;
if(min1[2] >= max2[2])
return FALSE;
if(max1[0] <= min2[0])
return FALSE;
if(max1[1] <= min2[1])
return FALSE;
if(max1[2] <= min2[2])
return FALSE;
return TRUE;
}
DPlane* DBrush::HasPlane(DPlane* chkPlane)
{
for(list<DPlane *>::const_iterator brushPlane=faceList.begin(); brushPlane!=faceList.end(); brushPlane++)
{
if(**brushPlane == *chkPlane)
return *brushPlane;
}
return NULL;
}
bool DBrush::IsCutByPlane(DPlane *cuttingPlane)
{
bool isInFront;
if(pointList.size() == 0)
if(BuildPoints() == 0)
return FALSE;
list<DPoint *>::const_iterator chkPnt = pointList.begin();
if(chkPnt == pointList.end())
return FALSE;
float dist = cuttingPlane->DistanceToPoint((*chkPnt)->_pnt);
if(dist > MAX_ROUND_ERROR)
isInFront = FALSE;
else if(dist < MAX_ROUND_ERROR)
isInFront = TRUE;
else
return TRUE;
for(chkPnt++=pointList.begin(); chkPnt!=pointList.end(); chkPnt++)
{
dist = cuttingPlane->DistanceToPoint((*chkPnt)->_pnt);
if(dist > MAX_ROUND_ERROR)
{
if(isInFront)
return TRUE;
}
else if(dist < MAX_ROUND_ERROR)
{
if(!isInFront)
return TRUE;
}
else
return TRUE;
}
return FALSE;
}
scene::Node* DBrush::BuildInRadiant(bool allowDestruction, int* changeCnt, scene::Node* entity)
{
if(allowDestruction)
{
bool kill = TRUE;
for(list<DPlane *>::const_iterator chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++)
{
if((*chkPlane)->m_bChkOk)
{
kill = FALSE;
break;
}
}
if(kill)
return NULL;
}
//+djbob: fixed bug when brush had no faces "phantom brush" in radiant.
if(faceList.size() < 4)
{
Sys_Printf("Possible Phantom Brush Found, will not rebuild\n");
return NULL;
}
//-djbob
NodePtr node(Brush_AllocNode());
for(list<DPlane *>::const_iterator buildPlane=faceList.begin(); buildPlane!=faceList.end(); buildPlane++) {
if((*buildPlane)->AddToBrush(node->m_brush) && changeCnt) {
(*changeCnt)++;
}
}
if(entity) {
entity->m_traverse->insert(node);
} else {
GetWorldspawn()->m_traverse->insert(node);
}
return node;
}
void DBrush::CutByPlane(DPlane *cutPlane, DBrush **newBrush1, DBrush **newBrush2)
{
if(!IsCutByPlane(cutPlane))
{
*newBrush1 = NULL;
*newBrush2 = NULL;
return;
}
DBrush* b1 = new DBrush;
DBrush* b2 = new DBrush;
for(list<DPlane *>::const_iterator parsePlane=faceList.begin(); parsePlane!=faceList.end(); parsePlane++)
{
b1->AddFace((*parsePlane)->points[0], (*parsePlane)->points[1], (*parsePlane)->points[2], NULL);
b2->AddFace((*parsePlane)->points[0], (*parsePlane)->points[1], (*parsePlane)->points[2], NULL);
}
b1->AddFace(cutPlane->points[0], cutPlane->points[1], cutPlane->points[2], NULL);
b2->AddFace(cutPlane->points[2], cutPlane->points[1], cutPlane->points[0], NULL);
b1->RemoveRedundantPlanes();
b2->RemoveRedundantPlanes();
*newBrush1 = b1;
*newBrush2 = b2;
}
bool DBrush::IntersectsWith(DBrush *chkBrush)
{
if(pointList.size() == 0)
if(BuildPoints() == 0)
return FALSE; // invalid brush!!!!
if(chkBrush->pointList.size() == 0)
if(chkBrush->BuildPoints() == 0)
return FALSE; // invalid brush!!!!
if(!BBoxCollision(chkBrush))
return FALSE;
list<DPlane *>::const_iterator iplPlane;
for( iplPlane=faceList.begin(); iplPlane!=faceList.end(); iplPlane++)
{
bool allInFront = TRUE;
for(list<DPoint *>::const_iterator iPoint=chkBrush->pointList.begin(); iPoint!=chkBrush->pointList.end(); iPoint++)
{
if((*iplPlane)->DistanceToPoint((*iPoint)->_pnt) < -MAX_ROUND_ERROR)
{
allInFront = FALSE;
break;
}
}
if(allInFront)
return FALSE;
}
for( iplPlane=chkBrush->faceList.begin(); iplPlane!=chkBrush->faceList.end(); iplPlane++)
{
bool allInFront = TRUE;
for(list<DPoint *>::const_iterator iPoint=pointList.begin(); iPoint!=pointList.end(); iPoint++)
{
if((*iplPlane)->DistanceToPoint((*iPoint)->_pnt) < -MAX_ROUND_ERROR)
{
allInFront = FALSE;
break;
}
}
if(allInFront)
return FALSE;
}
return TRUE;
}
bool DBrush::IntersectsWith(DPlane* p1, DPlane* p2, vec3_t v) {
vec3_t vDown = { 0, 0, -1 };
list<DPlane *>::const_iterator iplPlane;
for( iplPlane = faceList.begin(); iplPlane != faceList.end(); iplPlane++) {
DPlane* p = (*iplPlane);
vec_t d = DotProduct( p->normal, vDown );
if( d >= 0 ) {
continue;
}
if(p->PlaneIntersection(p1, p2, v)) {
if(PointPosition( v ) != POINT_OUT_BRUSH) {
return TRUE;
}
}
}
return FALSE;
}
void DBrush::BuildBounds()
{
if(!bBoundsBuilt)
{
if(pointList.size() == 0) // if points may not have been built, build them
if(BuildPoints() == 0)
return;
list<DPoint *>::const_iterator first = pointList.begin();
VectorCopy((*first)->_pnt, bbox_min);
VectorCopy((*first)->_pnt, bbox_max);
list<DPoint *>::const_iterator point=pointList.begin();
for( point++; point!=pointList.end(); point++)
{
if((*point)->_pnt[0] > bbox_max[0])
bbox_max[0] = (*point)->_pnt[0];
if((*point)->_pnt[1] > bbox_max[1])
bbox_max[1] = (*point)->_pnt[1];
if((*point)->_pnt[2] > bbox_max[2])
bbox_max[2] = (*point)->_pnt[2];
if((*point)->_pnt[0] < bbox_min[0])
bbox_min[0] = (*point)->_pnt[0];
if((*point)->_pnt[1] < bbox_min[1])
bbox_min[1] = (*point)->_pnt[1];
if((*point)->_pnt[2] < bbox_min[2])
bbox_min[2] = (*point)->_pnt[2];
}
bBoundsBuilt = TRUE;
}
}
bool DBrush::BBoxTouch(DBrush *chkBrush)
{
vec3_t min1, min2;
vec3_t max1, max2;
GetBounds(min1, max1);
chkBrush->GetBounds(min2, max2);
if((min1[0] - max2[0]) > MAX_ROUND_ERROR)
return FALSE;
if((min1[1] - max2[1]) > MAX_ROUND_ERROR)
return FALSE;
if((min1[2] - max2[2]) > MAX_ROUND_ERROR)
return FALSE;
if((min2[0] - max1[0]) > MAX_ROUND_ERROR)
return FALSE;
if((min2[1] - max1[1]) > MAX_ROUND_ERROR)
return FALSE;
if((min2[2] - max1[2]) > MAX_ROUND_ERROR)
return FALSE;
int cnt = 0;
if((min2[0] - max1[0]) == 0)
cnt++;
if((min2[1] - max1[1]) == 0)
cnt++;
if((min2[2] - max1[2]) == 0)
cnt++;
if((min1[0] - max2[0]) == 0)
cnt++;
if((min1[1] - max2[1]) == 0)
cnt++;
if((min1[2] - max2[2]) == 0)
cnt++;
if(cnt > 1)
return FALSE;
return TRUE;
}
void DBrush::ResetChecks(list<Str>* exclusionList)
{
for(list<DPlane *>::const_iterator resetPlane=faceList.begin(); resetPlane!=faceList.end(); resetPlane++)
{
bool set = FALSE;
if(exclusionList)
{
for(list<Str>::iterator eTexture = exclusionList->begin(); eTexture != exclusionList->end(); eTexture++)
{
if(strstr((*resetPlane)->texInfo.m_texdef.GetName(), eTexture->GetBuffer()))
{
set = TRUE;
break;
}
}
}
(*resetPlane)->m_bChkOk = set;
}
}
DPlane* DBrush::HasPlaneInverted(DPlane *chkPlane)
{
for(list<DPlane *>::const_iterator brushPlane=faceList.begin(); brushPlane!=faceList.end(); brushPlane++)
{
if(**brushPlane != *chkPlane)
{
if(fabs((*brushPlane)->_d + chkPlane->_d) < 0.1)
return (*brushPlane);
}
}
return NULL;
}
bool DBrush::HasTexture(const char *textureName)
{
for(list<DPlane *>::const_iterator chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++)
{
if(strstr((*chkPlane)->texInfo.m_texdef.GetName(), textureName))
return TRUE;
}
return FALSE;
}
bool DBrush::IsDetail()
{
for(list<DPlane *>::const_iterator chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++)
{
if((*chkPlane)->texInfo.m_texdef.contents & FACE_DETAIL)
return TRUE;
}
return FALSE;
}
void DBrush::BuildFromWinding(DWinding *w)
{
if(w->numpoints < 3)
{
Sys_ERROR("Winding has invalid number of points");
return;
}
DPlane* wPlane = w->WindingPlane();
DWinding* w2;
w2 = w->CopyWinding();
int i;
for(i = 0; i < w2->numpoints; i++)
VectorAdd(w2->p[i], wPlane->normal, w2->p[i]);
AddFace(w2->p[0], w2->p[1], w2->p[2], NULL);
AddFace(w->p[2], w->p[1], w->p[0], NULL);
for(i = 0; i < w->numpoints-1; i++)
AddFace(w2->p[i], w->p[i], w->p[i+1], NULL);
AddFace(w2->p[w->numpoints-1], w->p[w->numpoints-1], w->p[0], NULL);
delete wPlane;
delete w2;
}
void DBrush::SaveToFile(FILE *pFile)
{
fprintf(pFile, "{\n");
for(list<DPlane *>::const_iterator pp=faceList.begin(); pp!=faceList.end(); pp++)
{
char buffer[512];
sprintf(buffer, "( %.0f %.0f %.0f ) ( %.0f %.0f %.0f ) ( %.0f %.0f %.0f ) %s %.0f %.0f %f %f %.0f 0 0 0\n",
(*pp)->points[0][0], (*pp)->points[0][1], (*pp)->points[0][2],
(*pp)->points[1][0], (*pp)->points[1][1], (*pp)->points[1][2],
(*pp)->points[2][0], (*pp)->points[2][1], (*pp)->points[2][2],
(*pp)->texInfo.m_texdef.GetName(),
(*pp)->texInfo.m_texdef.shift[0], (*pp)->texInfo.m_texdef.shift[1],
(*pp)->texInfo.m_texdef.scale[0], (*pp)->texInfo.m_texdef.scale[0],
(*pp)->texInfo.m_texdef.rotate);
fprintf(pFile, buffer);
}
fprintf(pFile, "}\n");
}
void DBrush::Rotate(vec3_t vOrigin, vec3_t vRotation)
{
for(list<DPlane *>::const_iterator rotPlane=faceList.begin(); rotPlane!=faceList.end(); rotPlane++)
{
for(int i = 0; i < 3; i++)
VectorRotate((*rotPlane)->points[i], vRotation, vOrigin);
(*rotPlane)->Rebuild();
}
}
void DBrush::RotateAboutCentre(vec3_t vRotation)
{
vec3_t min, max, centre;
GetBounds(min, max);
VectorAdd(min, max, centre);
VectorScale(centre, 0.5f, centre);
Rotate(centre, vRotation);
}
bool DBrush::ResetTextures(const char* textureName, float fScale[2], float fShift[2], int rotation, const char* newTextureName,
int bResetTextureName, int bResetScale[2], int bResetShift[2], int bResetRotation)
{
if(textureName)
{
bool changed = FALSE;
for(list<DPlane *>::const_iterator resetPlane=faceList.begin(); resetPlane!=faceList.end(); resetPlane++)
{
if(!strcmp((*resetPlane)->texInfo.m_texdef.GetName(), textureName))
{
if(bResetTextureName)
(*resetPlane)->texInfo.m_texdef.SetName(newTextureName);
if(bResetScale[0])
(*resetPlane)->texInfo.m_texdef.scale[0] = fScale[0];
if(bResetScale[1])
(*resetPlane)->texInfo.m_texdef.scale[1] = fScale[1];
if(bResetShift[0])
(*resetPlane)->texInfo.m_texdef.shift[0] = fShift[0];
if(bResetShift[1])
(*resetPlane)->texInfo.m_texdef.shift[1] = fShift[1];
if(bResetRotation)
(*resetPlane)->texInfo.m_texdef.rotate = (float)rotation;
changed = TRUE;
}
}
return changed; // no point rebuilding unless we need to, only slows things down
}
else
{
for(list<DPlane *>::const_iterator resetPlane=faceList.begin(); resetPlane!=faceList.end(); resetPlane++)
{
if(bResetTextureName)
(*resetPlane)->texInfo.m_texdef.SetName(newTextureName);
if(bResetScale[0])
(*resetPlane)->texInfo.m_texdef.scale[0] = fScale[0];
if(bResetScale[1])
(*resetPlane)->texInfo.m_texdef.scale[1] = fScale[1];
if(bResetShift[0])
(*resetPlane)->texInfo.m_texdef.shift[0] = fShift[0];
if(bResetShift[1])
(*resetPlane)->texInfo.m_texdef.shift[1] = fShift[1];
if(bResetRotation)
(*resetPlane)->texInfo.m_texdef.rotate = (float)rotation;
}
return TRUE;
}
}
bool DBrush::operator ==(DBrush* other)
{
list<DPlane *>::const_iterator chkPlane;
for(chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++)
{
if(!other->HasPlane((*chkPlane)))
return FALSE;
}
for(chkPlane=faceList.begin(); chkPlane!=faceList.end(); chkPlane++)
{
if(!HasPlane((*chkPlane)))
return FALSE;
}
return TRUE;
}
DPlane* DBrush::AddFace(vec3_t va, vec3_t vb, vec3_t vc, const char *textureName, bool bDetail)
{
bBoundsBuilt = FALSE;
DPlane* newFace = new DPlane(va, vb, vc, textureName, bDetail);
faceList.push_back(newFace);
return newFace;
}
DPlane* DBrush::FindPlaneWithClosestNormal( vec_t* normal ) {
vec_t bestDot = -2;
DPlane* bestDotPlane = NULL;
list<DPlane *>::const_iterator chkPlane;
for( chkPlane = faceList.begin(); chkPlane != faceList.end(); chkPlane++ ) {
DPlane* pPlane = (*chkPlane);
vec_t dot = DotProduct( pPlane->normal, normal );
if( dot > bestDot ) {
bestDot = dot;
bestDotPlane = pPlane;
}
}
return bestDotPlane;
}
int DBrush::FindPointsForPlane( DPlane* plane, DPoint** pnts, int maxpnts ) {
int numpnts = 0;
if(!maxpnts) {
return 0;
}
BuildPoints();
for( list<DPoint *>::const_iterator points = pointList.begin(); points != pointList.end(); points++ ) {
DPoint* point = (*points);
if( fabs(plane->DistanceToPoint( point->_pnt )) < MAX_ROUND_ERROR ) {
pnts[numpnts] = point;
numpnts++;
if(numpnts >= maxpnts) {
return numpnts;
}
}
}
return numpnts;
}
void DBrush::RemovePlane( DPlane* plane ) {
bBoundsBuilt = FALSE;
for( list<DPlane *>::const_iterator deadPlane = faceList.begin(); deadPlane != faceList.end(); deadPlane++ ) {
if(*deadPlane == plane) {
delete *deadPlane;
faceList.remove( plane );
}
}
}
void DBrush::RemoveFromRadiant( void ) {
if(QER_brush) {
#if 0
g_FuncTable.m_pfnDeleteBrushHandle(QER_brush);
#endif
}
}

99
contrib/bobtoolz/DBrush.h Normal file
View file

@ -0,0 +1,99 @@
/*
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
*/
// DBrush.h: interface for the DBrush class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_DBRUSH_H__35B2C522_F0A7_11D4_ACF7_004095A18133__INCLUDED_)
#define AFX_DBRUSH_H__35B2C522_F0A7_11D4_ACF7_004095A18133__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define POINT_IN_BRUSH 0
#define POINT_ON_BRUSH 1
#define POINT_OUT_BRUSH 2
class DBrush
{
public:
DPlane* AddFace(vec3_t va, vec3_t vb, vec3_t vc, const char* textureName, bool bDetail);
void SaveToFile(FILE* pFile);
void Rotate(vec3_t vOrigin, vec3_t vRotation);
void RotateAboutCentre(vec3_t vRotation);
DPlane* HasPlaneInverted(DPlane* chkPlane);
DPlane* HasPlane(DPlane* chkPlane);
DPlane* AddFace(vec3_t va, vec3_t vb, vec3_t vc, _QERFaceData* texData);
bool ResetTextures(const char* textureName, float fScale[2], float fShift[2], int rotation, const char* newTextureName, int bResetTextureName, int bResetScale[2], int bResetShift[2], int bResetRotation);
bool IsDetail();
bool HasTexture(const char* textureName);
bool IntersectsWith(DBrush *chkBrush);
bool IntersectsWith(DPlane* p1, DPlane* p2, vec3_t v);
bool IsCutByPlane(DPlane* cuttingPlane);
bool GetBounds(vec3_t min, vec3_t max);
bool HasPoint(vec3_t pnt);
bool BBoxCollision(DBrush* chkBrush);
bool BBoxTouch(DBrush* chkBrush);
int BuildPoints();
void BuildBounds();
void BuildFromWinding(DWinding* w);
scene::Node* BuildInRadiant(bool allowDestruction, int* changeCnt, scene::Node* entity = NULL);
void ResetChecks(list<Str>* exclusionList);
void ClearFaces();
void ClearPoints();
int RemoveRedundantPlanes( void );
void RemovePlane( DPlane* plane );
int PointPosition(vec3_t pnt);
void RemoveFromRadiant( void );
void CutByPlane(DPlane* cutPlane, DBrush** newBrush1, DBrush** newBrush2);
void LoadFromBrush(scene::Node* brush, bool textured);
void AddPoint(vec3_t pnt);
DPlane* FindPlaneWithClosestNormal( vec_t* normal );
int FindPointsForPlane( DPlane* plane, DPoint** pnts, int maxpnts );
DBrush(int ID = -1);
virtual ~DBrush();
bool operator== (DBrush* other);
// members
scene::Node* QER_brush;
list<DPlane*> faceList;
list<DPoint*> pointList;
int m_nBrushID;
vec3_t bbox_min, bbox_max;
bool bBoundsBuilt;
};
//typedef CList<DBrush*, DBrush*> DBrushList;
#endif // !defined(AFX_DBRUSH_H__35B2C522_F0A7_11D4_ACF7_004095A18133__INCLUDED_)

View file

@ -0,0 +1,50 @@
/*
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
*/
// DEPair.cpp: implementation of the DEPair class.
//
//////////////////////////////////////////////////////////////////////
#include "StdAfx.h"
#include "str.h"
#include "DEPair.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
DEPair::DEPair()
{
}
DEPair::~DEPair()
{
}
//////////////////////////////////////////////////////////////////////
// Implementation
//////////////////////////////////////////////////////////////////////
void DEPair::Build(const char *pKey, const char *pValue)
{
key = pKey;
value = pValue;
}

45
contrib/bobtoolz/DEPair.h Normal file
View file

@ -0,0 +1,45 @@
/*
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
*/
// DEPair.h: interface for the DEPair class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_DEPAIR_H__35B2C521_F0A7_11D4_ACF7_004095A18133__INCLUDED_)
#define AFX_DEPAIR_H__35B2C521_F0A7_11D4_ACF7_004095A18133__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class DEPair
{
public:
DEPair();
virtual ~DEPair();
void Build(const char* pKey, const char* pValue);
Str key;
Str value;
};
//typedef CList<DEPair*, DEPair*> DEPairList;
#endif // !defined(AFX_DEPAIR_H__35B2C521_F0A7_11D4_ACF7_004095A18133__INCLUDED_)

View file

@ -0,0 +1,667 @@
/*
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
*/
// DEntity.cpp: implementation of the DEntity class.
//
//////////////////////////////////////////////////////////////////////
#ifdef WIN32
#pragma warning(disable : 4786)
#endif
#include "StdAfx.h"
#include "gtkr_list.h"
#include "str.h"
#include "DPoint.h"
#include "DPlane.h"
#include "DBrush.h"
#include "DEPair.h"
#include "DPatch.h"
#include "DEntity.h"
#include "dialogs-gtk.h"
#include "misc.h"
#include "CPortals.h"
#include "iundo.h"
#include "refcounted_ptr.h"
#include <vector>
#include <list>
#include <map>
#include <algorithm>
#include "scenelib.h"
const char* brushEntityList[] = {
"worldspawn",
"trigger_always",
"trigger_hurt",
"trigger_multiple",
"trigger_push",
"trigger_teleport",
"func_bobbing",
"func_button",
"func_door",
"func_group",
"func_pendulum",
"func_plat",
"func_rotating",
"func_static",
"func_timer",
"func_train",
0
};
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
DEntity::DEntity(const char *classname, int ID)
{
SetClassname(classname);
m_nID = ID;
QER_Entity = NULL;
}
DEntity::~DEntity()
{
ClearPatches();
ClearBrushes();
ClearEPairs();
}
//////////////////////////////////////////////////////////////////////
// Implementation
//////////////////////////////////////////////////////////////////////
void DEntity::ClearBrushes()
{
for(list<DBrush *>::const_iterator deadBrush=brushList.begin(); deadBrush!=brushList.end(); deadBrush++)
{
delete *deadBrush;
}
brushList.clear();
}
void DEntity::ClearPatches()
{
for(list<DPatch *>::const_iterator deadPatch=patchList.begin(); deadPatch!=patchList.end(); deadPatch++)
{
delete *deadPatch;
}
patchList.clear();
}
DPatch* DEntity::NewPatch()
{
DPatch* newPatch = new DPatch;
patchList.push_back(newPatch);
return newPatch;
}
DBrush* DEntity::NewBrush(int ID)
{
DBrush* newBrush = new DBrush(ID);
brushList.push_back(newBrush);
return newBrush;
}
char* getNextBracket(char* s)
{
char* p = s;
while(*p)
{
p++;
if(*p == '(')
break;
}
return p;
}
bool DEntity::LoadFromPrt(char *filename)
{
CPortals portals;
strcpy(portals.fn, filename);
portals.Load();
if(portals.node_count == 0)
return FALSE;
ClearBrushes();
ClearEPairs();
bool build = false;
for(unsigned int i = 0; i < portals.node_count; i++)
{
build = false;
DBrush* brush = NewBrush();
for(unsigned int j = 0; j < portals.node[i].portal_count; j++)
{
for(unsigned int k = 0; k < portals.node[i].portal[j].point_count-2; k++)
{
vec3_t v1, v2, normal, n;
VectorSubtract(portals.node[i].portal[j].point[k+2].p, portals.node[i].portal[j].point[k+1].p, v1);
VectorSubtract(portals.node[i].portal[j].point[k].p, portals.node[i].portal[j].point[k+1].p, v2);
CrossProduct(v1, v2, n);
VectorNormalize(n, v2);
if(k == 0)
{
VectorCopy(v2, normal);
}
else
{
VectorSubtract(v2, normal, v1);
if(VectorLength(v1) > 0.01)
{
build = true;
break;
}
}
}
if(!build)
brush->AddFace(portals.node[i].portal[j].point[2].p, portals.node[i].portal[j].point[1].p, portals.node[i].portal[j].point[0].p, "textures/common/caulk", FALSE);
else
brush->AddFace(portals.node[i].portal[j].point[0].p, portals.node[i].portal[j].point[1].p, portals.node[i].portal[j].point[2].p, "textures/common/caulk", FALSE);
}
if(build)
brush->BuildInRadiant(FALSE, NULL);
}
return TRUE;
}
DPlane* DEntity::AddFaceToBrush(vec3_t va, vec3_t vb, vec3_t vc, _QERFaceData* faceData, int ID)
{
DBrush* buildBrush = GetBrushForID(ID);
return buildBrush->AddFace(va, vb, vc, faceData);
// slow, dont use much
}
DBrush* DEntity::GetBrushForID(int ID)
{
DBrush* buildBrush = NULL;
for(list<DBrush *>::const_iterator chkBrush=brushList.begin(); chkBrush!=brushList.end(); chkBrush++)
{
if((*chkBrush)->m_nBrushID == ID)
{
buildBrush = (*chkBrush);
break;
}
}
if(!buildBrush)
buildBrush = NewBrush(ID);
return buildBrush;
}
void DEntity::LoadSelectedBrushes()
{
ClearBrushes();
ClearEPairs();
#if 0
int count = g_FuncTable.m_pfnAllocateSelectedBrushHandles();
for(int i = 0; i < count; i++) {
brush_t *brush = (brush_t*)g_FuncTable.m_pfnGetSelectedBrushHandle(i);
if(brush->patchBrush)
continue;
DBrush* loadBrush = NewBrush(i);
loadBrush->LoadFromBrush_t(brush, TRUE);
}
g_FuncTable.m_pfnReleaseSelectedBrushHandles();
#endif
}
void DEntity::LoadSelectedPatches()
{
ClearPatches();
ClearEPairs();
#if 0
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();
#endif
}
bool* DEntity::BuildIntersectList()
{
int max = GetIDMax();
if(max == 0)
return NULL;
bool* pbIntList = new bool[max];
memset(pbIntList, 0, sizeof(bool)*(max));
for(list<DBrush *>::const_iterator pB1=brushList.begin(); pB1!=brushList.end(); pB1++)
{
list<DBrush *>::const_iterator pB2=pB1;
for(pB2++; pB2!=brushList.end(); pB2++)
{
if((*pB1)->IntersectsWith((*pB2)))
{
pbIntList[(*pB1)->m_nBrushID] = TRUE;
pbIntList[(*pB2)->m_nBrushID] = TRUE;
}
}
}
return pbIntList;
}
bool* DEntity::BuildDuplicateList()
{
int max = GetIDMax();
if(max == 0)
return NULL;
bool* pbDupList = new bool[max];
memset(pbDupList, 0, sizeof(bool)*(max));
for(list<DBrush *>::const_iterator pB1=brushList.begin(); pB1!=brushList.end(); pB1++)
{
list<DBrush *>::const_iterator pB2=pB1;
for(pB2++; pB2!=brushList.end(); pB2++)
{
if(**pB1 == *pB2)
{
pbDupList[(*pB1)->m_nBrushID] = TRUE;
pbDupList[(*pB2)->m_nBrushID] = TRUE;
}
}
}
return pbDupList;
}
void DEntity::SelectBrushes(bool *selectList)
{
if(selectList == NULL)
return;
GlobalSelectionSystem().Select(false);
scene::Path path(GlobalSceneGraph().root());
path.push(QER_Entity);
for(std::list<DBrush *>::const_iterator pBrush=brushList.begin(); pBrush!=brushList.end(); pBrush++)
{
if(selectList[(*pBrush)->m_nBrushID])
{
path.push((*pBrush)->QER_brush);
GlobalSceneGraph().find(path)->selectable()->select(true);
path.pop();
}
}
}
bool DEntity::LoadFromEntity(scene::Node* ent, bool bLoadPatches) {
ClearPatches();
ClearBrushes();
ClearEPairs();
QER_Entity = ent;
LoadEPairList(ent->m_entity);
bool keep = FALSE;
int i;
for(i = 0; brushEntityList[i]; i++)
{
if(!stricmp(brushEntityList[i], m_Classname))
{
keep = TRUE;
break;
}
}
if(!keep)
return FALSE;
if(ent->m_traverse)
{
class load_brushes_t : public scene::Traversable::Walker
{
DEntity* m_entity;
int m_count;
public:
load_brushes_t(DEntity* entity)
: m_entity(entity), m_count(0)
{
}
bool pre(scene::Node* node)
{
if(node->m_brush)
{
DPatch* loadPatch = m_entity->NewPatch();
loadPatch->LoadFromBrush(node);
}
else if(node->m_patch)
{
DBrush* loadBrush = m_entity->NewBrush(m_count++);
loadBrush->LoadFromBrush(node, TRUE);
}
return false;
}
void post(scene::Node* node)
{
}
} load_brushes(this);
ent->m_traverse->traverse(load_brushes);
}
return TRUE;
}
void DEntity::RemoveNonCheckBrushes(list<Str>* exclusionList, bool useDetail)
{
list<DBrush *>::iterator chkBrush=brushList.begin();
while( chkBrush!=brushList.end() )
{
if(!useDetail)
{
if((*chkBrush)->IsDetail())
{
delete *chkBrush;
chkBrush = brushList.erase(chkBrush);
continue;
}
}
list<Str>::iterator eTexture;
for( eTexture=exclusionList->begin(); eTexture!=exclusionList->end(); eTexture++ )
{
if((*chkBrush)->HasTexture((*eTexture).GetBuffer()))
{
delete *chkBrush;
chkBrush = brushList.erase(chkBrush);
break;
}
}
if( eTexture == exclusionList->end() )
chkBrush++;
}
}
void DEntity::ResetChecks(list<Str>* exclusionList)
{
for(list<DBrush *>::const_iterator resetBrush=brushList.begin(); resetBrush!=brushList.end(); resetBrush++)
{
(*resetBrush)->ResetChecks(exclusionList);
}
}
int DEntity::FixBrushes()
{
int count = 0;
for(list<DBrush *>::const_iterator fixBrush=brushList.begin(); fixBrush!=brushList.end(); fixBrush++)
{
count += (*fixBrush)->RemoveRedundantPlanes();
}
return count;
}
void DEntity::BuildInRadiant(bool allowDestruction)
{
bool makeEntity = strcmp(m_Classname, "worldspawn") ? true : false;
if(makeEntity)
{
NodePtr node(GlobalEntityCreator().createEntity(m_Classname.GetBuffer()));
for(list<DEPair* >::const_iterator buildEPair=epairList.begin(); buildEPair!=epairList.end(); buildEPair++)
{
node->m_entity->setkeyvalue((*buildEPair)->key, (*buildEPair)->value);
}
GlobalSceneGraph().root()->m_traverse->insert(node);
for(list<DBrush *>::const_iterator buildBrush=brushList.begin(); buildBrush!=brushList.end(); buildBrush++)
(*buildBrush)->BuildInRadiant(allowDestruction, NULL, node);
for(list<DPatch *>::const_iterator buildPatch=patchList.begin(); buildPatch!=patchList.end(); buildPatch++)
(*buildPatch)->BuildInRadiant(node);
QER_Entity = node;
}
else
{
for(list<DBrush *>::const_iterator buildBrush=brushList.begin(); buildBrush!=brushList.end(); buildBrush++)
(*buildBrush)->BuildInRadiant(allowDestruction, NULL);
for(list<DPatch *>::const_iterator buildPatch=patchList.begin(); buildPatch!=patchList.end(); buildPatch++)
(*buildPatch)->BuildInRadiant();
}
}
int DEntity::GetIDMax( void ) {
int max = -1;
for(list<DBrush *>::const_iterator cntBrush=brushList.begin(); cntBrush!=brushList.end(); cntBrush++) {
if((*cntBrush)->m_nBrushID > max)
max = (*cntBrush)->m_nBrushID;
}
return max+1;
}
void DEntity::SetClassname( const char *classname ) {
m_Classname = classname;
}
void DEntity::SaveToFile(FILE *pFile)
{
fprintf(pFile, "{\n");
fprintf(pFile, "\"classname\" \"%s\"\n", (const char *)m_Classname);
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);
}
for(list<DBrush *>::const_iterator bp=brushList.begin(); bp!=brushList.end(); bp++)
{
(*bp)->SaveToFile(pFile);
}
fprintf(pFile, "}\n");
}
void DEntity::ClearEPairs()
{
for(list<DEPair *>::const_iterator deadEPair=epairList.begin(); deadEPair!=epairList.end(); deadEPair++)
{
delete (*deadEPair);
}
epairList.clear();
}
void DEntity::AddEPair(const char *key, const char *value) {
DEPair* newEPair;
newEPair = FindEPairByKey( key );
if(!newEPair) {
newEPair = new DEPair;
newEPair->Build(key, value);
epairList.push_back(newEPair);
} else {
newEPair->Build(key, value);
}
}
void DEntity::LoadEPairList(Entity *epl)
{
class load_epairs_t : public Entity::Visitor
{
DEntity* m_entity;
public:
load_epairs_t(DEntity* entity)
: m_entity(entity)
{
}
void visit(const char* key, const char* value)
{
if(strcmp(key, "classname") == 0)
m_entity->SetClassname(value);
else
m_entity->AddEPair(key, value);
}
} load_epairs(this);
epl->accept(load_epairs);
}
bool DEntity::ResetTextures(const char* textureName, float fScale[2], float fShift[2], int rotation, const char* newTextureName,
int bResetTextureName, int bResetScale[2], int bResetShift[2], int bResetRotation, bool rebuild)
{
bool reset = FALSE;
for(list<DBrush *>::const_iterator resetBrush=brushList.begin(); resetBrush!=brushList.end(); resetBrush++)
{
bool tmp = (*resetBrush)->ResetTextures(textureName, fScale, fShift, rotation, newTextureName,
bResetTextureName, bResetScale, bResetShift, bResetRotation);
if(tmp)
{
reset = TRUE;
}
}
if(bResetTextureName)
{
for(list<DPatch *>::const_iterator resetPatch=patchList.begin(); resetPatch!=patchList.end(); resetPatch++)
{
bool tmp = (*resetPatch)->ResetTextures(textureName, newTextureName);
if(tmp)
{
reset = TRUE;
}
}
}
return reset;
}
DEPair* DEntity::FindEPairByKey(const char* keyname)
{
for(list<DEPair *>::const_iterator ep=epairList.begin(); ep!=epairList.end(); ep++)
{
char* c = (*ep)->key;
if(!strcmp(c, keyname))
return *ep;
}
return NULL;
}
void DEntity::RemoveFromRadiant()
{
GlobalSceneGraph().root()->m_traverse->erase(QER_Entity);
QER_Entity = NULL;
}
void DEntity::SpawnString(const char* key, const char* defaultstring, const char** out)
{
DEPair* pEP = FindEPairByKey(key);
if(pEP) {
*out = pEP->value;
} else {
*out = defaultstring;
}
}
void DEntity::SpawnInt(const char* key, const char* defaultstring, int* out)
{
DEPair* pEP = FindEPairByKey(key);
if(pEP) {
*out = atoi(pEP->value);
} else {
*out = atoi(defaultstring);
}
}
void DEntity::SpawnFloat(const char* key, const char* defaultstring, float* out)
{
DEPair* pEP = FindEPairByKey(key);
if(pEP) {
*out = static_cast<float>(atof(pEP->value));
} else {
*out = static_cast<float>(atof(defaultstring));
}
}
void DEntity::SpawnVector(const char* key, const char* defaultstring, vec_t* out)
{
DEPair* pEP = FindEPairByKey(key);
if(pEP) {
sscanf(pEP->value, "%f %f %f", &out[0], &out[1], &out[2]);
} else {
sscanf(defaultstring, "%f %f %f", &out[0], &out[1], &out[2]);
}
}
int DEntity::GetBrushCount( void ) {
return brushList.size();
}
DBrush* DEntity::FindBrushByPointer( scene::Node* brush ) {
for(list<DBrush *>::const_iterator listBrush = brushList.begin(); listBrush != brushList.end(); listBrush++) {
DBrush* pBrush = (*listBrush);
if(pBrush->QER_brush == brush) {
return pBrush;
}
}
return NULL;
}

109
contrib/bobtoolz/DEntity.h Normal file
View file

@ -0,0 +1,109 @@
/*
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
*/
// DEntity.h: interface for the DEntity class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_DENTITY_H__35B2C523_F0A7_11D4_ACF7_004095A18133__INCLUDED_)
#define AFX_DENTITY_H__35B2C523_F0A7_11D4_ACF7_004095A18133__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class DEntity
{
public:
void RemoveFromRadiant();
scene::Node* QER_Entity;
int m_nID;
// Constrcution/Destruction
DEntity(const char* classname = "worldspawn", int ID = -1); // sets classname
virtual ~DEntity();
// ---------------------------------------------
// epair functions........
void LoadEPairList(Entity* epl);
void AddEPair(const char* key, const char* value);
void ClearEPairs();
DEPair* FindEPairByKey(const char* keyname);
// ---------------------------------------------
// random functions........
bool ResetTextures(const char* textureName, float fScale[2], float fShift[2], int rotation, const char* newTextureName, int bResetTextureName, int bResetScale[2], int bResetShift[2], int bResetRotation, bool rebuild);
void SaveToFile(FILE* pFile);
void SetClassname(const char* classname);
int GetIDMax();
void BuildInRadiant(bool allowDestruction);
void ResetChecks(list<Str>* exclusionList);
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
int GetBrushCount( void );
DBrush* FindBrushByPointer( scene::Node* brush );
// ---------------------------------------------
// bool list functions
void SelectBrushes(bool* selectList);
bool* BuildDuplicateList();
bool* BuildIntersectList();
// ---------------------------------------------
// brush operations
void ClearBrushes(); // clears brush list and frees memory for brushes
DBrush* GetBrushForID(int ID);
DBrush* NewBrush(int ID = -1);
// ---------------------------------------------
// patch operations
void ClearPatches();
DPatch* NewPatch();
// ---------------------------------------------
// vars
list<DEPair*> epairList;
list<DBrush*> brushList;
// new patches, wahey!!!
list<DPatch*> patchList;
Str m_Classname;
// ---------------------------------------------
int FixBrushes();
bool LoadFromEntity(scene::Node* ent, bool bLoadPatches = FALSE);
void LoadSelectedBrushes();
void LoadSelectedPatches();
bool LoadFromPrt(char* filename);
// ---------------------------------------------
void SpawnString(const char* key, const char* defaultstring, const char** out);
void SpawnInt(const char* key, const char* defaultstring, int* out);
void SpawnFloat(const char* key, const char* defaultstring, float* out);
void SpawnVector(const char* key, const char* defaultstring, vec_t* out);
};
#endif // !defined(AFX_DENTITY_H__35B2C523_F0A7_11D4_ACF7_004095A18133__INCLUDED_)

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(unsigned int nFlags, double x, double y)
{
if(!parent->UpdatePath())
delete parent;
return FALSE;
}
bool DListener::OnLButtonDown(unsigned int nFlags, double x, double y)
{
return FALSE;
}
bool DListener::OnLButtonUp(unsigned int nFlags, double x, double y)
{
return FALSE;
}
bool DListener::OnRButtonDown(unsigned int nFlags, double x, double y)
{
return FALSE;
}
bool DListener::OnRButtonUp(unsigned int nFlags, double x, double y)
{
return FALSE;
}
bool DListener::OnMButtonDown(unsigned int nFlags, double x, double y)
{
return FALSE;
}
bool DListener::OnMButtonUp(unsigned int nFlags, double x, double 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_)

182
contrib/bobtoolz/DMap.cpp Normal file
View file

@ -0,0 +1,182 @@
/*
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
*/
// DMap.cpp: implementation of the DMap class.
//
//////////////////////////////////////////////////////////////////////
#include "StdAfx.h"
#include "str.h"
#include "gtkr_list.h"
#include "DPoint.h"
#include "DPlane.h"
#include "DBrush.h"
#include "DEPair.h"
#include "DPatch.h"
#include "DEntity.h"
#include "DMap.h"
#include "iundo.h"
#include "refcounted_ptr.h"
#include <vector>
#include <list>
#include <map>
#include <algorithm>
#include "scenelib.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
DMap::DMap()
{
m_nNextEntity = 1;
AddEntity("worldspawn", 0);
}
DMap::~DMap()
{
ClearEntities();
}
DEntity* DMap::AddEntity(char *classname, int ID)
{
DEntity* newEntity;
if(ID == -1)
newEntity = new DEntity(classname, m_nNextEntity++);
else
newEntity = new DEntity(classname, ID);
entityList.push_back(newEntity);
return newEntity;
}
void DMap::ClearEntities()
{
m_nNextEntity = 1;
for(list<DEntity *>::const_iterator deadEntity=entityList.begin(); deadEntity!=entityList.end(); deadEntity++)
delete *deadEntity;
entityList.clear();
}
DEntity* DMap::GetEntityForID(int ID)
{
DEntity* findEntity = NULL;
for(list<DEntity *>::const_iterator chkEntity=entityList.begin(); chkEntity!=entityList.end(); chkEntity++)
{
if((*chkEntity)->m_nID == ID)
{
findEntity = (*chkEntity);
break;
}
}
if(!findEntity)
findEntity = AddEntity("worldspawn", ID);
return findEntity;
}
DEntity* DMap::GetWorldSpawn()
{
return GetEntityForID(0);
}
void DMap::BuildInRadiant(bool bAllowDestruction)
{
for(list<DEntity *>::const_iterator buildEntity=entityList.begin(); buildEntity!=entityList.end(); buildEntity++)
(*buildEntity)->BuildInRadiant(bAllowDestruction);
}
void DMap::LoadAll(bool bLoadPatches)
{
ClearEntities();
GlobalSelectionSystem().Select(false);
class load_entities_t : public scene::Traversable::Walker
{
DMap* m_map;
bool m_bLoadPatches;
public:
load_entities_t(DMap* map, bool bLoadPatches)
: m_map(map), m_bLoadPatches(bLoadPatches)
{
}
bool pre(scene::Node* node)
{
if(node->m_entity)
{
DEntity* loadEntity = m_map->AddEntity("", 0);
loadEntity->LoadFromEntity(node, m_bLoadPatches);
}
return false;
}
void post(scene::Node* node)
{
}
} load_entities(this, bLoadPatches);
GlobalSceneGraph().root()->m_traverse->traverse(load_entities);
}
int DMap::FixBrushes()
{
int count = 0;
for(list<DEntity *>::const_iterator fixEntity=entityList.begin(); fixEntity!=entityList.end(); fixEntity++)
{
count += (*fixEntity)->FixBrushes();
}
return count;
}
void DMap::ResetTextures( const char* textureName, float fScale[2], float fShift[2], int rotation, const char* newTextureName,
int bResetTextureName, int bResetScale[2], int bResetShift[2], int bResetRotation)
{
for(list<DEntity *>::const_iterator texEntity=entityList.begin(); texEntity!=entityList.end(); texEntity++)
{
if(!stricmp("worldspawn", (*texEntity)->m_Classname))
(*texEntity)->ResetTextures(textureName, fScale, fShift, rotation, newTextureName,
bResetTextureName, bResetScale, bResetShift, bResetRotation, TRUE);
else
{
if((*texEntity)->ResetTextures( textureName, fScale, fShift, rotation, newTextureName,
bResetTextureName, bResetScale, bResetShift, bResetRotation, FALSE))
RebuildEntity(*texEntity);
}
}
}
void DMap::RebuildEntity(DEntity *ent)
{
ent->RemoveFromRadiant();
ent->BuildInRadiant(FALSE);
}

54
contrib/bobtoolz/DMap.h Normal file
View file

@ -0,0 +1,54 @@
/*
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
*/
// DMap.h: interface for the DMap class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_DMAP_H__ACAE597A_D26D_49AD_AA69_EDE743DB54FA__INCLUDED_)
#define AFX_DMAP_H__ACAE597A_D26D_49AD_AA69_EDE743DB54FA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class DMap
{
public:
static void RebuildEntity(DEntity* ent);
void ResetTextures( const char* textureName, float fScale[2], float fShift[2], int rotation, const char* newTextureName, int bResetTextureName, int bResetScale[2], int bResetShift[2], int bResetRotation);
void LoadAll(bool bLoadPatches = FALSE);
void BuildInRadiant(bool bAllowDestruction);
int m_nNextEntity;
DEntity* GetWorldSpawn();
void ClearEntities();
DEntity* DMap::GetEntityForID(int ID);
DEntity* AddEntity(char* classname = "worldspawn", int ID = -1);
list<DEntity*> entityList;
DMap();
virtual ~DMap();
int FixBrushes();
};
#endif // !defined(AFX_DMAP_H__ACAE597A_D26D_49AD_AA69_EDE743DB54FA__INCLUDED_)

458
contrib/bobtoolz/DPatch.cpp Normal file
View file

@ -0,0 +1,458 @@
/*
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
*/
// DPatch.cpp: implementation of the DPatch class.
//
//////////////////////////////////////////////////////////////////////
#include "StdAfx.h"
#include "gtkr_list.h"
#include "str.h"
//#include "DPoint.h"
//#include "DPlane.h"
//#include "DBrush.h"
//#include "DEPair.h"
#include "DPatch.h"
//#include "DEntity.h"
#include "misc.h"
#include "./dialogs/dialogs-gtk.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
// Added patch merging, wahey!
//
// problem is, you cant put patches into entities as yet :(
//
DPatch::DPatch()
{
width = MIN_PATCH_WIDTH;
height = MIN_PATCH_HEIGHT;
QER_brush = NULL;
}
DPatch::~DPatch()
{
}
void DPatch::SetTexture(const char *textureName)
{
strcpy(texture, textureName);
}
void CopyDrawVert(const drawVert_t* in, drawVert_t* out)
{
out->lightmap[0] = in->lightmap[0];
out->lightmap[1] = in->lightmap[1];
out->st[0] = in->st[0];
out->st[1] = in->st[1];
VectorCopy(in->normal, out->normal);
VectorCopy(in->xyz, out->xyz);
}
void DPatch::BuildInRadiant(void* entity)
{
#if 0
int nIndex = g_FuncTable.m_pfnCreatePatchHandle();
//$ FIXME: m_pfnGetPatchHandle
patchMesh_t* pm = g_FuncTable.m_pfnGetPatchData(nIndex);
b->patchBrush = true;
b->pPatch = Patch_Alloc();
b->pPatch->setDims(width,height);
for(int x = 0; x < height; x++)
{
for(int y = 0; y < width; y++)
{
float *p = b->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];
}
}
if(entity)
g_FuncTable.m_pfnCommitBrushHandleToEntity(QER_brush, entity);
else
g_FuncTable.m_pfnCommitBrushHandle(QER_brush);
for(int x = 0; x < width; x++)
for(int y = 0; y < height; y++)
CopyDrawVert(&points[x][y], &pm->ctrl[x][y]);
QER_patch = pm;
/* if(entity)
{
// strcpy(pm->d_texture->name, texture);
brush_t* brush = (brush_t*)g_FuncTable.m_pfnCreateBrushHandle();
brush->patchBrush = TRUE;
brush->pPatch = pm;
pm->pSymbiot = brush;
pm->bSelected = false;
pm->bOverlay = false; // bleh, f*cks up, just have to wait for a proper function
pm->bDirty = true; // or get my own patch out....
pm->nListID = -1;
g_FuncTable.m_pfnCommitBrushHandleToEntity(brush, entity);
}
else*/ // patch to entity just plain dont work atm
if(entity)
g_FuncTable.m_pfnCommitPatchHandleToEntity(nIndex, pm, texture, entity);
else
g_FuncTable.m_pfnCommitPatchHandleToMap(nIndex, pm, texture);
QER_brush = pm->pSymbiot;
#endif
}
void DPatch::LoadFromBrush(scene::Node* brush)
{
QER_brush = brush;
#if 0
SetTexture(brush->pPatch->GetShader());
width = brush->pPatch->getWidth();
height = brush->pPatch->getHeight();
for(int x = 0; x < height; x++)
{
for(int y = 0; y < width; y++)
{
float *p = brush->pPatch->ctrlAt(ROW,x,y);
p[0] = points[x][y].xyz[0];
p[1] = points[x][y].xyz[1];
p[2] = points[x][y].xyz[2];
p[3] = points[x][y].st[0];
p[4] = points[x][y].st[1];
}
}
#endif
}
void DPatch::RemoveFromRadiant()
{
if(QER_brush)
{
#if 0
g_FuncTable.m_pfnDeleteBrushHandle(QER_brush);
#endif
}
}
bool DPatch::ResetTextures(const char *oldTextureName, const char *newTextureName)
{
if( !oldTextureName || !strcmp(texture, oldTextureName))
{
strcpy(texture, newTextureName);
return TRUE;
}
return FALSE;
}
void Build1dArray(vec3_t* array, drawVert_t points[MAX_PATCH_WIDTH][MAX_PATCH_HEIGHT],
int startX, int startY, int number, bool horizontal, bool inverse)
{
int x = startX, y = startY, i, step;
if(inverse)
step = -1;
else
step = 1;
for(i = 0; i < number; i++)
{
VectorCopy(points[x][y].xyz, array[i]);
if(horizontal)
x+=step;
else
y+=step;
}
}
void Print1dArray(vec3_t* array, int size)
{
for(int i = 0; i < size; i++)
Sys_Printf("(%.0f %.0f %.0f)\t", array[i][0], array[i][1], array[i][2]);
Sys_Printf("\n");
}
bool Compare1dArrays(vec3_t* a1, vec3_t* a2, int size)
{
int i;
bool equal = true;
for(i = 0; i < size; i++)
{
if(!VectorCompare(a1[i], a2[size-i-1]))
{
equal = false;
break;
}
}
return equal;
}
patch_merge_t DPatch::IsMergable(DPatch *other)
{
int i, j;
vec3_t p1Array[4][MAX_PATCH_HEIGHT];
vec3_t p2Array[4][MAX_PATCH_HEIGHT];
int p1ArraySizes[4];
int p2ArraySizes[4];
patch_merge_t merge_info;
Build1dArray(p1Array[0], this->points, 0, 0, this->width, true, false);
Build1dArray(p1Array[1], this->points, this->width-1, 0, this->height, false, false);
Build1dArray(p1Array[2], this->points, this->width-1, this->height-1, this->width, true, true);
Build1dArray(p1Array[3], this->points, 0, this->height-1, this->height, false, true);
Build1dArray(p2Array[0], other->points, 0, 0, other->width, true, false);
Build1dArray(p2Array[1], other->points, other->width-1, 0, other->height, false, false);
Build1dArray(p2Array[2], other->points, other->width-1, other->height-1, other->width, true, true);
Build1dArray(p2Array[3], other->points, 0, other->height-1, other->height, false, true);
p1ArraySizes[0] = this->width;
p1ArraySizes[1] = this->height;
p1ArraySizes[2] = this->width;
p1ArraySizes[3] = this->height;
p2ArraySizes[0] = other->width;
p2ArraySizes[1] = other->height;
p2ArraySizes[2] = other->width;
p2ArraySizes[3] = other->height;
for(i = 0; i < 4; i++)
{
for(j = 0; j < 4; j++)
{
if(p1ArraySizes[i] == p2ArraySizes[j])
{
if(Compare1dArrays(p1Array[i], p2Array[j], p1ArraySizes[i]))
{
merge_info.pos1 = i;
merge_info.pos2 = j;
merge_info.mergable = true;
return merge_info;
}
}
}
}
merge_info.mergable = false;
return merge_info;
}
DPatch* DPatch::MergePatches(patch_merge_t merge_info, DPatch *p1, DPatch *p2)
{
while(merge_info.pos1 != 2)
{
p1->Transpose();
merge_info.pos1--;
if(merge_info.pos1 < 0)
merge_info.pos1 += 4;
}
while(merge_info.pos2 != 0)
{
p2->Transpose();
merge_info.pos2--;
if(merge_info.pos2 < 0)
merge_info.pos2 += 3;
}
int newHeight = p1->height + p2->height - 1;
if(newHeight > MAX_PATCH_HEIGHT)
return NULL;
DPatch* newPatch = new DPatch();
newPatch->height = newHeight;
newPatch->width = p1->width;
newPatch->SetTexture(p1->texture);
int y = 0;
int i;
for(i = 0; i < p1->height; i++, y++)
for(int x = 0; x < p1->width; x++)
memcpy(&newPatch->points[x][y], &p1->points[x][i], sizeof(drawVert_t));
for(i = 1; i < p2->height; i++, y++)
for(int x = 0; x < p2->width; x++)
memcpy(&newPatch->points[x][y], &p2->points[x][i], sizeof(drawVert_t));
// newPatch->Invert();
return newPatch;
}
void DPatch::Invert()
{
drawVert_t vertTemp;
int i, j;
for(i = 0 ; i < width ; i++ )
{
for(j = 0; j < height / 2; 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));
}
}
}
void DPatch::Transpose()
{
int i, j, w;
drawVert_t dv;
if ( width > height )
{
for ( i = 0 ; i < height ; i++ )
{
for ( j = i + 1 ; j < width ; j++ )
{
if ( j < height )
{
// swap the value
memcpy(&dv, &points[j][i], sizeof(drawVert_t));
memcpy(&points[j][i], &points[i][j], sizeof(drawVert_t));
memcpy(&points[i][j], &dv, sizeof(drawVert_t));
}
else
{
// just copy
memcpy(&points[i][j], &points[j][i], sizeof(drawVert_t));
}
}
}
}
else
{
for ( i = 0 ; i < width ; i++ )
{
for ( j = i + 1 ; j < height ; j++ )
{
if ( j < width )
{
// swap the value
memcpy(&dv, &points[i][j], sizeof(drawVert_t));
memcpy(&points[i][j], &points[j][i], sizeof(drawVert_t));
memcpy(&points[j][i], &dv, sizeof(drawVert_t));
}
else
{
// just copy
memcpy(&points[j][i], &points[i][j], sizeof(drawVert_t));
}
}
}
}
w = width;
width = height;
height = w;
Invert();
}
list<DPatch> DPatch::Split(bool rows, bool cols)
{
list<DPatch> patchList;
int i;
int x, y;
if(rows && height >= 5)
{
for(i = 0; i < (height-1)/2; i++)
{
DPatch p;
p.width = width;
p.height = 3;
p.SetTexture(texture);
for(y = 0; y < 3; y++)
{
for(x = 0; x < p.width; x++)
{
memcpy(&p.points[x][y], &points[x][(i*2)+y], sizeof(drawVert_t));
}
}
patchList.push_back(p);
}
if(cols && width >= 5)
{
list<DPatch> patchList2;
for(list<DPatch>::iterator patches = patchList.begin(); patches != patchList.end(); patches++)
{
list<DPatch> patchList3 = (*patches).Split(false, true);
for(list<DPatch>::iterator patches2 = patchList3.begin(); patches2 != patchList3.end(); patches2++)
patchList2.push_front(*patches2);
}
return patchList2;
}
}
else if(cols && width >= 5)
{
for(i = 0; i < (width-1)/2; i++)
{
DPatch p;
p.height = height;
p.width = 3;
p.SetTexture(texture);
for(x = 0; x < 3; x++)
{
for(y = 0; y < p.height; y++)
{
memcpy(&p.points[x][y], &points[(i*2)+x][y], sizeof(drawVert_t));
}
}
patchList.push_back(p);
}
}
return patchList;
}

75
contrib/bobtoolz/DPatch.h Normal file
View file

@ -0,0 +1,75 @@
/*
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
*/
// DPatch.h: interface for the DPatch class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_DPATCH_H__26C6B083_CE5B_420B_836B_1DDA733C04CE__INCLUDED_)
#define AFX_DPATCH_H__26C6B083_CE5B_420B_836B_1DDA733C04CE__INCLUDED_
#include "StdAfx.h" // Added by ClassView
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
typedef struct
{
bool mergable;
int pos1;
int pos2;
} patch_merge_t;
typedef struct {
float xyz[3];
float st[2];
float normal[3];
float lightmap[2];
} drawVert_t;
class Patch;
#define MAX_PATCH_WIDTH 16
#define MAX_PATCH_HEIGHT 16
#define MIN_PATCH_WIDTH 3
#define MIN_PATCH_HEIGHT 3
class DPatch
{
public:
list<DPatch> Split(bool rows, bool cols);
void Transpose();
void Invert();
DPatch* MergePatches(patch_merge_t merge_info, DPatch* p1, DPatch* p2);
patch_merge_t IsMergable(DPatch* other);
bool ResetTextures(const char *oldTextureName, const char *newTextureName);
void RemoveFromRadiant(void);
scene::Node* QER_brush;
void LoadFromBrush(scene::Node* brush);
void BuildInRadiant(void* entity = NULL);
void SetTexture(const char* textureName);
char texture[256];
int width, height;
drawVert_t points[MAX_PATCH_WIDTH][MAX_PATCH_HEIGHT];
DPatch();
virtual ~DPatch();
};
#endif // !defined(AFX_DPATCH_H__26C6B083_CE5B_420B_836B_1DDA733C04CE__INCLUDED_)

264
contrib/bobtoolz/DPlane.cpp Normal file
View file

@ -0,0 +1,264 @@
/*
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
*/
// DPlane.cpp: implementation of the DPlane class.
//
//////////////////////////////////////////////////////////////////////
#include "StdAfx.h"
#include "gtkr_list.h"
#include "DPoint.h"
#include "DPlane.h"
#include "DWinding.h"
#include "str.h"
#include "misc.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
DPlane::DPlane(vec3_t va, vec3_t vb, vec3_t vc, _QERFaceData* texData)
{
MakeNormal( va, vb, vc, normal );
if(VectorNormalize(normal, normal) == 0) // normalizes and returns length
Sys_ERROR("DPlane::DPlane: Bad Normal.\n");
_d = (normal[0]*va[0]) + (normal[1]*va[1]) + (normal[2]*va[2]);
VectorCopy(va, points[0]);
VectorCopy(vb, points[1]);
VectorCopy(vc, points[2]);
m_bChkOk = TRUE;
if(texData)
memcpy(&texInfo, texData, sizeof(_QERFaceData));
else
FillDefaultTexture(&texInfo, points[0], points[1], points[2], "textures/common/caulk");
}
DPlane::~DPlane()
{
}
//////////////////////////////////////////////////////////////////////
// Implementation
//////////////////////////////////////////////////////////////////////
vec_t DPlane::DistanceToPoint(vec3_t pnt)
{
vec3_t tmp;
VectorSubtract(pnt, points[0], tmp);
return DotProduct(tmp, normal);
}
bool DPlane::PlaneIntersection(DPlane *pl1, DPlane *pl2, vec3_t out)
{
float a1, a2, a3;
float b1, b2, b3;
float c1, c2, c3;
a1 = normal[0]; a2 = normal[1]; a3 = normal[2];
b1 = pl1->normal[0]; b2 = pl1->normal[1]; b3 = pl1->normal[2];
c1 = pl2->normal[0]; c2 = pl2->normal[1]; c3 = pl2->normal[2];
float d = Determinant3x3(a1, a2, a3, b1, b2, b3, c1, c2, c3);
if(d == 0)
return FALSE;
float v1 = _d;
float v2 = pl1->_d;
float v3 = pl2->_d;
float d1 = Determinant3x3(v1, a2, a3, v2, b2, b3, v3, c2, c3);
float d2 = Determinant3x3(a1, v1, a3, b1, v2, b3, c1, v3, c3);
float d3 = Determinant3x3(a1, a2, v1, b1, b2, v2, c1, c2, v3);
out[0] = d1/d;
out[1] = d2/d;
out[2] = d3/d;
return TRUE;
}
bool DPlane::IsRedundant(list<DPoint*>& pointList)
{
int cnt = 0;
//list<DPoint *>::const_iterator point=pointList.begin();
for(list<DPoint *>::const_iterator point=pointList.begin(); point!=pointList.end(); point++)
{
if(fabs(DistanceToPoint((*point)->_pnt)) < MAX_ROUND_ERROR)
cnt++;
if(cnt == 3)
return FALSE;
}
return TRUE;
}
bool DPlane::operator == (DPlane& other)
{
vec3_t chk;
VectorSubtract(other.normal, normal, chk);
if(fabs(VectorLength(chk)) > MAX_ROUND_ERROR)
return FALSE;
if(fabs(other._d - _d) > MAX_ROUND_ERROR)
return FALSE;
return TRUE;
}
bool DPlane::operator != (DPlane& other)
{
vec3_t chk;
VectorAdd(other.normal, normal, chk);
if(fabs(VectorLength(chk)) > MAX_ROUND_ERROR)
return FALSE;
return TRUE;
}
DWinding* DPlane::BaseWindingForPlane()
{
int i, x;
vec_t max, v;
vec3_t org, vright, vup;
// find the major axis
max = -131072;
x = -1;
for (i=0 ; i<3; i++)
{
v = (float)fabs(normal[i]);
if (v > max)
{
x = i;
max = v;
}
}
if (x==-1)
Sys_Printf ("BaseWindingForPlane: no axis found");
VectorCopy (vec3_origin, vup);
switch (x)
{
case 0:
case 1:
vup[2] = 1;
break;
case 2:
vup[0] = 1;
break;
}
v = DotProduct (vup, normal);
VectorMA (vup, -v, normal, vup);
VectorNormalize (vup, vup);
VectorScale (normal, _d, org);
CrossProduct (vup, normal, vright);
VectorScale (vup, 131072, vup);
VectorScale (vright, 131072, vright);
// project a really big axis aligned box onto the plane
DWinding* w = new DWinding;
w->AllocWinding(4);
VectorSubtract (org, vright, w->p[0]);
VectorAdd (w->p[0], vup, w->p[0]);
VectorAdd (org, vright, w->p[1]);
VectorAdd (w->p[1], vup, w->p[1]);
VectorAdd (org, vright, w->p[2]);
VectorSubtract (w->p[2], vup, w->p[2]);
VectorSubtract (org, vright, w->p[3]);
VectorSubtract (w->p[3], vup, w->p[3]);
return w;
}
void DPlane::Rebuild()
{
vec3_t v1, v2;
VectorSubtract(points[0], points[1], v1);
VectorSubtract(points[2], points[1], v2);
CrossProduct(v1, v2, normal);
if(VectorNormalize(normal, normal) == 0) // normalizes and returns length
Sys_ERROR("DPlane::Rebuild: Bad Normal.\n");
_d = (normal[0]*points[0][0]) + (normal[1]*points[0][1]) + (normal[2]*points[0][2]);
VectorCopy(points[0], texInfo.m_p0);
VectorCopy(points[1], texInfo.m_p1);
VectorCopy(points[2], texInfo.m_p2);
}
bool DPlane::AddToBrush(Brush *brush)
{
#if 0
if(m_bChkOk || !strcmp(texInfo.m_TextureName, "textures/common/caulk"))
{
brush->addPlane(m_p0, m_p1, m_p2, m_texdef, false);
return FALSE;
}
strcpy(texInfo.m_TextureName, "textures/common/caulk");
brush->addPlane(m_p0, m_p1, m_p2, m_texdef, false);
#endif
return TRUE;
}
void DPlane::ScaleTexture()
{ }
DPlane::DPlane(vec3_t va, vec3_t vb, vec3_t vc, const char* textureName, bool bDetail)
{
vec3_t v1, v2;
VectorSubtract(va, vb, v1);
VectorSubtract(vc, vb, v2);
CrossProduct(v1, v2, normal);
if(VectorNormalize(normal, normal) == 0) // normalizes and returns length
Sys_ERROR("DPlane::DPlane: Bad Normal.\n");
_d = (normal[0]*va[0]) + (normal[1]*va[1]) + (normal[2]*va[2]);
VectorCopy(va, points[0]);
VectorCopy(vb, points[1]);
VectorCopy(vc, points[2]);
m_bChkOk = TRUE;
FillDefaultTexture(&texInfo, points[0], points[1], points[2], textureName);
if(bDetail)
texInfo.m_texdef.contents |= FACE_DETAIL;
}

67
contrib/bobtoolz/DPlane.h Normal file
View file

@ -0,0 +1,67 @@
/*
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
*/
// DPlane.h: interface for the DPlane class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_DPLANE_H__FC37C021_F0A1_11D4_ACF7_004095A18133__INCLUDED_)
#define AFX_DPLANE_H__FC37C021_F0A1_11D4_ACF7_004095A18133__INCLUDED_
class Brush;
#define FACE_DETAIL 0x8000000
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class DWinding;
class DPlane
{
public:
DPlane(vec3_t va, vec3_t vb, vec3_t vc, const char* textureName, bool bDetail);
void ScaleTexture();
DWinding* BaseWindingForPlane();
void Rebuild();
bool AddToBrush(Brush *brush);
bool operator != (DPlane& other);
bool operator == (DPlane& other);
bool IsRedundant(list<DPoint*>& pointList);
bool PlaneIntersection(DPlane* pl1, DPlane* pl2, vec3_t out);;
vec_t DistanceToPoint(vec3_t pnt);
DPlane(vec3_t va, vec3_t vb, vec3_t vc, _QERFaceData* texData);
DPlane() { }
virtual ~DPlane();
bool m_bChkOk;
_QERFaceData texInfo;
vec3_t points[3]; // djbob:do we really need these any more?
vec3_t normal;
float _d;
};
//typedef CList<DPlane*, DPlane*> DPlaneList;
#endif // !defined(AFX_DPLANE_H__FC37C021_F0A1_11D4_ACF7_004095A18133__INCLUDED_)

View file

@ -0,0 +1,52 @@
/*
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
*/
// DPoint.cpp: implementation of the DPoint class.
//
//////////////////////////////////////////////////////////////////////
#include "StdAfx.h"
#include "DPoint.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
DPoint::DPoint()
{
}
DPoint::~DPoint()
{
}
//////////////////////////////////////////////////////////////////////
// Implementation
//////////////////////////////////////////////////////////////////////
bool DPoint::operator ==(vec3_t other)
{
vec3_t test;
VectorSubtract(other, _pnt, test);
if(fabs(VectorLength(test)) > MAX_ROUND_ERROR)
return FALSE;
return TRUE;
}

45
contrib/bobtoolz/DPoint.h Normal file
View file

@ -0,0 +1,45 @@
/*
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
*/
// DPoint.h: interface for the DPoint class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_DPOINT_H__FC37C022_F0A1_11D4_ACF7_004095A18133__INCLUDED_)
#define AFX_DPOINT_H__FC37C022_F0A1_11D4_ACF7_004095A18133__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class DPoint
{
public:
DPoint();
virtual ~DPoint();
bool operator ==(vec3_t other);
vec3_t _pnt;
unsigned char m_uData;
};
//typedef CList<DPoint*, DPoint*> DPointList;
#endif // !defined(AFX_DPOINT_H__FC37C022_F0A1_11D4_ACF7_004095A18133__INCLUDED_)

469
contrib/bobtoolz/DShape.cpp Normal file
View file

@ -0,0 +1,469 @@
/*
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
*/
// DShape.cpp: implementation of the DShape class.
//
//////////////////////////////////////////////////////////////////////
#include "StdAfx.h"
#include "gtkr_list.h"
#include "str.h"
#include "DPoint.h"
#include "DPlane.h"
#include "DBrush.h"
#include "DEPair.h"
#include "DPatch.h"
#include "DEntity.h"
#include "DShape.h"
//#include "dialogs-gtk.h"
#include "misc.h"
#include "shapes.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
bool bFacesAll[6] = {TRUE, TRUE, TRUE, TRUE, TRUE, TRUE};
DShape::DShape()
{
m_nNextBrush = 0;
}
DShape::~DShape()
{
}
void DShape::BuildRegularPrism(vec3_t min, vec3_t max, int nSides, bool bAlignTop)
{
vec3_t vc[MAX_POLYGON_FACES+2], vd[MAX_POLYGON_FACES+2];
vec3_t radius;
vec3_t origin;
VectorSubtract(max, min, radius);
VectorScale(radius, 0.5f, radius);
// calc 3d radius and origin
VectorAdd(max, min, origin);
VectorScale(origin, 0.5f, origin);
float phase = 0.0f;
if(bAlignTop)
{
phase = -(Q_PI/nSides);
VectorScale(radius, static_cast<float>(1.0 / cos(phase)), radius);
}
//----- Build Polygon Vertices -----
int i;
for(i = 0; i < nSides; i++)
{
VectorCopy(origin, vc[i]);
VectorCopy(origin, vd[i]);
vc[i][2] = min[2];
vd[i][2] = max[2];
vc[i][0] += radius[0] * sinf( ( 2 * Q_PI * i / nSides ) + phase );
vc[i][1] += radius[1] * cosf( ( 2 * Q_PI * i / nSides ) + phase );
vd[i][0] = vc[i][0];
vd[i][1] = vc[i][1];
}
VectorCopy(vc[0], vc[nSides]);
VectorCopy(vd[0], vd[nSides]);
VectorCopy(vc[1], vc[nSides+1]);
VectorCopy(vd[1], vd[nSides+1]);
//----------------------------------
DBrush* pB = m_Container.GetWorldSpawn()->NewBrush(m_nNextBrush++);
for(i = 1; i <= nSides; i++)
pB->AddFace(vc[i-1], vc[i], vd[i], GetCurrentTexture(), FALSE);
pB->AddFace(vc[2], vc[1], vc[0], "textures/common/caulk", FALSE);
pB->AddFace(vd[0], vd[1], vd[2], "textures/common/caulk", FALSE);
}
void DShape::Commit()
{
m_Container.GetWorldSpawn()->FixBrushes();
m_Container.BuildInRadiant(TRUE);
}
void DShape::BuildInversePrism(vec3_t min, vec3_t max, int nSides, bool bAlignTop)
{
vec3_t va[MAX_POLYGON_FACES+1], vb[MAX_POLYGON_FACES+1];
vec3_t radius;
vec3_t origin;
VectorSubtract(max, min, radius);
VectorScale(radius, 0.5f, radius);
// calc 3d radius and origin
VectorAdd(max, min, origin);
VectorScale(origin, 0.5f, origin);
float phase = 0.0f;
if(bAlignTop)
{
phase = -(Q_PI/nSides);
VectorScale(radius, static_cast<float>(1.0 / cos(phase)), radius);
}
//----- Build Polygon Vertices -----
int i;
for(i = 0; i < nSides; i++)
{
VectorCopy(origin, va[i]);
VectorCopy(origin, vb[i]);
va[i][2] = min[2];
vb[i][2] = max[2];
va[i][0] += radius[0] * sinf( ( 2 * Q_PI * i / nSides ) + phase );
va[i][1] += radius[1] * cosf( ( 2 * Q_PI * i / nSides ) + phase );
vb[i][0] = va[i][0];
vb[i][1] = va[i][1];
}
VectorCopy(va[0], va[nSides]);
VectorCopy(vb[0], vb[nSides]);
//----------------------------------
for(i = 1; i <= nSides; i++)
{
DBrush* pB = GetBoundingCube(min, max, "textures/common/caulk");
vec3_t top, bottom;
VectorCopy(va[i-1], top);
VectorCopy(va[i], bottom);
if(va[i-1][1] > va[i][1])
{
top[0] += 5;
bottom[0] += 5;
}
else // flip direction of plane on crossover
{
top[0] -= 5;
bottom[0] -= 5;
}
if(top[1] != bottom[1]) // internal line is flat already if true
{
pB->AddFace(va[i-1], top, vb[i-1], "textures/common/caulk", FALSE);
pB->AddFace(va[i], vb[i], bottom, "textures/common/caulk", FALSE);
} // add cut-off planes
pB->AddFace(va[i-1], vb[i-1], vb[i], GetCurrentTexture(), FALSE);
// add internal polygon plane
}
}
void DShape::BuildBorderedPrism(vec3_t min, vec3_t max, int nSides, int nBorder, bool bAlignTop)
{
vec3_t va[MAX_POLYGON_FACES+2], vb[MAX_POLYGON_FACES+2];
vec3_t vc[MAX_POLYGON_FACES+2], vd[MAX_POLYGON_FACES+2];
vec3_t radius;
vec3_t origin;
VectorSubtract(max, min, radius);
VectorScale(radius, 0.5f, radius);
// calc 3d radius and origin
VectorAdd(max, min, origin);
VectorScale(origin, 0.5f, origin);
if(nBorder >= Min(radius[0], radius[1]))
{
// DoMessageBox("Border is too large", "Error", MB_OK);
return;
}
float phase = 0.0f;
if(bAlignTop)
{
phase = -(Q_PI/nSides);
VectorScale(radius, static_cast<float>(1.0 / cos(phase)), radius);
}
//----- Build Polygon Vertices -----
int i;
for(i = 0; i < nSides; i++)
{
VectorCopy(origin, va[i]);
VectorCopy(origin, vb[i]);
VectorCopy(origin, vc[i]);
VectorCopy(origin, vd[i]);
va[i][2] = min[2];
vb[i][2] = max[2];
va[i][0] += (radius[0] - nBorder) * sinf( ( 2 * Q_PI * i / nSides ) + phase );
va[i][1] += (radius[1] - nBorder) * cosf( ( 2 * Q_PI * i / nSides ) + phase );
vb[i][0] = va[i][0];
vb[i][1] = va[i][1];
vc[i][2] = min[2];
vd[i][2] = max[2];
vc[i][0] += radius[0] * sinf( ( 2 * Q_PI * i / nSides ) + phase );
vc[i][1] += radius[1] * cosf( ( 2 * Q_PI * i / nSides ) + phase );
vd[i][0] = vc[i][0];
vd[i][1] = vc[i][1];
}
VectorCopy(va[0], va[nSides]);
VectorCopy(vb[0], vb[nSides]);
VectorCopy(va[1], va[nSides+1]);
VectorCopy(vb[1], vb[nSides+1]);
VectorCopy(vc[0], vc[nSides]);
VectorCopy(vd[0], vd[nSides]);
VectorCopy(vc[1], vc[nSides+1]);
VectorCopy(vd[1], vd[nSides+1]);
//----------------------------------
for(i = 1; i <= nSides; i++)
{
DBrush* pB = GetBoundingCube(min, max, "textures/common/caulk");
pB->AddFace(origin, vc[i-1], vd[i-1], "textures/common/caulk", FALSE);
pB->AddFace(origin, vd[i], vc[i], "textures/common/caulk", FALSE);
pB->AddFace(vc[i-1], vc[i], vd[i], GetCurrentTexture(), FALSE);
pB->AddFace(vb[i], va[i], va[i-1], GetCurrentTexture(), FALSE);
}
}
DBrush* DShape::GetBoundingCube_Ext(vec3_t min, vec3_t max, const char *textureName, bool* bUseFaces, bool detail)
{
DBrush* pB = new DBrush;
//----- Build Outer Bounds ---------
vec3_t v1, v2, v3, v5, v6, v7;
VectorCopy(min, v1);
VectorCopy(min, v2);
VectorCopy(min, v3);
VectorCopy(max, v5);
VectorCopy(max, v6);
VectorCopy(max, v7);
v2[0] = max[0];
v3[1] = max[1];
v6[0] = min[0];
v7[1] = min[1];
//----------------------------------
//----- Add Six Cube Faces ---------
if(bUseFaces[0])
pB->AddFace(v1, v2, v3, textureName, detail);
if(bUseFaces[1])
pB->AddFace(v1, v3, v6, textureName, detail);
if(bUseFaces[2])
pB->AddFace(v1, v7, v2, textureName, detail);
if(bUseFaces[3])
pB->AddFace(v5, v6, v3, textureName, detail);
if(bUseFaces[4])
pB->AddFace(v5, v2, v7, textureName, detail);
if(bUseFaces[5])
pB->AddFace(v5, v7, v6, textureName, detail);
//----------------------------------
return pB;
}
DBrush* DShape::GetBoundingCube(vec3_t min, vec3_t max, const char *textureName, DEntity* ent, bool* bUseFaces)
{
DBrush* pB;
if(ent == NULL)
pB = m_Container.GetWorldSpawn()->NewBrush(m_nNextBrush++);
else
pB = ent->NewBrush(m_nNextBrush++);
//----- Build Outer Bounds ---------
vec3_t v1, v2, v3, v5, v6, v7;
VectorCopy(min, v1);
VectorCopy(min, v2);
VectorCopy(min, v3);
VectorCopy(max, v5);
VectorCopy(max, v6);
VectorCopy(max, v7);
v2[0] = max[0];
v3[1] = max[1];
v6[0] = min[0];
v7[1] = min[1];
//----------------------------------
//----- Add Six Cube Faces ---------
if(bUseFaces[0])
pB->AddFace(v1, v2, v3, textureName, FALSE);
if(bUseFaces[1])
pB->AddFace(v1, v3, v6, textureName, FALSE);
if(bUseFaces[2])
pB->AddFace(v1, v7, v2, textureName, FALSE);
if(bUseFaces[3])
pB->AddFace(v5, v6, v3, textureName, FALSE);
if(bUseFaces[4])
pB->AddFace(v5, v2, v7, textureName, FALSE);
if(bUseFaces[5])
pB->AddFace(v5, v7, v6, textureName, FALSE);
//----------------------------------
return pB;
}
bool DShape::BuildPit(vec3_t min, vec3_t max)
{
if((max[2] - min[2]) < 196)
return FALSE;
srand(time(NULL));
vec3_t centre;
VectorAdd(min, max, centre);
VectorScale(centre, 0.5f, centre);
char buffer[256];
int team = (rand()%10000)+5000;
// ************* SPEAKER ***************
sprintf(buffer, "t%i_1", team);
// trigger for speaker
vec3_t triggerVoiceBtm;
VectorCopy(min, triggerVoiceBtm);
triggerVoiceBtm[2] = max[2] - 16;
DEntity* triggerVoice = m_Container.AddEntity("trigger_multiple");
GetBoundingCube(triggerVoiceBtm, max, "textures/common/trigger", triggerVoice);
triggerVoice->AddEPair("target", buffer);
//--------------------
// target for speaker
vec3_t voiceOrigin;
VectorCopy(centre, voiceOrigin);
voiceOrigin[2] = max[2]+16;
DEntity* targetVoice = m_Container.AddEntity("target_speaker");
targetVoice->AddEPair("targetname", buffer);
sprintf(buffer, "%f %f %f", voiceOrigin[0], voiceOrigin[1], voiceOrigin[2]);
targetVoice->AddEPair("origin", buffer);
targetVoice->AddEPair("spawnflags", "8");
targetVoice->AddEPair("noise", "*falling1.wav");
//--------------------
// *********** END SPEAKER *************
// ********* POWERUP REMOVAL ***********
sprintf(buffer, "t%i_2", team);
// trigger for powerup removal
vec3_t triggerPwrRmvTop, triggerPwrRmvBtm;
VectorCopy(min, triggerPwrRmvBtm);
VectorCopy(max, triggerPwrRmvTop);
triggerPwrRmvTop[2] = triggerVoiceBtm[2] - 64;
triggerPwrRmvBtm[2] = triggerPwrRmvTop[2] - 16;
DEntity* triggerPwrRmv = m_Container.AddEntity("trigger_multiple");
GetBoundingCube(triggerPwrRmvBtm, triggerPwrRmvTop, "textures/common/trigger", triggerPwrRmv);
triggerPwrRmv->AddEPair("target", buffer);
//--------------------
// target for powerup removal
vec3_t pwrRmvOrigin;
VectorCopy(centre, pwrRmvOrigin);
pwrRmvOrigin[2] = triggerPwrRmvTop[2]+16;
DEntity* targetPwrRmv = m_Container.AddEntity("target_remove_powerups");
targetPwrRmv->AddEPair("targetname", buffer);
sprintf(buffer, "%f %f %f", pwrRmvOrigin[0], pwrRmvOrigin[1], pwrRmvOrigin[2]);
targetPwrRmv->AddEPair("origin", buffer);
//--------------------
// ****** END POWERUP REMOVAL ********
// ********* DAMAGE ***********
// trigger for damage
vec3_t triggerDmgTop, triggerDmgBtm;
VectorCopy(min, triggerDmgBtm);
VectorCopy(max, triggerDmgTop);
triggerDmgBtm[2] = min[2] + 64;
triggerDmgTop[2] = triggerDmgBtm[2] + 16;
DEntity* triggerDmg = m_Container.AddEntity("trigger_hurt");
GetBoundingCube(triggerDmgBtm, triggerDmgTop, "textures/common/trigger", triggerDmg);
triggerDmg->AddEPair("dmg", "9999");
triggerDmg->AddEPair("spawnflags", "12");
//--------------------
// ****** END DAMAGE ********
// ********* NODROP ***********
vec3_t nodropTop;
VectorCopy(max, nodropTop);
nodropTop[2] = min[2] + 64;
GetBoundingCube(min, nodropTop, "textures/common/nodrop");
// ****** END NODROP ********
return TRUE;
}

60
contrib/bobtoolz/DShape.h Normal file
View file

@ -0,0 +1,60 @@
/*
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
*/
// DShape.h: interface for the DShape class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_DSHAPE_H__0B30B302_9D21_4C2D_836A_61F3C8D4244D__INCLUDED_)
#define AFX_DSHAPE_H__0B30B302_9D21_4C2D_836A_61F3C8D4244D__INCLUDED_
#include "DMap.h" // Added by ClassView
#include "StdAfx.h" // Added by ClassView
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// defines for polygon stuff
#define MAX_POLYGON_FACES 128
extern bool bFacesAll[];
class DShape
{
public:
bool BuildPit(vec3_t min, vec3_t max);
void BuildBorderedPrism(vec3_t min, vec3_t max, int nSides, int nBorder, bool bAlignTop);
void BuildInversePrism(vec3_t min, vec3_t max, int nSides, bool bAlignTop);
void BuildRegularPrism(vec3_t min, vec3_t max, int nSides, bool bAlignTop);
int m_nNextBrush;
static DBrush* GetBoundingCube_Ext(vec3_t min, vec3_t max, const char* textureName, bool* bUseFaces = bFacesAll, bool detail = false);
DShape();
virtual ~DShape();
void Commit();
private:
DBrush* GetBoundingCube(vec3_t min, vec3_t max, const char* textureName, DEntity* ent = NULL, bool* bUseFaces = bFacesAll);
DMap m_Container;
};
#endif // !defined(AFX_DSHAPE_H__0B30B302_9D21_4C2D_836A_61F3C8D4244D__INCLUDED_)

View file

@ -0,0 +1,366 @@
/*
BobToolz plugin for GtkRadiant
Copyright (C) 2001 Gordon Biggans
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "StdAfx.h"
#include "gtkr_list.h"
#include "str.h"
#include "DPoint.h"
#include "DPlane.h"
#include "DBrush.h"
#include "DEPair.h"
#include "DPatch.h"
#include "DEntity.h"
#include "DTrainDrawer.h"
#include "misc.h"
#include "funchandlers.h"
#include "dialogs/dialogs-gtk.h"
DTrainDrawer::DTrainDrawer() {
refCount = 1;
m_bHooked = FALSE;
m_bDisplay = FALSE;
BuildPaths();
}
DTrainDrawer::~DTrainDrawer(void) {
if(m_bHooked)
UnRegister();
ClearPoints();
ClearSplines();
}
void DTrainDrawer::ClearSplines() {
for(list<splinePoint_t *>::const_iterator deadSpline = m_splineList.begin(); deadSpline != m_splineList.end(); deadSpline++) {
(*deadSpline)->m_pointList.clear();
(*deadSpline)->m_vertexList.clear();
delete (*deadSpline);
}
m_splineList.clear();
}
void DTrainDrawer::ClearPoints() {
for(list<controlPoint_t *>::const_iterator deadPoint = m_pointList.begin(); deadPoint != m_pointList.end(); deadPoint++) {
delete *deadPoint;
}
m_pointList.clear();
}
void DTrainDrawer::Register() {
__QGLTABLENAME.m_pfnHookGL2DWindow( this );
__QGLTABLENAME.m_pfnHookGL3DWindow( this );
m_bHooked = TRUE;
}
void DTrainDrawer::UnRegister() {
__QGLTABLENAME.m_pfnUnHookGL2DWindow( this );
__QGLTABLENAME.m_pfnUnHookGL3DWindow( this );
m_bHooked = FALSE;
}
void CalculateSpline_r(vec3_t* v, int count, vec3_t out, float tension) {
vec3_t dist;
if(count < 2) {
return;
}
if(count == 2) {
VectorSubtract( v[1], v[0], dist );
VectorMA(v[0], tension, dist, out);
return;
}
vec3_t* v2 = new vec3_t[count-1];
for( int i = 0; i < count-1; i++ ) {
VectorSubtract( v[i+1], v[i], dist );
VectorMA(v[i], tension, dist, v2[i]);
}
CalculateSpline_r( v2, count-1, out, tension);
delete[] v2;
}
void DTrainDrawer::Draw3D() {
if(!m_bDisplay) {
return;
}
__QGLTABLENAME.m_pfn_qglPushAttrib(GL_ALL_ATTRIB_BITS);
__QGLTABLENAME.m_pfn_qglDisable(GL_BLEND);
__QGLTABLENAME.m_pfn_qglDisable(GL_LINE_SMOOTH);
__QGLTABLENAME.m_pfn_qglPushMatrix();
__QGLTABLENAME.m_pfn_qglLineWidth(2.0f);
__QGLTABLENAME.m_pfn_qglColor4f(1.0f, 1.0f, 1.0f, 1.0f);
__QGLTABLENAME.m_pfn_qglEnable(GL_BLEND);
__QGLTABLENAME.m_pfn_qglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
__QGLTABLENAME.m_pfn_qglDisable(GL_POLYGON_SMOOTH);
__QGLTABLENAME.m_pfn_qglDepthFunc(GL_ALWAYS);
for(list<splinePoint_t* >::const_iterator sp = m_splineList.begin(); sp != m_splineList.end(); sp++) {
splinePoint_t* pSP = (*sp);
__QGLTABLENAME.m_pfn_qglBegin(GL_LINE_STRIP);
for(list<DPoint >::const_iterator v = pSP->m_vertexList.begin(); v != pSP->m_vertexList.end(); v++) {
__QGLTABLENAME.m_pfn_qglVertex3fv((*v)._pnt);
}
__QGLTABLENAME.m_pfn_qglEnd();
}
__QGLTABLENAME.m_pfn_qglPopMatrix();
__QGLTABLENAME.m_pfn_qglPopAttrib();
}
void DTrainDrawer::Draw2D(VIEWTYPE vt) {
if(!m_bDisplay) {
return;
}
__QGLTABLENAME.m_pfn_qglPushAttrib(GL_ALL_ATTRIB_BITS);
__QGLTABLENAME.m_pfn_qglDisable(GL_BLEND);
__QGLTABLENAME.m_pfn_qglDisable(GL_LINE_SMOOTH);
__QGLTABLENAME.m_pfn_qglPushMatrix();
switch(vt)
{
case XY:
break;
case XZ:
__QGLTABLENAME.m_pfn_qglRotatef(270.0f, 1.0f, 0.0f, 0.0f);
break;
case YZ:
__QGLTABLENAME.m_pfn_qglRotatef(270.0f, 1.0f, 0.0f, 0.0f);
__QGLTABLENAME.m_pfn_qglRotatef(270.0f, 0.0f, 0.0f, 1.0f);
break;
}
__QGLTABLENAME.m_pfn_qglLineWidth(1.0f);
__QGLTABLENAME.m_pfn_qglColor4f(1.0f, 0.0f, 0.0f, 0.5f);
__QGLTABLENAME.m_pfn_qglEnable(GL_BLEND);
__QGLTABLENAME.m_pfn_qglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
__QGLTABLENAME.m_pfn_qglDisable(GL_POLYGON_SMOOTH);
__QGLTABLENAME.m_pfn_qglDepthFunc(GL_ALWAYS);
__QGLTABLENAME.m_pfn_qglColor4f(1.f, 0.f, 0.f, 1.f);
for(list<splinePoint_t* >::const_iterator sp = m_splineList.begin(); sp != m_splineList.end(); sp++) {
splinePoint_t* pSP = (*sp);
__QGLTABLENAME.m_pfn_qglBegin(GL_LINE_STRIP);
for(list<DPoint >::const_iterator v = pSP->m_vertexList.begin(); v != pSP->m_vertexList.end(); v++) {
__QGLTABLENAME.m_pfn_qglVertex3fv((*v)._pnt);
}
__QGLTABLENAME.m_pfn_qglEnd();
}
__QGLTABLENAME.m_pfn_qglPopMatrix();
__QGLTABLENAME.m_pfn_qglPopAttrib();
}
void AddSplineControl(const char* control, splinePoint_t* pSP) {
controlPoint_t cp;
strncpy(cp.strName, control, 64);
pSP->m_pointList.push_front(cp);
}
void DTrainDrawer::BuildPaths() {
#if 0
int count = g_FuncTable.m_pfnGetEntityCount();
DEntity e;
for(int i = 0; i < count; i++) {
entity_s* ent = (entity_s*)g_FuncTable.m_pfnGetEntityHandle(i);
e.ClearEPairs();
e.LoadEPairList(*g_EntityTable.m_pfnGetEntityKeyValList(ent));
const char* classname = e.m_Classname.GetBuffer();
const char* target;
const char* control;
const char* targetname;
vec3_t vOrigin;
e.SpawnString("targetname", NULL, &targetname);
e.SpawnVector("origin", "0 0 0", vOrigin);
if(!strcmp(classname, "info_train_spline_main")) {
if(!targetname) {
Sys_Printf( "info_train_spline_main with no targetname" );
return;
}
e.SpawnString("target", NULL, &target);
if(!target) {
AddControlPoint( targetname, vOrigin );
} else {
splinePoint_t* pSP = AddSplinePoint( targetname, target, vOrigin );
e.SpawnString("control", NULL, &control);
if(control) {
AddSplineControl( control, pSP );
for(int j = 2;; j++) {
char buffer[16];
sprintf(buffer, "control%i", j);
e.SpawnString(buffer, NULL, &control);
if(!control) {
break;
}
AddSplineControl( control, pSP );
}
}
}
} else if(!strcmp(classname, "info_train_spline_control")) {
if(!targetname) {
Sys_Printf( "info_train_spline_control with no targetname" );
return;
}
AddControlPoint( targetname, vOrigin );
}
}
list<splinePoint_t* >::const_iterator sp;
for(sp = m_splineList.begin(); sp != m_splineList.end(); sp++) {
splinePoint_t* pSP = (*sp);
controlPoint_t* pTarget = FindControlPoint( pSP->strTarget );
if(!pTarget) {
Sys_Printf( "couldn't find target %s", pSP->strTarget );
return;
// continue;
}
pSP->pTarget = pTarget;
for(list<controlPoint_t >::iterator cp = pSP->m_pointList.begin(); cp != pSP->m_pointList.end(); cp++) {
controlPoint_t* pControl = FindControlPoint( (*cp).strName );
if(!pControl) {
Sys_Printf( "couldn't find control %s", (*cp).strName );
return;
}
VectorCopy(pControl->vOrigin, (*cp).vOrigin);
}
}
m_bDisplay = TRUE;
Register();
for(sp = m_splineList.begin(); sp != m_splineList.end(); sp++) {
splinePoint_t* pSP = (*sp);
DPoint out;
if(!pSP->pTarget) {
continue;
}
int count = pSP->m_pointList.size() + 2;
vec3_t* v = new vec3_t[count];
VectorCopy(pSP->point.vOrigin, v[0]);
int i = 1;
for(list<controlPoint_t>::reverse_iterator cp = pSP->m_pointList.rbegin(); cp != pSP->m_pointList.rend(); cp++) {
VectorCopy((*cp).vOrigin, v[i]);
i++;
}
VectorCopy(pSP->pTarget->vOrigin, v[i]);
for (float tension = 0.0f; tension <= 1.f; tension += 0.01f) {
CalculateSpline_r(v, count, out._pnt, tension);
pSP->m_vertexList.push_front(out);
}
delete[] v;
VectorCopy(pSP->pTarget->vOrigin, out._pnt);
pSP->m_vertexList.push_front(out);
}
#endif
}
void DTrainDrawer::AddControlPoint(const char* name, vec_t* origin)
{
controlPoint_t* pCP = new controlPoint_t;
strncpy(pCP->strName, name, 64);
VectorCopy( origin, pCP->vOrigin );
m_pointList.push_back( pCP );
}
splinePoint_t* DTrainDrawer::AddSplinePoint(const char* name, const char* target, vec_t* origin)
{
splinePoint_t* pSP = new splinePoint_t;
strncpy(pSP->point.strName, name, 64);
strncpy(pSP->strTarget, target, 64);
VectorCopy( origin, pSP->point.vOrigin );
m_splineList.push_back( pSP );
return pSP;
}
controlPoint_t* DTrainDrawer::FindControlPoint(const char* name)
{
for(list<controlPoint_t*>::const_iterator cp = m_pointList.begin(); cp != m_pointList.end(); cp++) {
if(!strcmp(name, (*cp)->strName)) {
return (*cp);
}
}
for(list<splinePoint_t*>::const_iterator sp = m_splineList.begin(); sp != m_splineList.end(); sp++) {
if(!strcmp(name, (*sp)->point.strName)) {
return &((*sp)->point);
}
}
return NULL;
}

View file

@ -0,0 +1,80 @@
/*
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
*/
// DTrainDrawer.h: interface for the DTrainDrawer class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_TRAINDRAWER_H__6E36062A_EF0B_11D4_ACF7_004095A18133__INCLUDED_)
#define AFX_TRAINDRAWER_H__6E36062A_EF0B_11D4_ACF7_004095A18133__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
typedef struct {
char strName[64];
vec3_t vOrigin;
} controlPoint_t;
typedef struct {
controlPoint_t point;
char strControl[64];
char strTarget[64];
list<controlPoint_t> m_pointList;
list<DPoint> m_vertexList;
controlPoint_t* pTarget;
} splinePoint_t;
class DTrainDrawer :
public IGL2DWindow,
public IGL3DWindow
{
private:
list<splinePoint_t*> m_splineList;
list<controlPoint_t*> m_pointList;
int refCount;
bool m_bHooked;
bool m_bDisplay;
public:
void UnRegister();
void Register();
DTrainDrawer();
virtual ~DTrainDrawer(void);
void Draw3D();
void Draw2D(VIEWTYPE vt);
void IncRef() { refCount++; }
void DecRef() { refCount--; if (refCount <= 0) delete this; }
void ClearSplines();
void ClearPoints();
void BuildPaths();
void AddControlPoint(const char* name, vec_t* origin);
splinePoint_t* AddSplinePoint(const char* name, const char* target, vec_t* origin);
controlPoint_t* FindControlPoint(const char* name);
};
#endif // !defined(AFX_TRAINDRAWER_H__6E36062A_EF0B_11D4_ACF7_004095A18133__INCLUDED_)

View file

@ -0,0 +1,307 @@
/*
BobToolz plugin for GtkRadiant
Copyright (C) 2001 Gordon Biggans
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "StdAfx.h"
#include "gtkr_list.h"
#include "str.h"
#include "DPoint.h"
#include "DPlane.h"
#include "DBrush.h"
#include "DEPair.h"
#include "DPatch.h"
#include "DEntity.h"
#include "ScriptParser.h"
#include "misc.h"
#include "DTreePlanter.h"
#include "funchandlers.h"
bool DTreePlanter::OnMouseMove(guint32 nFlags, gdouble x, gdouble y) {
return false;
}
bool DTreePlanter::OnLButtonDown(guint32 nFlags, gdouble x, gdouble y) {
VIEWTYPE vt = m_XYWrapper->GetViewType();
switch(vt) {
case XY:
break;
case YZ:
case XZ:
default:
return false;
}
vec3_t pt, vhit;
m_XYWrapper->SnapToGrid( static_cast<int>(x), static_cast<int>(y), pt );
if(FindDropPoint(pt, vhit)) {
vhit[2] += m_offset;
char buffer[128];
DEntity e(m_entType);
sprintf(buffer, "%i %i %i", (int)vhit[0], (int)vhit[1], (int)vhit[2]);
e.AddEPair("origin", buffer);
if(m_autoLink) {
#if 0
entity_t* pLastEntity = NULL;
entity_t* pThisEntity = NULL;
int entNum = -1, lastEntNum = -1, entpos;
for(int i = 0; i < 256; i++) {
sprintf(buffer, m_linkName, i);
pThisEntity = FindEntityFromTargetname( buffer, &entNum );
if(pThisEntity) {
entpos = i;
lastEntNum = entNum;
pLastEntity = pThisEntity;
}
}
if(!pLastEntity) {
sprintf(buffer, m_linkName, 0);
} else {
sprintf(buffer, m_linkName, entpos + 1);
}
e.AddEPair( "targetname", buffer );
if(pLastEntity) {
DEntity e2;
e2.LoadFromEntity(lastEntNum, TRUE);
e2.AddEPair("target", buffer);
e2.RemoveFromRadiant();
e2.BuildInRadiant(FALSE);
}
#endif
}
if(m_setAngles) {
int angleYaw = (rand() % (m_maxYaw - m_minYaw + 1)) + m_minYaw;
int anglePitch = (rand() % (m_maxPitch - m_minPitch + 1)) + m_minPitch;
sprintf(buffer, "%i %i 0", anglePitch, angleYaw);
e.AddEPair("angles", buffer);
}
if(m_numModels) {
int treetype = rand() % m_numModels;
e.AddEPair("model", m_trees[treetype].name);
}
if(m_useScale) {
float scale = (((rand()%1000)*0.001f) * (m_maxScale - m_minScale)) + m_minScale;
sprintf(buffer, "%f", scale );
e.AddEPair("modelscale", buffer);
}
e.BuildInRadiant( FALSE );
}
if(m_autoLink) {
DoTrainPathPlot();
}
return true;
}
bool DTreePlanter::OnLButtonUp(guint32 nFlags, gdouble x, gdouble y) {
return false;
}
bool DTreePlanter::OnRButtonDown(guint32 nFlags, gdouble x, gdouble y) {
return false;
}
bool DTreePlanter::OnRButtonUp(guint32 nFlags, gdouble x, gdouble y) {
return false;
}
bool DTreePlanter::OnMButtonDown(guint32 nFlags, gdouble x, gdouble y) {
return false;
}
bool DTreePlanter::OnMButtonUp(guint32 nFlags, gdouble x, gdouble y) {
return false;
}
bool DTreePlanter::FindDropPoint(vec3_t in, vec3_t out) {
DPlane p1;
DPlane p2;
vec3_t vUp = { 0, 0, 1 };
vec3_t vForward = { 0, 1, 0 };
vec3_t vLeft = { 1, 0, 0 };
in[2] = 65535;
VectorCopy(in, p1.points[0]);
VectorCopy(in, p1.points[1]);
VectorCopy(in, p1.points[2]);
VectorMA(p1.points[1], 20, vUp, p1.points[1]);
VectorMA(p1.points[1], 20, vLeft, p1.points[2]);
VectorCopy(in, p2.points[0]);
VectorCopy(in, p2.points[1]);
VectorCopy(in, p2.points[2]);
VectorMA(p1.points[1], 20, vUp, p2.points[1]);
VectorMA(p1.points[1], 20, vForward, p2.points[2]);
p1.Rebuild();
p2.Rebuild();
bool found = false;
vec3_t temp;
vec_t dist;
int cnt = m_world.GetIDMax();
for(int i = 0; i < cnt; i++) {
DBrush* pBrush = m_world.GetBrushForID( i );
if(pBrush->IntersectsWith( &p1, &p2, temp )) {
vec3_t diff;
vec_t tempdist;
VectorSubtract(in, temp, diff);
tempdist = VectorLength( diff );
if(!found || (tempdist < dist)) {
dist = tempdist;
VectorCopy( temp, out );
found = true;
}
}
}
return found;
}
void DTreePlanter::DropEntsToGround( void ) {
#if 0
// tell Radiant we want to access the selected brushes
g_FuncTable.m_pfnAllocateSelectedBrushHandles();
DEntity ent;
int cnt = g_FuncTable.m_pfnSelectedBrushCount();
for(int i = 0; i < cnt; i++) {
brush_t *brush = (brush_t*)g_FuncTable.m_pfnGetSelectedBrushHandle(i);
ent.LoadFromEntity(brush->owner, TRUE);
DEPair* pEpair = ent.FindEPairByKey("origin");
if(!pEpair) {
continue;
}
vec3_t vec, out;
sscanf( pEpair->value.GetBuffer(), "%f %f %f", &vec[0], &vec[1], &vec[2]);
FindDropPoint( vec, out );
char buffer[256];
sprintf( buffer, "%f %f %f", out[0], out[1], out[2] );
ent.AddEPair( "origin", buffer );
ent.RemoveFromRadiant();
ent.BuildInRadiant(FALSE);
}
g_FuncTable.m_pfnReleaseSelectedBrushHandles();
#endif
}
void DTreePlanter::MakeChain( void ) {
char buffer[256];
int i;
for(i = 0; i < m_linkNum; i++) {
DEntity e("info_train_spline_main");
sprintf( buffer, "%s_pt%i", m_linkName, i );
e.AddEPair( "targetname", buffer );
sprintf( buffer, "0 %i 0", i * 64 );
e.AddEPair( "origin", buffer );
if(i != m_linkNum-1) {
sprintf( buffer, "%s_pt%i", m_linkName, i+1 );
e.AddEPair( "target", buffer );
sprintf( buffer, "%s_ctl%i", m_linkName, i );
e.AddEPair( "control", buffer );
}
e.BuildInRadiant( FALSE );
}
for(i = 0; i < m_linkNum-1; i++) {
DEntity e("info_train_spline_control");
sprintf( buffer, "%s_ctl%i", m_linkName, i );
e.AddEPair( "targetname", buffer );
sprintf( buffer, "0 %i 0", (i * 64) + 32);
e.AddEPair( "origin", buffer );
e.BuildInRadiant( FALSE );
}
}
void DTreePlanter::SelectChain( void ) {
/* char buffer[256];
for(int i = 0; i < m_linkNum; i++) {
DEntity e("info_train_spline_main");
sprintf( buffer, "%s_pt%i", m_linkName, i );
e.AddEPair( "targetname", buffer );
sprintf( buffer, "0 %i 0", i * 64 );
e.AddEPair( "origin", buffer );
if(i != m_linkNum-1) {
sprintf( buffer, "%s_pt%i", m_linkName, i+1 );
e.AddEPair( "target", buffer );
sprintf( buffer, "%s_ctl%i", m_linkName, i );
e.AddEPair( "control", buffer );
}
e.BuildInRadiant( FALSE );
}
for(int i = 0; i < m_linkNum-1; i++) {
DEntity e("info_train_spline_control");
sprintf( buffer, "%s_ctl%i", m_linkName, i );
e.AddEPair( "targetname", buffer );
sprintf( buffer, "0 %i 0", (i * 64) + 32);
e.AddEPair( "origin", buffer );
e.BuildInRadiant( FALSE );
}*/
}

View file

@ -0,0 +1,219 @@
/*
BobToolz plugin for GtkRadiant
Copyright (C) 2001 Gordon Biggans
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __DTREE_H__
#define __DTREE_H__
#define MAX_QPATH 64
typedef struct treeModel_s {
char name[MAX_QPATH];
} treeModel_t;
#define MAX_TP_MODELS 256
class DTreePlanter : public IWindowListener {
public:
virtual bool OnMouseMove(guint32 nFlags, gdouble x, gdouble y);
virtual bool OnLButtonDown(guint32 nFlags, gdouble x, gdouble y);
virtual bool OnMButtonDown(guint32 nFlags, gdouble x, gdouble y);
virtual bool OnRButtonDown(guint32 nFlags, gdouble x, gdouble y);
virtual bool OnLButtonUp(guint32 nFlags, gdouble x, gdouble y);
virtual bool OnMButtonUp(guint32 nFlags, gdouble x, gdouble y);
virtual bool OnRButtonUp(guint32 nFlags, gdouble x, gdouble y);
virtual bool OnKeyPressed(char *s) { return false; }
virtual bool Paint() { return true; }
virtual void Close() { }
DTreePlanter() {
m_refCount = 1;
m_hooked = false;
m_XYWrapper = NULL;
m_numModels = 0;
m_offset = 0;
m_maxPitch = 0;
m_minPitch = 0;
m_maxYaw = 0;
m_minYaw = 0;
m_setAngles = false;
m_useScale = false;
m_autoLink = false;
m_linkNum = 0;
Register();
m_world.LoadSelectedBrushes();
char buffer[256];
GetFilename( buffer, "bt/tp_ent.txt" );
FILE* file = fopen( buffer, "rb" );
if(file) {
fseek( file, 0, SEEK_END );
int len = ftell( file );
fseek( file, 0, SEEK_SET );
if(len) {
char* buf = new char[len+1];
buf[len] = '\0';
// parser will do the cleanup, dont delete.
fread( buf, len, 1, file );
CScriptParser parser;
parser.SetScript( buf );
ReadConfig( &parser );
}
fclose( file );
}
}
#define MT(t) !stricmp( pToken, t )
#define GT pToken = pScriptParser->GetToken( true )
#define CT if(!*pToken) { return; }
void ReadConfig( CScriptParser* pScriptParser ) {
const char* GT;
CT;
do {
GT;
if(*pToken == '}') {
break;
}
if(MT("model")) {
if(m_numModels >= MAX_TP_MODELS) {
return;
}
GT; CT;
strncpy( m_trees[m_numModels++].name, pToken, MAX_QPATH );
} else if(MT("link")) {
GT; CT;
strncpy( m_linkName, pToken, MAX_QPATH );
m_autoLink = true;
} else if(MT("entity")) {
GT; CT;
strncpy( m_entType, pToken, MAX_QPATH );
} else if(MT("offset")) {
GT; CT;
m_offset = atoi(pToken);
} else if(MT("pitch")) {
GT; CT;
m_minPitch = atoi(pToken);
GT; CT;
m_maxPitch = atoi(pToken);
m_setAngles = true;
} else if(MT("yaw")) {
GT; CT;
m_minYaw = atoi(pToken);
GT; CT;
m_maxYaw = atoi(pToken);
m_setAngles = true;
} else if(MT("scale")) {
GT; CT;
m_minScale = static_cast<float>(atof(pToken));
GT; CT;
m_maxScale = static_cast<float>(atof(pToken));
m_useScale = true;
} else if(MT("numlinks")) {
GT; CT;
m_linkNum = atoi( pToken );
}
} while( true );
}
virtual ~DTreePlanter() {
UnRegister();
}
virtual void IncRef() { m_refCount++; }
virtual void DecRef() { m_refCount--; if (m_refCount <= 0) delete this; }
void Register() {
if(!m_hooked) {
g_MessageTable.m_pfnHookWindow( this );
m_XYWrapper = g_MessageTable.m_pfnGetXYWndWrapper();
m_hooked = true;
}
}
void UnRegister() {
if(m_hooked) {
g_MessageTable.m_pfnUnHookWindow( this );
m_XYWrapper = NULL;
m_hooked = false;
}
}
bool FindDropPoint(vec3_t in, vec3_t out);
void DropEntsToGround( void );
void MakeChain( void );
void SelectChain( void );
private:
IXYWndWrapper* m_XYWrapper;
DEntity m_world;
treeModel_t m_trees[MAX_TP_MODELS];
int m_refCount;
int m_numModels;
int m_offset;
int m_maxPitch;
int m_minPitch;
int m_maxYaw;
int m_minYaw;
char m_entType[MAX_QPATH];
char m_linkName[MAX_QPATH];
int m_linkNum;
float m_minScale;
float m_maxScale;
bool m_hooked;
bool m_useScale;
bool m_setAngles;
bool m_autoLink;
};
#endif

View file

@ -0,0 +1,185 @@
/*
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
*/
// BobView.cpp: implementation of the DVisDrawer class.
//
//////////////////////////////////////////////////////////////////////
#include "StdAfx.h"
#include "gtkr_list.h"
#include "str.h"
#include "DPoint.h"
#include "DWinding.h"
#include "DVisDrawer.h"
#include "misc.h"
#include "funchandlers.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
DVisDrawer::DVisDrawer()
{
refCount = 1;
m_bHooked = FALSE;
m_list = NULL;
}
DVisDrawer::~DVisDrawer()
{
if(m_bHooked)
UnRegister();
g_VisView = NULL;
}
//////////////////////////////////////////////////////////////////////
// Implementation
//////////////////////////////////////////////////////////////////////
void DVisDrawer::Draw2D(VIEWTYPE vt)
{
if(!m_list)
return;
__QGLTABLENAME.m_pfn_qglPushAttrib(GL_ALL_ATTRIB_BITS);
__QGLTABLENAME.m_pfn_qglDisable(GL_BLEND);
__QGLTABLENAME.m_pfn_qglDisable(GL_LINE_SMOOTH);
__QGLTABLENAME.m_pfn_qglPushMatrix();
switch(vt)
{
case XY:
break;
case XZ:
__QGLTABLENAME.m_pfn_qglRotatef(270.0f, 1.0f, 0.0f, 0.0f);
break;
case YZ:
__QGLTABLENAME.m_pfn_qglRotatef(270.0f, 1.0f, 0.0f, 0.0f);
__QGLTABLENAME.m_pfn_qglRotatef(270.0f, 0.0f, 0.0f, 1.0f);
break;
}
__QGLTABLENAME.m_pfn_qglLineWidth(1.0f);
__QGLTABLENAME.m_pfn_qglColor4f(1.0f, 0.0f, 0.0f, 0.5f);
__QGLTABLENAME.m_pfn_qglEnable(GL_BLEND);
__QGLTABLENAME.m_pfn_qglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
__QGLTABLENAME.m_pfn_qglDisable(GL_POLYGON_SMOOTH);
__QGLTABLENAME.m_pfn_qglDepthFunc(GL_ALWAYS);
//bleh
list<DWinding *>::const_iterator l=m_list->begin();
for(; l != m_list->end(); l++)
{
DWinding* w = *l;
__QGLTABLENAME.m_pfn_qglColor4f(w->clr[0], w->clr[1], w->clr[2], 0.5f);
__QGLTABLENAME.m_pfn_qglBegin(GL_POLYGON);
for(int i = 0; i < w->numpoints; i++) {
__QGLTABLENAME.m_pfn_qglVertex3f((w->p[i])[0], (w->p[i])[1], (w->p[i])[2]);
}
__QGLTABLENAME.m_pfn_qglEnd();
}
__QGLTABLENAME.m_pfn_qglPopMatrix();
__QGLTABLENAME.m_pfn_qglPopAttrib();
}
void DVisDrawer::Draw3D()
{
if(!m_list)
return;
__QGLTABLENAME.m_pfn_qglPushAttrib(GL_ALL_ATTRIB_BITS);
__QGLTABLENAME.m_pfn_qglColor4f(1.0, 0.0, 0.0, 0.5f);
// __QGLTABLENAME.m_pfn_qglHint(GL_FOG_HINT, GL_NICEST);
// __QGLTABLENAME.m_pfn_qglDisable(GL_CULL_FACE);
__QGLTABLENAME.m_pfn_qglDisable(GL_LINE_SMOOTH);
// __QGLTABLENAME.m_pfn_qglPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
// __QGLTABLENAME.m_pfn_qglShadeModel(GL_SMOOTH);
__QGLTABLENAME.m_pfn_qglEnable(GL_BLEND);
__QGLTABLENAME.m_pfn_qglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
__QGLTABLENAME.m_pfn_qglDisable(GL_POLYGON_SMOOTH);
__QGLTABLENAME.m_pfn_qglDepthFunc(GL_ALWAYS);
//bleh
list<DWinding *>::const_iterator l=m_list->begin();
for(; l != m_list->end(); l++)
{
DWinding* w = *l;
__QGLTABLENAME.m_pfn_qglColor4f(w->clr[0], w->clr[1], w->clr[2], 0.5f);
__QGLTABLENAME.m_pfn_qglBegin(GL_POLYGON);
for(int i = 0; i < w->numpoints; i++) {
__QGLTABLENAME.m_pfn_qglVertex3f((w->p[i])[0], (w->p[i])[1], (w->p[i])[2]);
}
__QGLTABLENAME.m_pfn_qglEnd();
}
__QGLTABLENAME.m_pfn_qglPopAttrib();
}
void DVisDrawer::Register()
{
__QGLTABLENAME.m_pfnHookGL2DWindow( this );
__QGLTABLENAME.m_pfnHookGL3DWindow( this );
m_bHooked = TRUE;
}
void DVisDrawer::UnRegister()
{
__QGLTABLENAME.m_pfnUnHookGL2DWindow( this );
__QGLTABLENAME.m_pfnUnHookGL3DWindow( this );
m_bHooked = FALSE;
}
void DVisDrawer::SetList(std::list<DWinding*> *pointList)
{
if(m_list)
ClearPoints();
m_list = pointList;
}
void DVisDrawer::ClearPoints()
{
list<DWinding *>::const_iterator deadPoint=m_list->begin();
for(; deadPoint!=m_list->end(); deadPoint++)
delete *deadPoint;
m_list->clear();
}

View file

@ -0,0 +1,56 @@
/*
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
*/
// DBobView.h: interface for the DBobView class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_VISDRAWER_H__6E36062A_EF0B_11D4_ACF7_004095A18133__INCLUDED_)
#define AFX_VISDRAWER_H__6E36062A_EF0B_11D4_ACF7_004095A18133__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class DVisDrawer :
public IGL2DWindow,
public IGL3DWindow
{
public:
DVisDrawer();
virtual ~DVisDrawer();
protected:
list<DWinding*>* m_list;
int refCount;
public:
void ClearPoints();
void SetList(list<DWinding*>* pointList);
void UnRegister();
void Register();
void Draw3D();
void Draw2D(VIEWTYPE vt);
void IncRef() { refCount++; }
void DecRef() { refCount--; if (refCount <= 0) delete this; }
bool m_bHooked;
};
#endif // !defined(AFX_VISDRAWER_H__6E36062A_EF0B_11D4_ACF7_004095A18133__INCLUDED_)

View file

@ -0,0 +1,486 @@
/*
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
*/
// DWinding.cpp: implementation of the DWinding class.
//
//////////////////////////////////////////////////////////////////////
#include "StdAfx.h"
#include "gtkr_list.h"
#include "DPoint.h"
#include "DWinding.h"
#include "DPlane.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
DWinding::DWinding()
{
numpoints = 0;
p = NULL;
}
DWinding::~DWinding()
{
if(p)
delete[] p;
}
//////////////////////////////////////////////////////////////////////
// Implementation
//////////////////////////////////////////////////////////////////////
#define BOGUS_RANGE 4096
void DWinding::AllocWinding(int points)
{
numpoints = points;
if(p)
delete[] p;
p = new vec3_t[points];
}
vec_t DWinding::WindingArea()
{
vec3_t d1, d2, cross;
vec_t total;
total = 0;
for (int i = 2; i < numpoints ; i++)
{
VectorSubtract (p[i-1], p[0], d1);
VectorSubtract (p[i], p[0], d2);
CrossProduct (d1, d2, cross);
total += 0.5f * VectorLength ( cross );
}
return total;
}
void DWinding::RemoveColinearPoints()
{
vec3_t p2[MAX_POINTS_ON_WINDING];
int nump = 0;
for (int i = 0; i < numpoints; i++)
{
int j = (i+1)%numpoints;
int k = (i+numpoints-1)%numpoints;
vec3_t v1, v2;
VectorSubtract (p[j], p[i], v1);
VectorSubtract (p[i], p[k], v2);
VectorNormalize(v1, v1);
VectorNormalize(v2, v2);
if (DotProduct(v1, v2) < 0.999)
{
VectorCopy (p[i], p2[nump]);
nump++;
}
}
if (nump == numpoints)
return;
AllocWinding(nump);
memcpy (p, p2, nump*sizeof(vec3_t));
}
DPlane* DWinding::WindingPlane()
{
DPlane* newPlane = new DPlane(p[0], p[1], p[2], NULL);
return newPlane;
}
void DWinding::WindingBounds(vec3_t mins, vec3_t maxs)
{
if(numpoints == 0)
return;
VectorCopy(mins, p[0]);
VectorCopy(maxs, p[0]);
for (int i = 1; i < numpoints ;i++)
{
for (int j = 0; j < 3; j++)
{
vec_t v = p[i][j];
if (v < mins[j])
mins[j] = v;
if (v > maxs[j])
maxs[j] = v;
}
}
}
void DWinding::WindingCentre(vec3_t centre)
{
VectorCopy (vec3_origin, centre);
for (int i = 0; i < numpoints; i++)
VectorAdd (p[i], centre, centre);
float scale = 1.0f/numpoints;
VectorScale (centre, scale, centre);
}
DWinding* DWinding::CopyWinding()
{
DWinding* c = new DWinding;
c->AllocWinding(numpoints);
memcpy (c->p, p, numpoints*sizeof(vec3_t));
return c;
}
int DWinding::WindingOnPlaneSide(vec3_t normal, vec_t dist)
{
bool front = FALSE;
bool back = FALSE;
for (int i = 0; i < numpoints; i++)
{
vec_t d = DotProduct (p[i], normal) - dist;
if (d < -ON_EPSILON)
{
if (front)
return SIDE_CROSS;
back = TRUE;
continue;
}
if (d > ON_EPSILON)
{
if (back)
return SIDE_CROSS;
front = TRUE;
continue;
}
}
if (back)
return SIDE_BACK;
if (front)
return SIDE_FRONT;
return SIDE_ON;
}
void DWinding::CheckWinding()
{
vec_t *p1, *p2;
vec_t edgedist;
vec3_t dir, edgenormal;
if (numpoints < 3)
Sys_Printf ("CheckWinding: %i points", numpoints);
vec_t area = WindingArea();
if (area < 1)
Sys_Printf ("CheckWinding: %f area", area);
DPlane* wPlane = WindingPlane ();
int i;
for (i = 0; i < numpoints; i++)
{
p1 = p[i];
int j;
for (j = 0; j < 3; j++)
if (p1[j] > BOGUS_RANGE || p1[j] < -BOGUS_RANGE)
Sys_Printf ("CheckFace: BUGUS_RANGE: %f", p1[j]);
j = i + 1 == numpoints ? 0 : i + 1;
// check the point is on the face plane
vec_t d = DotProduct (p1, wPlane->normal) - wPlane->_d;
if (d < -ON_EPSILON || d > ON_EPSILON)
Sys_Printf ("CheckWinding: point off plane");
// check the edge isnt degenerate
p2 = p[j];
VectorSubtract (p2, p1, dir);
if (VectorLength (dir) < ON_EPSILON)
Sys_Printf ("CheckWinding: degenerate edge");
CrossProduct (wPlane->normal, dir, edgenormal);
VectorNormalize (edgenormal, edgenormal);
edgedist = DotProduct (p1, edgenormal);
// all other points must be on front side
for (j = 0 ; j < numpoints ; j++)
{
if (j == i)
continue;
d = DotProduct (p[j], edgenormal);
if (d > (edgedist + ON_EPSILON))
Sys_Printf ("CheckWinding: non-convex");
}
}
delete wPlane;
}
DWinding* DWinding::ReverseWinding()
{
DWinding* c = new DWinding;
c->AllocWinding(numpoints);
for (int i = 0; i < numpoints ; i++)
VectorCopy (p[numpoints-1-i], c->p[i]);
return c;
}
bool DWinding::ChopWindingInPlace(DPlane* chopPlane, vec_t epsilon)
{
vec_t dists[MAX_POINTS_ON_WINDING+4];
int sides[MAX_POINTS_ON_WINDING+4];
int counts[3];
vec_t *p1, *p2;
vec3_t mid;
counts[0] = counts[1] = counts[2] = 0;
// determine sides for each point
int i;
for (i = 0; i < numpoints; i++)
{
vec_t dot = DotProduct (p[i], chopPlane->normal);
dot -= chopPlane->_d;
dists[i] = dot;
if (dot > epsilon)
sides[i] = SIDE_FRONT;
else if (dot < -epsilon)
sides[i] = SIDE_BACK;
else
sides[i] = SIDE_ON;
counts[sides[i]]++;
}
sides[i] = sides[0];
dists[i] = dists[0];
if (!counts[0])
{
delete this;
return FALSE;
}
if (!counts[1])
return TRUE;
int maxpts = numpoints+4; // cant use counts[0]+2 because
// of fp grouping errors
DWinding* f = new DWinding;
f->AllocWinding(maxpts);
f->numpoints = 0;
for (i = 0; i < numpoints; i++)
{
p1 = p[i];
if (sides[i] == SIDE_ON)
{
VectorCopy (p1, f->p[f->numpoints]);
f->numpoints++;
continue;
}
if (sides[i] == SIDE_FRONT)
{
VectorCopy (p1, f->p[f->numpoints]);
f->numpoints++;
}
if (sides[i+1] == SIDE_ON || sides[i+1] == sides[i])
continue;
// generate a split point
p2 = p[(i+1)%numpoints];
vec_t dot = dists[i] / (dists[i]-dists[i+1]);
for (int j = 0; j < 3; j++)
{
if (chopPlane->normal[j] == 1)
mid[j] = chopPlane->_d;
else if (chopPlane->normal[j] == -1)
mid[j] = -chopPlane->_d;
else
mid[j] = p1[j] + dot*(p2[j]-p1[j]);
}
VectorCopy (mid, f->p[f->numpoints]);
f->numpoints++;
}
if (f->numpoints > maxpts)
Sys_Printf ("ClipWinding: points exceeded estimate");
if (f->numpoints > MAX_POINTS_ON_WINDING)
Sys_Printf ("ClipWinding: MAX_POINTS_ON_WINDING");
delete[] p;
p = f->p;
f->p = NULL;
delete f;
return TRUE;
}
void DWinding::ClipWindingEpsilon(DPlane* chopPlane, vec_t epsilon, DWinding **front, DWinding **back)
{
vec_t dists[MAX_POINTS_ON_WINDING+4];
int sides[MAX_POINTS_ON_WINDING+4];
int counts[3];
vec_t *p1, *p2;
vec3_t mid;
counts[0] = counts[1] = counts[2] = 0;
// determine sides for each point
int i;
for (i = 0; i < numpoints; i++)
{
vec_t dot = -chopPlane->DistanceToPoint(p[i]);
dists[i] = dot;
if (dot > epsilon)
sides[i] = SIDE_FRONT;
else if (dot < -epsilon)
sides[i] = SIDE_BACK;
else
sides[i] = SIDE_ON;
counts[sides[i]]++;
}
sides[i] = sides[0];
dists[i] = dists[0];
*front = *back = NULL;
if (!counts[0])
{
*back = CopyWinding();
return;
}
if (!counts[1])
{
*front = CopyWinding();
return;
}
int maxpts = numpoints+4; // cant use counts[0]+2 because
// of fp grouping errors
DWinding* f = new DWinding;
DWinding* b = new DWinding;
f->AllocWinding(maxpts);
f->numpoints = 0;
b->AllocWinding(maxpts);
b->numpoints = 0;
*front = f;
*back = b;
for (i = 0; i < numpoints ; i++)
{
p1 = p[i];
if (sides[i] == SIDE_ON)
{
VectorCopy (p1, f->p[f->numpoints]);
f->numpoints++;
VectorCopy (p1, b->p[b->numpoints]);
b->numpoints++;
continue;
}
if (sides[i] == SIDE_FRONT)
{
VectorCopy (p1, f->p[f->numpoints]);
f->numpoints++;
}
if (sides[i] == SIDE_BACK)
{
VectorCopy (p1, b->p[b->numpoints]);
b->numpoints++;
}
if (sides[i+1] == SIDE_ON || sides[i+1] == sides[i])
continue;
// generate a split point
p2 = p[(i+1)%numpoints];
vec_t dot = dists[i] / (dists[i]-dists[i+1]);
for (int j = 0; j < 3; j++)
{
if (chopPlane->normal[j] == 1)
mid[j] = chopPlane->_d;
else if (chopPlane->normal[j] == -1)
mid[j] = -chopPlane->_d;
else
mid[j] = p1[j] + dot*(p2[j]-p1[j]);
}
VectorCopy (mid, f->p[f->numpoints]);
f->numpoints++;
VectorCopy (mid, b->p[b->numpoints]);
b->numpoints++;
}
if (f->numpoints > maxpts || b->numpoints > maxpts)
Sys_Printf ("ClipWinding: points exceeded estimate");
if (f->numpoints > MAX_POINTS_ON_WINDING || b->numpoints > MAX_POINTS_ON_WINDING)
Sys_Printf ("ClipWinding: MAX_POINTS_ON_WINDING");
}
bool DWinding::ChopWinding(DPlane* chopPlane)
{
DWinding *f, *b;
ClipWindingEpsilon (chopPlane, (float)ON_EPSILON, &f, &b);
if (b)
delete (b);
if(!f)
{
delete this;
return FALSE;
}
delete[] p;
p = f->p;
f->p = NULL;
numpoints = f->numpoints;
delete f;
return TRUE;
}

View file

@ -0,0 +1,68 @@
/*
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
*/
// DWinding.h: interface for the DWinding class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_DWINDING_H__35B2C524_F0A7_11D4_ACF7_004095A18133__INCLUDED_)
#define AFX_DWINDING_H__35B2C524_F0A7_11D4_ACF7_004095A18133__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class DPlane;
class DWinding
{
public:
DWinding();
virtual ~DWinding();
void AllocWinding(int points);
bool ChopWinding(DPlane* chopPlane);
bool ChopWindingInPlace(DPlane* chopPlane, vec_t ON_EPSILON);
void ClipWindingEpsilon(DPlane* chopPlane, vec_t epsilon, DWinding** front, DWinding** back);
void CheckWinding();
void WindingCentre(vec3_t centre);
void WindingBounds(vec3_t mins, vec3_t maxs);
void RemoveColinearPoints();
DWinding* ReverseWinding();
DWinding* CopyWinding();
DPlane* WindingPlane();
int WindingOnPlaneSide(vec3_t normal, vec_t dist);
vec_t WindingArea();
// members
int numpoints;
vec3_t* p;
vec3_t clr;
};
#define MAX_POINTS_ON_WINDING 64
#define ON_EPSILON 0.01
#endif // !defined(AFX_DWINDING_H__35B2C524_F0A7_11D4_ACF7_004095A18133__INCLUDED_)

View file

@ -0,0 +1,286 @@
/*
BobToolz plugin for GtkRadiant
Copyright (C) 2001 Gordon Biggans
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "StdAfx.h"
#include "ScriptParser.h"
CScriptParser::CScriptParser(void):
m_pScript(NULL),
m_pScriptSection(NULL),
m_pLastScriptSection(NULL),
m_pToken(NULL) {
ClearBuffer();
}
CScriptParser::~CScriptParser(void) {
ClearBuffer();
}
void CScriptParser::ClearBuffer(void) {
if(m_pScript) {
delete[] m_pScript;
m_pScript = NULL;
}
if(m_pToken) {
delete[] m_pToken;
m_pToken = NULL;
}
m_pScriptSection = NULL;
m_pLastScriptSection = NULL;
memset(m_breakChars, 0, sizeof(m_breakChars));
}
const char* CScriptParser::MakeToken(const char* pToken) {
if(m_pToken) {
delete[] m_pToken;
m_pToken = NULL;
}
if(!pToken) {
pToken = "";
}
int len = static_cast<int>(strlen(pToken));
m_pToken = new char[len + 1];
m_pToken[len] = '\0';
strcpy(m_pToken, pToken);
return m_pToken;
}
#define MAX_TOKEN_STRING 1024
// Should NEVER return NULL
const char* CScriptParser::GetToken(bool bAllowLinebreaks) {
int c = 0, len;
char token[MAX_TOKEN_STRING];
bool bNewLines = false;
m_pLastScriptSection = m_pScriptSection;
len = 0;
*token = '\0';
if(!m_pScript || !m_pScriptSection) {
return MakeToken(token);
}
while ( true ) {
SkipWhitespace( &bNewLines );
if ( !*m_pScriptSection ) {
return MakeToken(token);
}
if ( bNewLines && !bAllowLinebreaks ) {
return MakeToken(token);
}
c = *m_pScriptSection;
if ( c == '/' && m_pScriptSection[1] == '/' ) { // C style comments
m_pScriptSection += 2;
while (*m_pScriptSection && *m_pScriptSection != '\n') {
m_pScriptSection++;
}
} else if ( c=='/' && m_pScriptSection[1] == '*' ) { // C++ style comments
m_pScriptSection += 2;
while ( *m_pScriptSection && ( *m_pScriptSection != '*' || m_pScriptSection[1] != '/' ) ) {
m_pScriptSection++;
}
if ( *m_pScriptSection ) {
m_pScriptSection += 2;
}
} else {
break;
}
}
if (c == '\"') {
m_pScriptSection++;
while ( true ) {
c = *m_pScriptSection++;
if (c=='\"' || !c) {
token[len] = 0;
return MakeToken(token);
}
if (len < MAX_TOKEN_STRING) {
token[len] = c;
len++;
}
}
}
do {
if(len > 0 && IsBreakChar(*m_pScriptSection)) {
break;
}
if (len < MAX_TOKEN_STRING) {
token[len] = c;
len++;
}
m_pScriptSection++;
if(IsBreakChar(c)) {
break;
}
c = *m_pScriptSection;
} while (c > 32);
if (len == MAX_TOKEN_STRING) {
len = 0;
}
token[len] = 0;
return MakeToken(token);
}
void CScriptParser::SkipWhitespace(bool* pbNewLines) {
int c;
if(!m_pScript || !m_pScriptSection) {
return;
}
while( (c = *m_pScriptSection) <= ' ') {
if( !c ) {
return;
}
if( c == '\n' ) {
*pbNewLines = true;
}
m_pScriptSection++;
}
}
void CScriptParser::SkipBracedSection(void) {
const char *token;
int depth;
depth = 0;
do {
token = GetToken( true );
if( token[1] == 0 ) {
if( *token == '{' ) {
depth++;
} else if( *token == '}' ) {
depth--;
}
}
} while( depth && *m_pScriptSection );
}
void CScriptParser::SkipRestOfLine(void) {
char *p;
int c;
p = m_pScriptSection;
while ( (c = *p++) != 0 ) {
if ( c == '\n' ) {
break;
}
}
m_pScriptSection = p;
}
void CScriptParser::UndoGetToken(void) {
if(!m_pLastScriptSection) {
return;
}
m_pScriptSection = m_pLastScriptSection;
m_pLastScriptSection = NULL;
}
void CScriptParser::ResetParseSession(void) {
if(!m_pScript) {
return;
}
m_pScriptSection = m_pScript;
m_pLastScriptSection = NULL;
}
char* CScriptParser::GetBufferCopy(void) {
if(!m_pScript) {
return NULL;
}
int len = static_cast<int>(strlen(m_pScript));
char* pBuffer = new char[len + 1];
strcpy(pBuffer, m_pScript);
return pBuffer;
}
int CScriptParser::GetTokenOffset(void) {
if(!m_pScript || !m_pScriptSection) {
return 0;
}
return static_cast<int>(m_pScriptSection - m_pScript);
}
void CScriptParser::LoadScript(const char* pScript) {
ClearBuffer();
int len = static_cast<int>(strlen(pScript));
if(len <= 0) {
return;
}
m_pScript = new char[len + 1];
m_pScript[len] = '\0';
strcpy(m_pScript, pScript);
m_pScriptSection = m_pScript;
}
void CScriptParser::AddBreakChar(char c) {
for(int i = 0; i < SP_MAX_BREAKCHARS; i++) {
if(!m_breakChars[i]) {
m_breakChars[i] = c;
return;
}
}
// TODO: Error: max break chars hit
}
bool CScriptParser::IsBreakChar(char c) {
for(int i = 0; i < SP_MAX_BREAKCHARS; i++) {
if(!m_breakChars[i]) {
return false;
}
if(m_breakChars[i] == c) {
return true;
}
}
return false;
}
void CScriptParser::SetScript(char* pScript) {
ClearBuffer();
int len = static_cast<int>(strlen(pScript));
if(len <= 0) {
return;
}
m_pScript = pScript;
m_pScriptSection = m_pScript;
}

View file

@ -0,0 +1,61 @@
/*
BobToolz plugin for GtkRadiant
Copyright (C) 2001 Gordon Biggans
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _SCRIPTPARSER_H_
#define _SCRIPTPARSER_H_
//#include "interfaces/IScriptParser.h"
#define SP_MAX_BREAKCHARS 16
class CScriptParser //: public IScriptParser
{
public:
CScriptParser(void);
~CScriptParser(void);
private:
char m_breakChars[SP_MAX_BREAKCHARS];
char* m_pScript;
char* m_pScriptSection;
char* m_pLastScriptSection;
char* m_pToken;
void SkipWhitespace(bool* pbNewLines);
void ClearBuffer(void);
const char* MakeToken(const char* pToken);
bool IsBreakChar(char c);
public:
const char* GetToken(bool bAllowLinebreaks);
void SkipBracedSection(void);
void SkipRestOfLine(void);
void UndoGetToken(void);
void ResetParseSession(void);
char* GetBufferCopy(void);
int GetTokenOffset(void);
void LoadScript(const char* pScript);
void SetScript(char* pScript);
void AddBreakChar(char c);
private:
};
#endif

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