+Unles otherwise stated, this package is licensed according to the following
+terms and conditions:
+
The Simplified BSD License
Copyright (c) 2009, Charles McGarvey
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+------------------------------------------------------------------------------
+
+The "yajl" library is statically linked under the following terms and
+conditions:
+
+Copyright 2007-2009, Lloyd Hilaiel.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+ 3. Neither the name of Lloyd Hilaiel nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+------------------------------------------------------------------------------
+
+The "fastevents" code is statically linked, unmodified, under the following
+terms and conditions:
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, 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.
+
+[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.
+\f
+ 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.
+\f
+ 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.
+\f
+ 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.
+\f
+ 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.
+\f
+ 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.
+\f
+ 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.
+\f
+ 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.
+\f
+ 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
+\f
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. 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 library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
+
--- /dev/null
+# Doxyfile 1.5.8
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = Yoink
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY =
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF =
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = YES
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 8
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it parses.
+# With this tag you can assign which parser to use for a given extension.
+# Doxygen has a built-in mapping, but you can override or extend it using this tag.
+# The format is ext=language, where ext is a file extension, and language is one of
+# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP,
+# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat
+# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran),
+# use: inc=Fortran f=C
+
+EXTENSION_MAPPING =
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = NO
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = NO
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page.
+# This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = src
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS =
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS =
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS =
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+# If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis.
+# Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match.
+# The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = YES
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code.
+# Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = doc/doxygen
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = NO
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE =
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add.
+# For more information please see
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME =
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's
+# filter section matches.
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS =
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file.
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 4
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader.
+# This is useful
+# if you want to understand what is going on.
+# On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+#
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+#
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = YES
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = YES
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = YES
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = YES
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Options related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
-SUBDIRS = src
+SUBDIRS = yajl src
original resources are provided under the zlib/libpng License. See COPYING
for complete details.
+External Dependencies:
+
+GL
+SDL
+SDL_image
+boost
+
AC_PREREQ(2.60)
AC_INIT([yoink],[0.1],[chaz@dogcows.com])
AM_INIT_AUTOMAKE
-AC_CONFIG_SRCDIR([src/yoink.cc])
+AC_CONFIG_SRCDIR([src/YoinkApp.cc])
+AC_PROG_CC
AC_PROG_CXX
-AC_PROG_LIBTOOL
+AC_PROG_RANLIB
AC_PROG_INSTALL
-
AM_PROG_CC_C_O
+
+AC_HEADER_STDC
+
+AC_SEARCH_LIBS([glClear], [GL], [have_opengl=yes])
+if test ! "x${have_opengl}" = xyes
+then
+ AC_MSG_ERROR([libGL is required])
+fi
+
+AC_SEARCH_LIBS([SDL_Init], [SDL], [have_sdl=yes])
+if test ! "x${have_sdl}" = xyes
+then
+ AC_MSG_ERROR([libSDL is required])
+fi
+
+AC_SEARCH_LIBS([IMG_Load], [SDL_image], [have_sdlimage=yes])
+if test ! "x${have_sdlimage}" = xyes
+then
+ AC_MSG_ERROR([libSDL_image is required])
+fi
+
+AC_SEARCH_LIBS([clock_gettime], [rt], [have_librt=yes])
+if test "x${have_librt}" = xyes
+then
+ AC_DEFINE([HAVE_LIBRT], 1, [high-resolution timer enabled])
+fi
+
AC_CONFIG_FILES([Makefile
+ yajl/Makefile
src/Makefile])
AC_OUTPUT
current=`pwd`
cd /
find "$current" \
--iname "*.cc" -o \
--iname "*.h" |sed '/ / s/^\(.*\)/"\1"/' >"$current/cscope.files"
+-iname "*.c" -o \
+-iname "*.h" -o \
+-iname "*.cc" -o \
+-iname "*.hh" |sed '/ / s/^\(.*\)/"\1"/' >"$current/cscope.files"
cd "$current"
--- /dev/null
+<?xml version="1.0" standalone="yes"?>
+<animation name="AlienWarrior" texture="AlienWarrior">
+ <sequence name="Stand" type="Stand" delay="1">
+ <frame index="0" duration="2"/>
+ <frame index="1" duration="0.25"/>
+ <frame index="2" duration="2"/>
+ <frame index="1" duration="0.25"/>
+ </sequence>
+
+ <sequence name="Run" type="Run" delay="0.25">
+ <frame index="3"/>
+ <frame index="4"/>
+ <frame index="5"/>
+ <frame index="6"/>
+ </sequence>
+
+ <sequence name="StopRunning" type="Stand" delay="10" loop="false" next="Stand">
+ <frame index="7"/>
+ </sequence>
+
+ <sequence name="Jump" type="Jump" delay="0.25" next="FlyDiagonallyUp">
+ <frame index="17"/>
+ </sequence>
+
+ <sequence name="Land" type="Stand" delay="1" loop="false" next="Stand">
+ <frame index="13"duration="0.25"/>
+ </sequence>
+
+ <sequence name="FlyDiagonallyUp" type="Fly" delay="0.1">
+ <frame index="18"/>
+ </sequence>
+
+ <sequence name="FlyDiagonallyDown" type="Fly" delay="0.1">
+ <frame index="19"/>
+ </sequence>
+
+ <sequence name="FlyStraightUp" type="Fly" delay="0.1">
+ <frame index="19"/>
+ </sequence>
+
+ <sequence name="FlyHorizontally" type="Fly">
+ <frame index="3"/>
+ </sequence>
+
+ <sequence name="Punch" type="Attack" delay="0.2">
+ <frame index="8"/>
+ <frame index="9"/>
+ </sequence>
+
+ <sequence name="StartFiring" type="Attack" delay="0.1" next="Fire">
+ <frame index="0"/>
+ <frame index="8"/>
+ </sequence>
+
+ <sequence name="Fire" type="Attack" delay="1">
+ <frame index="10" duration="0.2"/>
+ <frame index="11" duration="0.2"/>
+ </sequence>
+
+ <sequence name="StopFiring" type="Attack" delay="0.1" next="Stand">
+ <frame index="8"/>
+ <frame index="0"/>
+ </sequence>
+
+ <sequence name="KnockedDown" type="Hit" delay="0.1" loop="false">
+ <frame index="16"/>
+ <frame index="15"/>
+ </sequence>
+
+ <sequence name="Flattened" type="Hit" delay="1">
+ <frame index="13"/>
+ </sequence>
+</animation>
--- /dev/null
+<?xml version="1.0" standalone="yes"?> \r<animation name="BigExplosion" texture="BigExplosion">\r <sequence name="BigExplosion" delay="0.1" loop="false">\r <frame index="0"/>\r <frame index="1"/>\r <frame index="2"/>\r <frame index="3"/>\r <frame index="4"/>\r <frame index="5"/>\r </sequence>\r</animation>\r
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" standalone="yes"?> \r<animation name="Bonuses" texture="Bonuses">\r <sequence name="SmallHealth" delay="0.1">\r <frame index="0"/>\r <frame index="1"/>\r <frame index="2"/>\r <frame index="1"/>\r </sequence>\r\r <sequence name="LargeHealth" delay="0.1">\r <frame index="3"/>\r <frame index="4"/>\r <frame index="5"/>\r <frame index="4"/>\r </sequence>\r\r <sequence name="SmallRedPotion" delay="0.1">\r <frame index="6"/>\r <frame index="7"/>\r <frame index="8"/>\r <frame index="7"/>\r </sequence>\r\r <sequence name="SmallBluePotion" delay="0.1">\r <frame index="9"/>\r <frame index="10"/>\r <frame index="11"/>\r <frame index="10"/>\r </sequence>\r\r <sequence name="FirstAidKit" delay="1.0">\r <frame index="12"/>\r </sequence>\r\r <sequence name="AlienFirstAidKit" delay="1.0">\r <frame index="13"/>\r </sequence>\r\r <sequence name="Cake" delay="1.0">\r <frame index="14"/>\r </sequence>\r\r <sequence name="FizzyDrink" delay="1.0">\r <frame index="15"/>\r </sequence>\r\r <sequence name="Cheese" delay="1.0">\r <frame index="16"/>\r </sequence>\r\r <sequence name="Chocolate" delay="1.0">\r <frame index="17"/>\r </sequence>\r\r <sequence name="MilkBottle" delay="1.0">\r <frame index="18"/>\r </sequence>\r\r <sequence name="OneSadCookie" delay="1.0">\r <frame index="19"/>\r </sequence>\r</animation>\r
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" standalone="yes"?> \r<animation name="Bullet" texture="Particles">\r <sequence name="Punch" delay="1.0">\r <!-- This punch sequence is highly bogus. Should be possible to have a sprite with no animation -->\r\r <frame index="31"/>\r </sequence>\r\r <sequence name="SmallBullet" delay="0.05">\r <frame index="16"/>\r <frame index="17"/>\r </sequence>\r\r <sequence name="MediumBullet" delay="0.05">\r <frame index="17"/>\r <frame index="18"/>\r </sequence>\r\r <sequence name="SmallFireball" delay="0.05">\r <frame index="0"/>\r <frame index="1"/>\r </sequence>\r\r <sequence name="MediumFireball" delay="0.05">\r <frame index="2"/>\r <frame index="1"/>\r </sequence>\r\r <sequence name="LargeFireball" delay="0.05">\r <frame index="21"/>\r <frame index="2"/>\r </sequence>\r</animation>\r
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" standalone="yes"?> \r<animation name="Effects" texture="Particles">\r <sequence name="Fireball" delay="0.1">\r <frame index="0"/>\r <frame index="1"/>\r <frame index="2"/>\r <frame index="1"/>\r <frame index="0"/>\r </sequence>\r\r <sequence name="Smoke" delay="0.05" loop="false">\r <frame index="4"/>\r <frame index="5"/>\r <frame index="6"/>\r </sequence>\r\r <sequence name="GreenDiamond" delay="0.05">\r <frame index="7"/>\r <frame index="8"/>\r <frame index="9"/>\r <frame index="10"/>\r <frame index="11"/>\r </sequence>\r\r <sequence name="ChargeParticle" delay="0.03" loop="false">\r <frame index="12"/>\r <frame index="13"/>\r <frame index="1"/>\r <frame index="3"/>\r <frame index="14"/>\r <frame index="13"/>\r <frame index="12"/>\r </sequence>\r\r <sequence name="Poof" delay="0.05" loop="false">\r <frame index="23"/>\r <frame index="24"/>\r <frame index="25"/>\r <frame index="26"/>\r <frame index="27"/>\r </sequence>\r</animation>\r
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" standalone="yes"?> \r<animation name="Heroine" texture="Heroine">\r <sequence name="Stand" type="Stand" delay="1">\r <frame index="1" duration="4.0"/>\r\r <frame index="3" duration="0.1"/>\r <frame index="1" duration="0.1"/>\r <frame index="3" duration="0.1"/>\r\r <frame index="1" duration="2.0"/>\r\r <frame index="0" duration="2.0"/>\r <frame index="1" duration="0.1"/>\r <frame index="2" duration="2.0"/>\r\r <frame index="1" duration="3.0"/>\r\r <frame index="3" duration="0.1"/>\r <frame index="1" duration="0.1"/>\r <frame index="3" duration="0.1"/>\r\r <frame index="1" duration="2.0"/>\r\r <frame index="0" duration="4.0"/>\r <frame index="1" duration="0.1"/>\r <frame index="2" duration="3.0"/>\r <frame index="1" duration="0.1"/>\r <frame index="0" duration="1.0"/>\r <frame index="1" duration="2.0"/>\r\r <frame index="3" duration="0.1"/>\r <frame index="1" duration="0.1"/>\r <frame index="3" duration="0.1"/>\r </sequence>\r\r <sequence name="Blink" type="Stand" delay="0.25" next="Stand">\r <frame index="3" duration="0.25"/>\r </sequence>\r\r <sequence name="Run" type="Run" delay="0.25">\r <frame index="4"/>\r <frame index="5"/>\r <frame index="6"/>\r <frame index="7"/>\r </sequence>\r\r <sequence name="StopRunning" type="Stand" delay="10" loop="false" next="Stand">\r <frame index="8"/>\r </sequence>\r\r <sequence name="Jump" type="Jump" delay="0.25" next="FlyDiagonallyUp">\r <frame index="9" duration="0.25"/>\r </sequence>\r\r <sequence name="Land" type="Stand" delay="0.5" next="StopRunning">\r <frame index="9" duration="0.25"/>\r </sequence>\r\r <sequence name="FlyDiagonallyUp" type="Fly" delay="0.1">\r <frame index="10"/>\r <frame index="11"/>\r </sequence>\r\r <sequence name="FlyDiagonallyDown" type="Fly" delay="0.1">\r <frame index="12"/>\r <frame index="13"/>\r </sequence>\r\r <sequence name="FlyStraightUp" type="Fly" delay="0.1">\r <frame index="0"/>\r </sequence>\r\r <sequence name="FlyHorizontally" type="Fly" delay="0.1">\r <frame index="4"/>\r <frame index="14"/>\r </sequence>\r\r <sequence name="KnockedDown" type="Hit" delay="0.1">\r <frame index="17"/>\r <frame index="18"/>\r </sequence>\r\r <sequence name="Flattened" type="Hit" delay="1.0">\r <frame index="19"/>\r </sequence>\r\r <sequence name="StartCharging" type="Charge" delay="0.2" next="Charge">\r <frame index="21"/>\r </sequence>\r\r <sequence name="Charge" type="Charge" delay="0.2" loop="false">\r <frame index="22"/>\r </sequence>\r\r <sequence name="FireCharge" type="Charge" delay="0.2">\r <frame index="23"/>\r </sequence>\r</animation>\r
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" standalone="yes"?> \r<animation name="Jetbot" texture="Jetbot">\r <sequence name="Stand" type="Stand" delay="1">\r <frame index="0" duration="2"/>\r <frame index="1" duration="0.25"/>\r <frame index="2" duration="2"/>\r <frame index="1" duration="0.25"/>\r </sequence>\r\r <sequence name="Run" type="Run" delay="0.1">\r <frame index="3"/>\r <frame index="4"/>\r </sequence>\r\r <sequence name="StopRunning" type="Stand" delay="10" loop="false" next="Stand">\r <frame index="6"/>\r </sequence>\r\r <sequence name="Jump" type="Jump" delay="0.25" next="FlyDiagonallyUp">\r <frame index="6"/>\r </sequence>\r\r <sequence name="Land" type="Stand" delay="1" loop="false" next="Stand">\r <frame index="6"duration="0.25"/>\r <frame index="0"duration="0.25"/>\r </sequence>\r\r <sequence name="FlyDiagonallyUp" type="Fly" delay="0.1">\r <frame index="3"/>\r <frame index="4"/>\r </sequence>\r\r <sequence name="FlyDiagonallyDown" type="Fly" delay="0.1">\r <frame index="3"/>\r <frame index="4"/>\r </sequence>\r\r <sequence name="FlyStraightUp" type="Fly" delay="0.1">\r <frame index="3"/>\r <frame index="4"/>\r </sequence>\r\r <sequence name="FlyHorizontally" type="Fly" delay="0.1">\r <frame index="3"/>\r <frame index="4"/>\r </sequence>\r\r <sequence name="Punch" type="Attack" delay="0.05" next="Stand">\r <frame index="3"/>\r </sequence>\r\r <sequence name="StartFiring" type="Attack" delay="0.1" next="Fire">\r <frame index="3"/>\r </sequence>\r\r <sequence name="Fire" type="Attack" delay="1.0">\r <frame index="3" duration="0.2"/>\r </sequence>\r\r <sequence name="StopFiring" type="Attack" delay="0.1" next="Stand">\r <frame index="3"/>\r </sequence>\r\r <sequence name="KnockedDown" type="Hit" delay="1.0">\r <frame index="5"/>\r </sequence>\r\r <sequence name="Flattened" type="Hit" delay="1.0">\r <frame index="6"/>\r </sequence>\r</animation>\r
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" standalone="yes"?> \r<animation name="RobotTrooper" texture="RobotTrooper">\r <sequence name="Stand" type="Stand" delay="1">\r <frame index="0" duration="2"/>\r <frame index="1" duration="0.25"/>\r <frame index="2" duration="2"/>\r <frame index="1" duration="0.25"/>\r </sequence>\r\r <sequence name="Run" type="Run" delay="0.25">\r <frame index="4"/>\r <frame index="5"/>\r <frame index="6"/>\r <frame index="7"/>\r </sequence>\r\r <sequence name="StopRunning" type="Stand" delay="10" loop="false" next="Stand">\r <frame index="5"/>\r </sequence>\r\r <sequence name="Jump" type="Jump" delay="0.25" next="FlyDiagonallyUp">\r <frame index="17"/>\r </sequence>\r\r <sequence name="Land" type="Stand" delay="1" loop="false" next="Stand">\r <frame index="19"duration="0.25"/>\r <frame index="14"duration="0.25"/>\r </sequence>\r\r <sequence name="FlyDiagonallyUp" type="Fly" delay="0.1">\r <frame index="18"/>\r </sequence>\r\r <sequence name="FlyDiagonallyDown" type="Fly" delay="0.1">\r <frame index="18"/>\r </sequence>\r\r <sequence name="FlyStraightUp" type="Fly" delay="0.1">\r <frame index="18"/>\r </sequence>\r\r <sequence name="FlyHorizontally" type="Fly">\r <frame index="18"/>\r </sequence>\r\r <sequence name="Punch" type="Attack" delay="0.05" next="Stand">\r <frame index="8"/>\r <frame index="9"/>\r <frame index="10"/>\r <frame index="11"/>\r <frame index="12"/>\r <frame index="13"/>\r </sequence>\r\r <sequence name="StartFiring" type="Attack" delay="0.1" next="Fire">\r <frame index="14"/>\r <frame index="15"/>\r <frame index="16"/>\r </sequence>\r\r <sequence name="Fire" type="Attack" delay="1.0">\r <frame index="17" duration="0.2"/>\r <frame index="16" duration="0.2"/>\r </sequence>\r\r <sequence name="StopFiring" type="Attack" delay="0.1" next="Stand">\r <frame index="16"/>\r <frame index="15"/>\r <frame index="14"/>\r </sequence>\r\r <sequence name="KnockedDown" type="Hit" delay="1.0">\r <frame index="18"/>\r </sequence>\r\r <sequence name="Flattened" type="Hit" delay="1.0">\r <frame index="19"/>\r </sequence>\r</animation>\r
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" standalone="yes"?>
+<scene name="Test" playfield_bounds="0 0 -100 1280 500 100"
+ maximum_bounds="-800 0 -300 2400 1000 600">
+
+<!-- Left end tower block -->
+
+ <!-- Front -->
+
+ <reset_transform/>
+ <translate>-5 0 5</translate>
+ <scale>32</scale>
+
+ <texture>TowerBlock1</texture>
+ <tilemap width="5">
+ 2 2 2 2 2
+ 1 0 0 1 0
+ 1 0 0 1 0
+ 1 0 0 1 0
+ 1 0 0 1 0
+ 1 0 0 1 0
+ 1 0 0 1 0
+ 1 0 0 1 0
+ 1 0 0 1 0
+ 1 0 0 1 0
+ 1 0 0 1 0
+ 1 0 0 1 0
+ 1 0 0 1 0
+ 1 0 0 1 0
+ 4 4 4 4 4
+ </tilemap>
+
+ <!-- Right side -->
+
+ <reset_transform/>
+ <rotate axis="y">90</rotate>
+ <translate>0 0 5</translate>
+ <scale>32</scale>
+
+ <texture>TowerBlock1</texture>
+ <tilemap surface_type="right" width="5">
+ 2 2 2 2 2
+ 0 0 0 0 0
+ 0 0 0 0 0
+ 0 0 0 0 0
+ 0 0 0 0 0
+ 0 0 0 0 0
+ 0 0 0 0 0
+ 0 0 0 0 0
+ 0 0 0 0 0
+ 0 0 0 0 0
+ 0 0 0 0 0
+ 0 0 0 0 0
+ 0 0 0 0 0
+ 0 0 0 0 6
+ 4 5 5 5 4
+ </tilemap>
+
+ <!-- Top -->
+
+ <reset_transform/>
+ <rotate axis="x">90</rotate>
+ <translate>-5 15 0</translate>
+ <scale>32</scale>
+
+ <texture>TowerBlock1</texture>
+ <tilemap surface_type="top" width="5">
+ 3 3 3 3 3
+ 3 3 3 3 3
+ 3 3 3 3 3
+ 3 3 3 3 3
+ 3 3 3 3 3
+ </tilemap>
+
+<!-- Leftmost background tower block -->
+
+ <!-- Front -->
+
+ <reset_transform/>
+ <scale>32</scale>
+
+ <texture>TowerBlock1</texture>
+ <tilemap width="7" detail_level="1">
+ 2 2 2 2 2 2 2
+ 0 1 0 0 0 1 0
+ 0 1 0 0 0 1 0
+ 0 1 0 0 6 1 0
+ 0 1 0 0 0 1 0
+ 0 1 0 0 0 1 0
+ 0 1 0 0 0 1 0
+ 4 4 5 5 5 4 4
+ </tilemap>
+
+ <!-- Right side -->
+
+ <reset_transform/>
+ <rotate axis="y">90</rotate>
+ <translate>7 0 0</translate>
+ <scale>32</scale>
+
+ <texture>TowerBlock1</texture>
+ <tilemap width="6" detail_level="1">
+ 2 2 2 2 2 2
+ 0 1 0 0 1 0
+ 0 1 0 0 1 0
+ 0 1 0 0 1 0
+ 0 1 0 0 1 0
+ 0 1 0 0 1 0
+ 0 1 0 0 1 0
+ 4 4 4 4 4 4
+ </tilemap>
+
+ <!-- Top -->
+
+ <reset_transform/>
+ <rotate axis="x">90</rotate>
+ <translate>-2 8 -6</translate>
+ <scale>32</scale>
+
+ <texture>TowerBlock1</texture>
+ <tilemap width="9" detail_level="1">
+ 3 3 3 3 3 3 3 3 3
+ 3 3 3 3 3 3 3 3 3
+ 3 3 3 3 3 3 3 3 3
+ 3 3 3 3 3 3 3 3 3
+ 3 3 3 3 3 3 3 3 3
+ 3 3 3 3 3 3 3 3 3
+ </tilemap>
+
+<!-- Foreground building with pitched roof -->
+
+ <!-- Left wall -->
+
+ <reset_transform/>
+ <rotate axis="y">-90</rotate>
+ <translate>10 0 1</translate>
+ <scale>32</scale>
+
+ <texture>Building</texture>
+ <tilemap surface_type="left" width="4">
+ -1 9 11 -1
+ 9 10 12 11
+ 15 7 7 16
+ 3 5 6 4
+ 3 6 5 4
+ </tilemap>
+
+ <!-- Right wall -->
+
+ <reset_transform/>
+ <rotate axis="y">-90</rotate>
+ <translate>13 0 1</translate>
+ <scale>32</scale>
+
+ <texture>Building</texture>
+ <tilemap surface_type="right" width="4">
+ -1 9 11 -1
+ 9 10 12 11
+ 15 7 7 16
+ 3 5 6 4
+ 3 8 5 4
+ </tilemap>
+
+ <!-- Front wall -->
+
+ <reset_transform/>
+ <translate>10 0 5</translate>
+ <scale>32</scale>
+
+ <texture>Building</texture>
+ <tilemap width="3">
+ 15 7 16
+ 3 5 4
+ 3 6 4
+ </tilemap>
+
+ <!-- Pitched roof -->
+
+ <reset_transform/>
+ <rotate axis="x">135</rotate>
+ <scale>1 1.5 1.5</scale>
+ <translate>10 5 3</translate>
+ <scale>32</scale>
+
+ <texture>Building</texture>
+ <tilemap width="3">
+ 13 13 13
+ 13 13 13
+ </tilemap>
+
+ <!-- Finial -->
+
+ <reset_transform/>
+ <translate>10 5 3</translate>
+ <scale>32</scale>
+
+ <texture>Building</texture>
+ <tilemap width="3">
+ 18 18 18
+ </tilemap>
+
+ <!-- Cheaty invisible platform -->
+
+ <reset_transform/>
+ <translate>10 4 3</translate>
+ <scale>32</scale>
+
+ <texture>Building</texture>
+ <tilemap surface_type="top" width="3">
+ -1 -1 -1
+ </tilemap>
+
+<!-- The ground -->
+
+ <!-- Courtyard -->
+
+ <reset_transform/>
+ <rotate axis="x">90</rotate>
+ <translate>-3 0 0</translate>
+ <scale>32</scale>
+ <texture>Scenery</texture>
+ <tilemap surface_type="top" width="13">
+ 1 1 1 1 1 1 1 1 1 1 1 1 1
+ 1 1 1 1 1 1 1 1 1 1 1 1 1
+ -1 -1 -1 1 0 0 0 0 0 0 0 0 1
+ -1 -1 -1 1 0 0 0 0 0 0 0 0 1
+ -1 -1 -1 1 0 0 0 0 0 0 0 0 1
+ -1 -1 -1 1 0 0 0 0 0 0 0 0 1
+ -1 -1 -1 1 1 1 1 1 1 1 1 1 1
+ </tilemap>
+
+ <!-- Front grass -->
+
+ <reset_transform/>
+ <scale>8 1 1</scale>
+ <translate>1 -0.5 5</translate>
+ <scale>32</scale>
+ <texture>Scenery</texture>
+ <billboard tile="2" u_scale="8" detail_level="2"/>
+
+ <!-- Back grass -->
+
+ <reset_transform/>
+ <scale>8 1 1</scale>
+ <translate>1 -0.5 1</translate>
+ <scale>32</scale>
+ <texture>Scenery</texture>
+ <billboard tile="2" u_scale="8" detail_level="2"/>
+
+ <!-- Left grass -->
+
+ <reset_transform/>
+ <scale>4 1 1</scale>
+ <rotate axis="y">-90</rotate>
+ <translate>1 -0.5 1</translate>
+ <scale>32</scale>
+ <texture>Scenery</texture>
+ <billboard tile="2" u_scale="4" detail_level="2"/>
+
+ <!-- Right grass -->
+
+ <reset_transform/>
+ <scale>4 1 1</scale>
+ <rotate axis="y">-90</rotate>
+ <translate>9 -0.5 1</translate>
+ <scale>32</scale>
+ <texture>Scenery</texture>
+ <billboard tile="2" u_scale="4" detail_level="2"/>
+
+ <!-- Fence behind house -->
+
+ <reset_transform/>
+ <scale>11 1 1</scale>
+ <translate>7 0 0</translate>
+ <scale>32</scale>
+
+ <texture>Scenery</texture>
+ <billboard tile="4" u_scale="11" detail_level="2"/>
+
+<!-- Background building with pitched roof -->
+
+ <!-- Front wall -->
+
+ <reset_transform/>
+ <translate>19 0 0</translate>
+ <scale>32</scale>
+
+ <texture>Building</texture>
+ <tilemap width="4" detail_level="1">
+ -1 9 11 -1
+ 9 10 12 11
+ 15 7 7 16
+ 3 6 5 4
+ 3 5 6 4
+ 3 8 5 4
+ </tilemap>
+
+ <!-- Left wall -->
+
+ <reset_transform/>
+ <rotate axis="y">-90</rotate>
+ <translate>19 0 -3</translate>
+ <scale>32</scale>
+
+ <texture>Building</texture>
+ <tilemap surface_type="left" width="3" detail_level="1">
+ 15 1 16
+ 3 7 4
+ 3 5 4
+ 3 0 4
+ </tilemap>
+
+ <!-- Right wall -->
+
+ <reset_transform/>
+ <rotate axis="y">-90</rotate>
+ <translate>23 0 -3</translate>
+ <scale>32</scale>
+
+ <texture>Building</texture>
+ <tilemap surface_type="right" width="3" detail_level="1">
+ 15 0 16
+ 3 7 4
+ 3 6 4
+ 3 2 4
+ </tilemap>
+
+ <!-- Left pitched roof -->
+
+ <reset_transform/>
+ <rotate axis="x">135</rotate>
+ <scale>1 1.5 1.5</scale>
+ <rotate axis="y">-90</rotate>
+ <translate>21 6 -3</translate>
+ <scale>32</scale>
+
+ <texture>Building</texture>
+ <tilemap width="3" detail_level="1">
+ 13 13 13
+ 13 13 13
+ </tilemap>
+
+ <!-- Right pitched roof -->
+
+ <reset_transform/>
+ <rotate axis="x">-135</rotate>
+ <scale>1 1.5 1.5</scale>
+ <rotate axis="y">-90</rotate>
+ <translate>21 6 -3</translate>
+ <scale>32</scale>
+
+ <texture>Building</texture>
+ <tilemap width="3" detail_level="1">
+ 13 13 13
+ 13 13 13
+ </tilemap>
+
+ <!-- Finial -->
+
+ <reset_transform/>
+ <rotate axis="y">-90</rotate>
+ <translate>21 6 -3</translate>
+ <scale>32</scale>
+
+ <texture>Building</texture>
+ <tilemap width="3" detail_level="1">
+ 18 18 18
+ </tilemap>
+
+<!-- More ground to the right -->
+
+ <!-- Ground under house -->
+
+ <reset_transform/>
+ <rotate axis="x">90</rotate>
+ <translate>10 0 0</translate>
+ <scale>32</scale>
+ <texture>Scenery</texture>
+ <tilemap surface_type="top" width="3">
+ 1 1 1
+ 1 1 1
+ -1 -1 -1
+ -1 -1 -1
+ -1 -1 -1
+ -1 -1 -1
+ 1 1 1
+ </tilemap>
+
+ <!-- Left part of centre courtyard -->
+
+ <reset_transform/>
+ <rotate axis="x">90</rotate>
+ <translate>13 0 0</translate>
+ <scale>32</scale>
+ <texture>Scenery</texture>
+ <tilemap surface_type="top" width="8">
+ 1 1 1 1 1 1 1 1
+ 1 1 1 1 1 1 1 1
+ 1 0 0 0 0 0 0 0
+ 1 0 0 0 0 0 1 1
+ 0 0 0 0 0 0 1 1
+ 1 0 0 0 0 0 0 0
+ 1 1 1 1 1 0 0 0
+ </tilemap>
+
+ <!-- Front grass -->
+
+ <reset_transform/>
+ <scale>12 1 1</scale>
+ <translate>14 -0.5 5</translate>
+ <scale>32</scale>
+ <texture>Scenery</texture>
+ <billboard tile="2" u_scale="12" detail_level="2"/>
+
+ <!-- Back grass -->
+
+ <reset_transform/>
+ <scale>4 1 1</scale>
+ <translate>14 -0.5 1</translate>
+ <scale>32</scale>
+ <texture>Scenery</texture>
+ <billboard tile="2" u_scale="4" detail_level="2"/>
+
+ <!-- Front grass next to door -->
+
+ <reset_transform/>
+ <scale>1 1 1</scale>
+ <translate>13 -0.5 3</translate>
+ <scale>32</scale>
+ <texture>Scenery</texture>
+ <billboard tile="2" u_scale="1" detail_level="2"/>
+
+ <!-- Back grass next to door -->
+
+ <reset_transform/>
+ <scale>1 1 1</scale>
+ <translate>13 -0.5 2</translate>
+ <scale>32</scale>
+ <texture>Scenery</texture>
+ <billboard tile="2" u_scale="1" detail_level="2"/>
+
+ <!-- Left grass -->
+
+ <reset_transform/>
+ <rotate axis="y">-90</rotate>
+ <translate>14 -0.5 1</translate>
+ <scale>32</scale>
+ <texture>Scenery</texture>
+ <tilemap width="4" detail_level="2">
+ 2 -1 2 2
+ </tilemap>
+
+ <!-- Grass left of house -->
+
+ <reset_transform/>
+ <rotate axis="y">-90</rotate>
+ <scale>1 1 1</scale>
+ <translate>18 -0.5 0</translate>
+ <scale>32</scale>
+ <texture>Scenery</texture>
+ <billboard tile="2" u_scale="1" detail_level="2"/>
+
+ <!-- Grass right of house -->
+
+ <reset_transform/>
+ <rotate axis="y">-90</rotate>
+ <scale>1 1 1</scale>
+ <translate>24 -0.5 0</translate>
+ <scale>32</scale>
+ <texture>Scenery</texture>
+ <billboard tile="2" u_scale="1" detail_level="2"/>
+
+ <!-- Front grass in centre -->
+
+ <reset_transform/>
+ <scale>4 1 1</scale>
+ <translate>19 -0.5 4</translate>
+ <scale>32</scale>
+ <texture>Scenery</texture>
+ <billboard tile="2" u_scale="4" detail_level="2"/>
+
+ <!-- Back grass in centre -->
+
+ <reset_transform/>
+ <scale>4 1 1</scale>
+ <translate>19 -0.5 2</translate>
+ <scale>32</scale>
+ <texture>Scenery</texture>
+ <billboard tile="2" u_scale="4" detail_level="2"/>
+
+ <!-- Left grass in centre -->
+
+ <reset_transform/>
+ <scale>2 1 1</scale>
+ <rotate axis="y">-90</rotate>
+ <translate>19 -0.5 2</translate>
+ <scale>32</scale>
+ <texture>Scenery</texture>
+ <billboard tile="2" u_scale="2" detail_level="2"/>
+
+ <!-- Right grass in centre -->
+
+ <reset_transform/>
+ <scale>2 1 1</scale>
+ <rotate axis="y">-90</rotate>
+ <translate>23 -0.5 2</translate>
+ <scale>32</scale>
+ <texture>Scenery</texture>
+ <billboard tile="2" u_scale="2" detail_level="2"/>
+
+<!-- Still more ground -->
+
+ <!-- Right part of centre courtyard -->
+
+ <reset_transform/>
+ <rotate axis="x">90</rotate>
+ <translate>21 0 0</translate>
+ <scale>32</scale>
+ <texture>Scenery</texture>
+ <tilemap surface_type="top" width="7">
+ 1 1 1 1 1 0 0
+ 1 1 1 1 1 0 0
+ 0 0 0 0 0 0 0
+ 1 1 0 0 0 0 0
+ 1 1 0 0 0 0 0
+ 0 0 0 0 0 0 0
+ 0 0 0 1 1 1 1
+ </tilemap>
+
+ <!-- Fence to right of back house -->
+
+ <reset_transform/>
+ <scale>4 1 1</scale>
+ <translate>24 0 0</translate>
+ <scale>32</scale>
+
+ <texture>Scenery</texture>
+ <billboard tile="4" u_scale="4" detail_level="2"/>
+
+ <!-- Grass in front of fence -->
+
+ <reset_transform/>
+ <scale>4 1 1</scale>
+ <translate>24 -0.5 1</translate>
+ <scale>32</scale>
+ <texture>Scenery</texture>
+ <billboard tile="2" u_scale="4" detail_level="2"/>
+
+ <!-- Grass to left of tower block -->
+
+ <reset_transform/>
+ <scale>2 1 1</scale>
+ <rotate axis="y">-90</rotate>
+ <translate>26 -0.5 5</translate>
+ <scale>32</scale>
+ <texture>Scenery</texture>
+ <billboard tile="2" u_scale="2" detail_level="2"/>
+
+ <!-- Grass to right of tower block -->
+
+ <reset_transform/>
+ <scale>2 1 1</scale>
+ <rotate axis="y">-90</rotate>
+ <translate>35 -0.5 5</translate>
+ <scale>32</scale>
+ <texture>Scenery</texture>
+ <billboard tile="2" u_scale="2" detail_level="2"/>
+
+ <!-- Next bit of grass -->
+
+ <reset_transform/>
+ <scale>5 1 1</scale>
+ <translate>35 -0.5 5</translate>
+ <scale>32</scale>
+ <texture>Scenery</texture>
+ <billboard tile="2" u_scale="5" detail_level="2"/>
+
+ <!-- Back grass -->
+
+ <reset_transform/>
+ <scale>6 1 1</scale>
+ <translate>34 -0.5 1</translate>
+ <scale>32</scale>
+ <texture>Scenery</texture>
+ <billboard tile="2" u_scale="6" detail_level="2"/>
+
+ <!-- Extra bit of back grass -->
+
+ <reset_transform/>
+ <scale>1 1 1</scale>
+ <rotate axis="y">-90</rotate>
+ <translate>34 -0.5 0</translate>
+ <scale>32</scale>
+ <texture>Scenery</texture>
+ <billboard tile="2" u_scale="1" detail_level="2"/>
+
+ <!-- Ground around tower block -->
+
+ <reset_transform/>
+ <rotate axis="x">90</rotate>
+ <translate>28 0 4</translate>
+ <scale>32</scale>
+ <texture>Scenery</texture>
+ <tilemap surface_type="top" width="5">
+ 0 0 0 0 0
+ 0 0 0 0 0
+ 0 0 0 0 0
+ </tilemap>
+
+ <!-- Rightmost ground -->
+
+ <reset_transform/>
+ <rotate axis="x">90</rotate>
+ <translate>33 0 0</translate>
+ <scale>32</scale>
+ <texture>Scenery</texture>
+ <tilemap surface_type="top" width="10">
+ 0 0 1 1 1 1 1 1 1 1
+ 0 0 1 1 1 1 1 1 1 1
+ 0 0 0 0 0 0 0 -1 -1 -1
+ 0 0 0 0 0 0 0 -1 -1 -1
+ 0 0 0 0 0 0 0 -1 -1 -1
+ 0 0 0 0 0 0 0 -1 -1 -1
+ 0 1 1 1 1 1 1 -1 -1 -1
+ </tilemap>
+
+<!-- Right foreground tower block -->
+
+ <!-- Front -->
+
+ <reset_transform/>
+ <translate>28 0 4</translate>
+ <scale>32</scale>
+
+ <texture>TowerBlock1</texture>
+ <tilemap width="5">
+ 2 2 2 2 2
+ 0 0 0 0 0
+ 0 0 0 0 6
+ 0 0 0 0 0
+ 0 0 0 0 0
+ 0 0 0 6 0
+ 4 4 4 4 4
+ </tilemap>
+
+ <!-- Right side -->
+
+ <reset_transform/>
+ <rotate axis="y">90</rotate>
+ <translate>33 0 4</translate>
+ <scale>32</scale>
+
+ <texture>TowerBlock1</texture>
+ <tilemap surface_type="right" width="6">
+ 2 2 2 2 2 2
+ 0 1 0 0 1 0
+ 0 1 0 0 1 0
+ 0 1 0 0 1 0
+ 0 1 0 0 1 0
+ 0 1 0 0 1 0
+ 5 4 5 5 4 5
+ </tilemap>
+
+ <!-- Left side -->
+
+ <reset_transform/>
+ <rotate axis="y">90</rotate>
+ <translate>28 0 4</translate>
+ <scale>32</scale>
+
+ <texture>TowerBlock1</texture>
+ <tilemap surface_type="left" width="6">
+ 2 2 2 2 2 2
+ 0 1 6 0 1 0
+ 0 1 0 0 1 0
+ 0 1 0 0 1 0
+ 0 1 0 0 1 0
+ 0 1 0 0 1 0
+ 5 4 5 5 4 5
+ </tilemap>
+
+ <!-- Top -->
+
+ <reset_transform/>
+ <rotate axis="x">90</rotate>
+ <translate>28 7 -2</translate>
+ <scale>32</scale>
+
+ <texture>TowerBlock1</texture>
+ <tilemap surface_type="top" width="5">
+ 3 3 3 3 3
+ 3 3 3 3 3
+ 3 3 3 3 3
+ 3 3 3 3 3
+ 3 3 3 3 3
+ 3 3 3 3 3
+ </tilemap>
+
+<!-- Right end tower block -->
+
+ <!-- Front -->
+
+ <reset_transform/>
+ <translate>40 0 5</translate>
+ <scale>32</scale>
+
+ <texture>TowerBlock1</texture>
+ <tilemap width="5">
+ 2 2 2 2 2
+ 0 1 0 0 1
+ 0 1 0 0 1
+ 0 1 0 0 1
+ 0 1 0 0 1
+ 6 1 0 0 1
+ 0 1 0 0 1
+ 0 1 0 0 1
+ 0 1 0 0 1
+ 0 1 0 0 1
+ 0 1 0 0 1
+ 6 1 0 0 1
+ 0 1 0 0 1
+ 0 1 0 0 1
+ 4 4 4 4 4
+ </tilemap>
+
+ <!-- Left side -->
+
+ <reset_transform/>
+ <rotate axis="y">90</rotate>
+ <translate>40 0 5</translate>
+ <scale>32</scale>
+
+ <texture>TowerBlock1</texture>
+ <tilemap surface_type="left" width="5">
+ 2 2 2 2 2
+ 6 0 0 0 0
+ 0 0 0 0 0
+ 0 0 0 0 0
+ 0 0 0 6 0
+ 0 0 0 0 0
+ 0 0 0 0 0
+ 0 0 6 0 0
+ 0 0 0 0 0
+ 0 0 0 0 0
+ 0 0 0 0 0
+ 0 0 0 0 0
+ 0 0 0 0 0
+ 0 0 0 0 0
+ 4 5 5 5 4
+ </tilemap>
+
+ <!-- Top -->
+
+ <reset_transform/>
+ <rotate axis="x">90</rotate>
+ <translate>40 15 0</translate>
+ <scale>32</scale>
+
+ <texture>TowerBlock1</texture>
+ <tilemap surface_type="top" width="5">
+ 3 3 3 3 3
+ 3 3 3 3 3
+ 3 3 3 3 3
+ 3 3 3 3 3
+ 3 3 3 3 3
+ </tilemap>
+
+<!-- Background -->
+
+ <reset_transform/>
+ <translate>-0.3 -0.17 -900</translate>
+ <scale>3200 1600 1</scale>
+ <texture>BackgroundFar</texture>
+ <billboard fog="false"/>
+
+ <translate>0 0 300</translate>
+ <texture>BackgroundNear</texture>
+ <billboard blend="true" fog="false"/>
+
+<!-- Trees -->
+
+ <texture>Trees</texture>
+
+ <!-- Left courtyard -->
+
+ <reset_transform/>
+ <scale>96</scale>
+ <translate>250 -2.5 16</translate>
+
+ <billboard tile="1" detail_level="1"/>
+
+ <!-- Centre courtyard -->
+
+ <reset_transform/>
+ <scale>96</scale>
+ <translate>610 -2.5 85</translate>
+
+ <billboard tile="0"/>
+
+ <reset_transform/>
+ <scale>96</scale>
+ <translate>650 -2.5 115</translate>
+
+ <billboard tile="1"/>
+
+ <!-- Right courtyard -->
+
+ <reset_transform/>
+ <scale>96</scale>
+ <translate>1080 -2.5 10</translate>
+
+ <billboard tile="1" detail_level="1"/>
+
+ <reset_transform/>
+ <scale>96</scale>
+ <translate>1120 -2.5 -15</translate>
+
+ <billboard tile="0" detail_level="1"/>
+
+ <reset_transform/>
+ <scale>96</scale>
+ <translate>1220 -2.5 -30</translate>
+
+ <billboard tile="1" detail_level="1"/>
+</scene>
--- /dev/null
+{
+ "TilesU": 8,
+ "TilesV": 4,
+ "InvertAlpha": 0,
+ "MinFilter": Nearest,
+ "MagFilter": Nearest
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+<dict>
+ <key>TilesU</key>
+ <string>8</string>
+ <key>TilesV</key>
+ <string>4</string>
+ <key>InvertAlpha</key>
+ <string>0</string>
+ <key>MinFilter</key>
+ <string>Nearest</string>
+ <key>MagFilter</key>
+ <string>Nearest</string>
+</dict>
+</plist>
--- /dev/null
+{
+ "TilesU": 1,
+ "TilesV": 1,
+ "InvertAlpha": 0,
+ "MinFilter": "Linear",
+ "MagFilter": "Linear",
+ "WrapU": "ClampToEdge",
+ "WrapV": "ClampToEdge"
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+<dict>
+ <key>TilesU</key>
+ <string>1</string>
+ <key>TilesV</key>
+ <string>1</string>
+ <key>InvertAlpha</key>
+ <string>0</string>
+
+ <key>WrapU</key>
+ <string>ClampToEdge</string>
+ <key>WrapV</key>
+ <string>ClampToEdge</string>
+ <key>MinFilter</key>
+ <string>Linear</string>
+ <key>MagFilter</key>
+ <string>Linear</string>
+</dict>
+</plist>
--- /dev/null
+{
+ "TilesU": 1,
+ "TilesV": 1,
+ "InvertAlpha": 0,
+ "MinFilter": "Linear",
+ "MagFilter": "Linear",
+ "WrapU": "Wrap",
+ "WrapV": "Wrap"
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+<dict>
+ <key>TilesU</key>
+ <string>1</string>
+ <key>TilesV</key>
+ <string>1</string>
+ <key>InvertAlpha</key>
+ <string>0</string>
+
+ <key>WrapU</key>
+ <string>Wrap</string>
+ <key>WrapV</key>
+ <string>Wrap</string>
+ <key>MinFilter</key>
+ <string>Linear</string>
+ <key>MagFilter</key>
+ <string>Linear</string>
+</dict>
+</plist>
--- /dev/null
+{
+ "TilesU": 8,
+ "TilesV": 1,
+ "InvertAlpha": 0,
+ "MinFilter": "Linear",
+ "MagFilter": "Linear",
+ "WrapU": "ClampToEdge",
+ "WrapV": "ClampToEdge"
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+<dict>
+ <key>TilesU</key>
+ <string>8</string>
+ <key>TilesV</key>
+ <string>1</string>
+ <key>InvertAlpha</key>
+ <string>0</string>
+
+ <key>MinFilter</key>
+ <string>Linear</string>
+ <key>MagFilter</key>
+ <string>Linear</string>
+ <key>WrapU</key>
+ <string>ClampToEdge</string>
+ <key>WrapV</key>
+ <string>ClampToEdge</string>
+ <key>MinFilter</key>
+ <string>Nearest</string>
+ <key>MagFilter</key>
+ <string>Nearest</string>
+</dict>
+</plist>
--- /dev/null
+{
+ "TilesU": 8,
+ "TilesV": 4,
+ "InvertAlpha": 0,
+ "MinFilter": "Linear",
+ "MagFilter": "Linear",
+ "WrapU": "ClampToEdge",
+ "WrapV": "ClampToEdge"
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+<dict>
+ <key>TilesU</key>
+ <string>8</string>
+ <key>TilesV</key>
+ <string>4</string>
+ <key>InvertAlpha</key>
+ <string>0</string>
+
+ <key>MinFilter</key>
+ <string>Linear</string>
+ <key>MagFilter</key>
+ <string>Linear</string>
+ <key>WrapU</key>
+ <string>ClampToEdge</string>
+ <key>WrapV</key>
+ <string>ClampToEdge</string>
+ <key>MinFilter</key>
+ <string>Nearest</string>
+ <key>MagFilter</key>
+ <string>Nearest</string>
+</dict>
+</plist>
--- /dev/null
+{
+ "TilesU": 8,
+ "TilesV": 4,
+ "InvertAlpha": 0,
+ "MinFilter": "Nearest",
+ "MagFilter": "Nearest",
+ "WrapU": "ClampToEdge",
+ "WrapV": "ClampToEdge"
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+<dict>
+ <key>TilesU</key>
+ <string>8</string>
+ <key>TilesV</key>
+ <string>4</string>
+ <key>InvertAlpha</key>
+ <string>0</string>
+
+ <key>WrapU</key>
+ <string>ClampToEdge</string>
+ <key>WrapV</key>
+ <string>ClampToEdge</string>
+ <key>MinFilter</key>
+ <string>Nearest</string>
+ <key>MagFilter</key>
+ <string>Nearest</string>
+</dict>
+</plist>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+<dict>
+ <key>MinFilter</key>
+ <string>Linear</string>
+ <key>MagFilter</key>
+ <string>Linear</string>
+ <key>WrapU</key>
+ <string>Repeat</string>
+ <key>WrapV</key>
+ <string>Repeat</string>
+ <key>InvertAlpha</key>
+ <string>0</string>
+</dict>
+</plist>
--- /dev/null
+{
+ "TilesU": 8,
+ "TilesV": 8,
+ "InvertAlpha": 0,
+ "MinFilter": "Nearest",
+ "MagFilter": "Nearest"
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+<dict>
+ <key>TilesU</key>
+ <string>8</string>
+ <key>TilesV</key>
+ <string>8</string>
+ <key>InvertAlpha</key>
+ <string>0</string>
+ <key>MinFilter</key>
+ <string>Nearest</string>
+ <key>MagFilter</key>
+ <string>Nearest</string>
+</dict>
+</plist>
--- /dev/null
+{
+ "TilesU": 8,
+ "TilesV": 4,
+ "InvertAlpha": 0,
+ "MinFilter": "Nearest",
+ "MagFilter": "Nearest"
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+<dict>
+ <key>TilesU</key>
+ <string>8</string>
+ <key>TilesV</key>
+ <string>4</string>
+ <key>InvertAlpha</key>
+ <string>0</string>
+ <key>MinFilter</key>
+ <string>Nearest</string>
+ <key>MagFilter</key>
+ <string>Nearest</string>
+</dict>
+</plist>
--- /dev/null
+{
+ "TilesU": 4,
+ "TilesV": 2,
+ "InvertAlpha": 0,
+ "MinFilter": "Nearest",
+ "MagFilter": "Nearest"
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+<dict>
+ <key>TilesU</key>
+ <string>4</string>
+ <key>TilesV</key>
+ <string>2</string>
+ <key>InvertAlpha</key>
+ <string>0</string>
+ <key>MinFilter</key>
+ <string>Nearest</string>
+ <key>MagFilter</key>
+ <string>Nearest</string>
+</dict>
+</plist>
--- /dev/null
+{
+ "TilesU": 8,
+ "TilesV": 4,
+ "InvertAlpha": 0,
+ "MinFilter": "Linear",
+ "MagFilter": "Linear",
+ "WrapU": "ClampToEdge",
+ "WrapV": "ClampToEdge"
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+<dict>
+ <key>TilesU</key>
+ <string>8</string>
+ <key>TilesV</key>
+ <string>4</string>
+ <key>InvertAlpha</key>
+ <string>0</string>
+
+ <key>MinFilter</key>
+ <string>Linear</string>
+ <key>MagFilter</key>
+ <string>Linear</string>
+ <key>WrapU</key>
+ <string>ClampToEdge</string>
+ <key>WrapV</key>
+ <string>ClampToEdge</string>
+ <key>MinFilter</key>
+ <string>Nearest</string>
+ <key>MagFilter</key>
+ <string>Nearest</string>
+</dict>
+</plist>
--- /dev/null
+{
+ "TilesU": 8,
+ "TilesV": 4,
+ "InvertAlpha": 0,
+ "MinFilter": "Nearest",
+ "MagFilter": "Nearest"
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+<dict>
+ <key>TilesU</key>
+ <string>8</string>
+ <key>TilesV</key>
+ <string>4</string>
+ <key>InvertAlpha</key>
+ <string>0</string>
+ <key>MinFilter</key>
+ <string>Nearest</string>
+ <key>MagFilter</key>
+ <string>Nearest</string>
+</dict>
+</plist>
--- /dev/null
+{
+ "TilesU": 4,
+ "TilesV": 4,
+ "InvertAlpha": 0,
+ "MinFilter": "Linear",
+ "MagFilter": "Linear",
+ "WrapU": "Wrap",
+ "WrapV": "Wrap"
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+<dict>
+ <key>TilesU</key>
+ <string>4</string>
+ <key>TilesV</key>
+ <string>4</string>
+ <key>InvertAlpha</key>
+ <string>0</string>
+
+ <key>MinFilter</key>
+ <string>Linear</string>
+ <key>MagFilter</key>
+ <string>Linear</string>
+ <key>WrapU</key>
+ <string>Wrap</string>
+ <key>WrapV</key>
+ <string>Wrap</string>
+ <key>MinFilter</key>
+ <string>Nearest</string>
+ <key>MagFilter</key>
+ <string>Nearest</string>
+</dict>
+</plist>
--- /dev/null
+{
+ "TilesU": 4,
+ "TilesV": 1,
+ "InvertAlpha": 0,
+ "MinFilter": "Nearest",
+ "MagFilter": "Nearest"
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+<dict>
+ <key>TilesU</key>
+ <string>4</string>
+ <key>TilesV</key>
+ <string>1</string>
+ <key>InvertAlpha</key>
+ <string>0</string>
+ <key>MinFilter</key>
+ <string>Nearest</string>
+ <key>MagFilter</key>
+ <string>Nearest</string>
+</dict>
+</plist>
--- /dev/null
+{
+ "TilesU": 4,
+ "TilesV": 4,
+ "InvertAlpha": 0,
+ "MinFilter": "Linear",
+ "MagFilter": "Linear",
+ "WrapU": "ClampToEdge",
+ "WrapV": "ClampToEdge"
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+<dict>
+ <key>TilesU</key>
+ <string>4</string>
+ <key>TilesV</key>
+ <string>4</string>
+ <key>InvertAlpha</key>
+ <string>0</string>
+
+ <key>MinFilter</key>
+ <string>Linear</string>
+ <key>MagFilter</key>
+ <string>Linear</string>
+ <key>WrapU</key>
+ <string>ClampToEdge</string>
+ <key>WrapV</key>
+ <string>ClampToEdge</string>
+ <key>MinFilter</key>
+ <string>Nearest</string>
+ <key>MagFilter</key>
+ <string>Nearest</string>
+</dict>
+</plist>
--- /dev/null
+{
+ "TilesU": 2,
+ "TilesV": 1,
+ "InvertAlpha": 0,
+ "MinFilter": "Linear",
+ "MagFilter": "Linear",
+ "WrapU": "ClampToEdge",
+ "WrapV": "ClampToEdge"
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+<dict>
+ <key>TilesU</key>
+ <string>2</string>
+ <key>TilesV</key>
+ <string>1</string>
+ <key>InvertAlpha</key>
+ <string>0</string>
+
+ <key>MinFilter</key>
+ <string>Linear</string>
+ <key>MagFilter</key>
+ <string>Linear</string>
+ <key>WrapU</key>
+ <string>ClampToEdge</string>
+ <key>WrapV</key>
+ <string>ClampToEdge</string>
+ <key>MinFilter</key>
+ <string>Nearest</string>
+ <key>MagFilter</key>
+ <string>Nearest</string>
+</dict>
+</plist>
--- /dev/null
+/*
+ * Copyright 2001-2004 Unicode, Inc.
+ *
+ * Disclaimer
+ *
+ * This source code is provided as is by Unicode, Inc. No claims are
+ * made as to fitness for any particular purpose. No warranties of any
+ * kind are expressed or implied. The recipient agrees to determine
+ * applicability of information provided. If this file has been
+ * purchased on magnetic or optical media from Unicode, Inc., the
+ * sole remedy for any claim will be exchange of defective media
+ * within 90 days of receipt.
+ *
+ * Limitations on Rights to Redistribute This Code
+ *
+ * Unicode, Inc. hereby grants the right to freely use the information
+ * supplied in this file in the creation of products supporting the
+ * Unicode Standard, and to make copies of this file in any form
+ * for internal or external distribution as long as this notice
+ * remains attached.
+ */
+
+/* ---------------------------------------------------------------------
+
+ Conversions between UTF32, UTF-16, and UTF-8. Source code file.
+ Author: Mark E. Davis, 1994.
+ Rev History: Rick McGowan, fixes & updates May 2001.
+ Sept 2001: fixed const & error conditions per
+ mods suggested by S. Parent & A. Lillich.
+ June 2002: Tim Dodd added detection and handling of incomplete
+ source sequences, enhanced error detection, added casts
+ to eliminate compiler warnings.
+ July 2003: slight mods to back out aggressive FFFE detection.
+ Jan 2004: updated switches in from-UTF8 conversions.
+ Oct 2004: updated to use UNI_MAX_LEGAL_UTF32 in UTF-32 conversions.
+
+ See the header file "ConvertUTF.h" for complete documentation.
+
+------------------------------------------------------------------------ */
+
+
+#include "ConvertUTF.h"
+#ifdef CVTUTF_DEBUG
+#include <stdio.h>
+#endif
+
+static const int halfShift = 10; /* used for shifting by 10 bits */
+
+static const UTF32 halfBase = 0x0010000UL;
+static const UTF32 halfMask = 0x3FFUL;
+
+#define UNI_SUR_HIGH_START (UTF32)0xD800
+#define UNI_SUR_HIGH_END (UTF32)0xDBFF
+#define UNI_SUR_LOW_START (UTF32)0xDC00
+#define UNI_SUR_LOW_END (UTF32)0xDFFF
+#define false 0
+#define true 1
+
+/* --------------------------------------------------------------------- */
+
+ConversionResult ConvertUTF32toUTF16 (
+ const UTF32** sourceStart, const UTF32* sourceEnd,
+ UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags) {
+ ConversionResult result = conversionOK;
+ const UTF32* source = *sourceStart;
+ UTF16* target = *targetStart;
+ while (source < sourceEnd) {
+ UTF32 ch;
+ if (target >= targetEnd) {
+ result = targetExhausted; break;
+ }
+ ch = *source++;
+ if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */
+ /* UTF-16 surrogate values are illegal in UTF-32; 0xffff or 0xfffe are both reserved values */
+ if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) {
+ if (flags == strictConversion) {
+ --source; /* return to the illegal value itself */
+ result = sourceIllegal;
+ break;
+ } else {
+ *target++ = UNI_REPLACEMENT_CHAR;
+ }
+ } else {
+ *target++ = (UTF16)ch; /* normal case */
+ }
+ } else if (ch > UNI_MAX_LEGAL_UTF32) {
+ if (flags == strictConversion) {
+ result = sourceIllegal;
+ } else {
+ *target++ = UNI_REPLACEMENT_CHAR;
+ }
+ } else {
+ /* target is a character in range 0xFFFF - 0x10FFFF. */
+ if (target + 1 >= targetEnd) {
+ --source; /* Back up source pointer! */
+ result = targetExhausted; break;
+ }
+ ch -= halfBase;
+ *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START);
+ *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START);
+ }
+ }
+ *sourceStart = source;
+ *targetStart = target;
+ return result;
+}
+
+/* --------------------------------------------------------------------- */
+
+ConversionResult ConvertUTF16toUTF32 (
+ const UTF16** sourceStart, const UTF16* sourceEnd,
+ UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags) {
+ ConversionResult result = conversionOK;
+ const UTF16* source = *sourceStart;
+ UTF32* target = *targetStart;
+ UTF32 ch, ch2;
+ while (source < sourceEnd) {
+ const UTF16* oldSource = source; /* In case we have to back up because of target overflow. */
+ ch = *source++;
+ /* If we have a surrogate pair, convert to UTF32 first. */
+ if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) {
+ /* If the 16 bits following the high surrogate are in the source buffer... */
+ if (source < sourceEnd) {
+ ch2 = *source;
+ /* If it's a low surrogate, convert to UTF32. */
+ if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) {
+ ch = ((ch - UNI_SUR_HIGH_START) << halfShift)
+ + (ch2 - UNI_SUR_LOW_START) + halfBase;
+ ++source;
+ } else if (flags == strictConversion) { /* it's an unpaired high surrogate */
+ --source; /* return to the illegal value itself */
+ result = sourceIllegal;
+ break;
+ }
+ } else { /* We don't have the 16 bits following the high surrogate. */
+ --source; /* return to the high surrogate */
+ result = sourceExhausted;
+ break;
+ }
+ } else if (flags == strictConversion) {
+ /* UTF-16 surrogate values are illegal in UTF-32 */
+ if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) {
+ --source; /* return to the illegal value itself */
+ result = sourceIllegal;
+ break;
+ }
+ }
+ if (target >= targetEnd) {
+ source = oldSource; /* Back up source pointer! */
+ result = targetExhausted; break;
+ }
+ *target++ = ch;
+ }
+ *sourceStart = source;
+ *targetStart = target;
+#ifdef CVTUTF_DEBUG
+if (result == sourceIllegal) {
+ fprintf(stderr, "ConvertUTF16toUTF32 illegal seq 0x%04x,%04x\n", ch, ch2);
+ fflush(stderr);
+}
+#endif
+ return result;
+}
+
+/* --------------------------------------------------------------------- */
+
+/*
+ * Index into the table below with the first byte of a UTF-8 sequence to
+ * get the number of trailing bytes that are supposed to follow it.
+ * Note that *legal* UTF-8 values can't have 4 or 5-bytes. The table is
+ * left as-is for anyone who may want to do such conversion, which was
+ * allowed in earlier algorithms.
+ */
+static const char trailingBytesForUTF8[256] = {
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5
+};
+
+/*
+ * Magic values subtracted from a buffer value during UTF8 conversion.
+ * This table contains as many values as there might be trailing bytes
+ * in a UTF-8 sequence.
+ */
+static const UTF32 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL,
+ 0x03C82080UL, 0xFA082080UL, 0x82082080UL };
+
+/*
+ * Once the bits are split out into bytes of UTF-8, this is a mask OR-ed
+ * into the first byte, depending on how many bytes follow. There are
+ * as many entries in this table as there are UTF-8 sequence types.
+ * (I.e., one byte sequence, two byte... etc.). Remember that sequencs
+ * for *legal* UTF-8 will be 4 or fewer bytes total.
+ */
+static const UTF8 firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };
+
+/* --------------------------------------------------------------------- */
+
+/* The interface converts a whole buffer to avoid function-call overhead.
+ * Constants have been gathered. Loops & conditionals have been removed as
+ * much as possible for efficiency, in favor of drop-through switches.
+ * (See "Note A" at the bottom of the file for equivalent code.)
+ * If your compiler supports it, the "isLegalUTF8" call can be turned
+ * into an inline function.
+ */
+
+/* --------------------------------------------------------------------- */
+
+ConversionResult ConvertUTF16toUTF8 (
+ const UTF16** sourceStart, const UTF16* sourceEnd,
+ UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags) {
+ ConversionResult result = conversionOK;
+ const UTF16* source = *sourceStart;
+ UTF8* target = *targetStart;
+ while (source < sourceEnd) {
+ UTF32 ch;
+ unsigned short bytesToWrite = 0;
+ const UTF32 byteMask = 0xBF;
+ const UTF32 byteMark = 0x80;
+ const UTF16* oldSource = source; /* In case we have to back up because of target overflow. */
+ ch = *source++;
+ /* If we have a surrogate pair, convert to UTF32 first. */
+ if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) {
+ /* If the 16 bits following the high surrogate are in the source buffer... */
+ if (source < sourceEnd) {
+ UTF32 ch2 = *source;
+ /* If it's a low surrogate, convert to UTF32. */
+ if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) {
+ ch = ((ch - UNI_SUR_HIGH_START) << halfShift)
+ + (ch2 - UNI_SUR_LOW_START) + halfBase;
+ ++source;
+ } else if (flags == strictConversion) { /* it's an unpaired high surrogate */
+ --source; /* return to the illegal value itself */
+ result = sourceIllegal;
+ break;
+ }
+ } else { /* We don't have the 16 bits following the high surrogate. */
+ --source; /* return to the high surrogate */
+ result = sourceExhausted;
+ break;
+ }
+ } else if (flags == strictConversion) {
+ /* UTF-16 surrogate values are illegal in UTF-32 */
+ if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) {
+ --source; /* return to the illegal value itself */
+ result = sourceIllegal;
+ break;
+ }
+ }
+ /* Figure out how many bytes the result will require */
+ if (ch < (UTF32)0x80) { bytesToWrite = 1;
+ } else if (ch < (UTF32)0x800) { bytesToWrite = 2;
+ } else if (ch < (UTF32)0x10000) { bytesToWrite = 3;
+ } else if (ch < (UTF32)0x110000) { bytesToWrite = 4;
+ } else { bytesToWrite = 3;
+ ch = UNI_REPLACEMENT_CHAR;
+ }
+
+ target += bytesToWrite;
+ if (target > targetEnd) {
+ source = oldSource; /* Back up source pointer! */
+ target -= bytesToWrite; result = targetExhausted; break;
+ }
+ switch (bytesToWrite) { /* note: everything falls through. */
+ case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
+ case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
+ case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
+ case 1: *--target = (UTF8)(ch | firstByteMark[bytesToWrite]);
+ }
+ target += bytesToWrite;
+ }
+ *sourceStart = source;
+ *targetStart = target;
+ return result;
+}
+
+/* --------------------------------------------------------------------- */
+
+/*
+ * Utility routine to tell whether a sequence of bytes is legal UTF-8.
+ * This must be called with the length pre-determined by the first byte.
+ * If not calling this from ConvertUTF8to*, then the length can be set by:
+ * length = trailingBytesForUTF8[*source]+1;
+ * and the sequence is illegal right away if there aren't that many bytes
+ * available.
+ * If presented with a length > 4, this returns false. The Unicode
+ * definition of UTF-8 goes up to 4-byte sequences.
+ */
+
+static bool isLegalUTF8(const UTF8 *source, int length) {
+ UTF8 a;
+ const UTF8 *srcptr = source+length;
+ switch (length) {
+ default: return false;
+ /* Everything else falls through when "true"... */
+ case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;
+ case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;
+ case 2: if ((a = (*--srcptr)) > 0xBF) return false;
+
+ switch (*source) {
+ /* no fall-through in this inner switch */
+ case 0xE0: if (a < 0xA0) return false; break;
+ case 0xED: if (a > 0x9F) return false; break;
+ case 0xF0: if (a < 0x90) return false; break;
+ case 0xF4: if (a > 0x8F) return false; break;
+ default: if (a < 0x80) return false;
+ }
+
+ case 1: if (*source >= 0x80 && *source < 0xC2) return false;
+ }
+ if (*source > 0xF4) return false;
+ return true;
+}
+
+/* --------------------------------------------------------------------- */
+
+/*
+ * Exported function to return whether a UTF-8 sequence is legal or not.
+ * This is not used here; it's just exported.
+ */
+bool isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd) {
+ int length = trailingBytesForUTF8[*source]+1;
+ if (source+length > sourceEnd) {
+ return false;
+ }
+ return isLegalUTF8(source, length);
+}
+
+/* --------------------------------------------------------------------- */
+
+ConversionResult ConvertUTF8toUTF16 (
+ const UTF8** sourceStart, const UTF8* sourceEnd,
+ UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags) {
+ ConversionResult result = conversionOK;
+ const UTF8* source = *sourceStart;
+ UTF16* target = *targetStart;
+ while (source < sourceEnd) {
+ UTF32 ch = 0;
+ unsigned short extraBytesToRead = trailingBytesForUTF8[*source];
+ if (source + extraBytesToRead >= sourceEnd) {
+ result = sourceExhausted; break;
+ }
+ /* Do this check whether lenient or strict */
+ if (! isLegalUTF8(source, extraBytesToRead+1)) {
+ result = sourceIllegal;
+ break;
+ }
+ /*
+ * The cases all fall through. See "Note A" below.
+ */
+ switch (extraBytesToRead) {
+ case 5: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */
+ case 4: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */
+ case 3: ch += *source++; ch <<= 6;
+ case 2: ch += *source++; ch <<= 6;
+ case 1: ch += *source++; ch <<= 6;
+ case 0: ch += *source++;
+ }
+ ch -= offsetsFromUTF8[extraBytesToRead];
+
+ if (target >= targetEnd) {
+ source -= (extraBytesToRead+1); /* Back up source pointer! */
+ result = targetExhausted; break;
+ }
+ if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */
+ /* UTF-16 surrogate values are illegal in UTF-32 */
+ if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) {
+ if (flags == strictConversion) {
+ source -= (extraBytesToRead+1); /* return to the illegal value itself */
+ result = sourceIllegal;
+ break;
+ } else {
+ *target++ = UNI_REPLACEMENT_CHAR;
+ }
+ } else {
+ *target++ = (UTF16)ch; /* normal case */
+ }
+ } else if (ch > UNI_MAX_UTF16) {
+ if (flags == strictConversion) {
+ result = sourceIllegal;
+ source -= (extraBytesToRead+1); /* return to the start */
+ break; /* Bail out; shouldn't continue */
+ } else {
+ *target++ = UNI_REPLACEMENT_CHAR;
+ }
+ } else {
+ /* target is a character in range 0xFFFF - 0x10FFFF. */
+ if (target + 1 >= targetEnd) {
+ source -= (extraBytesToRead+1); /* Back up source pointer! */
+ result = targetExhausted; break;
+ }
+ ch -= halfBase;
+ *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START);
+ *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START);
+ }
+ }
+ *sourceStart = source;
+ *targetStart = target;
+ return result;
+}
+
+/* --------------------------------------------------------------------- */
+
+ConversionResult ConvertUTF32toUTF8 (
+ const UTF32** sourceStart, const UTF32* sourceEnd,
+ UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags) {
+ ConversionResult result = conversionOK;
+ const UTF32* source = *sourceStart;
+ UTF8* target = *targetStart;
+ while (source < sourceEnd) {
+ UTF32 ch;
+ unsigned short bytesToWrite = 0;
+ const UTF32 byteMask = 0xBF;
+ const UTF32 byteMark = 0x80;
+ ch = *source++;
+ if (flags == strictConversion ) {
+ /* UTF-16 surrogate values are illegal in UTF-32 */
+ if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) {
+ --source; /* return to the illegal value itself */
+ result = sourceIllegal;
+ break;
+ }
+ }
+ /*
+ * Figure out how many bytes the result will require. Turn any
+ * illegally large UTF32 things (> Plane 17) into replacement chars.
+ */
+ if (ch < (UTF32)0x80) { bytesToWrite = 1;
+ } else if (ch < (UTF32)0x800) { bytesToWrite = 2;
+ } else if (ch < (UTF32)0x10000) { bytesToWrite = 3;
+ } else if (ch <= UNI_MAX_LEGAL_UTF32) { bytesToWrite = 4;
+ } else { bytesToWrite = 3;
+ ch = UNI_REPLACEMENT_CHAR;
+ result = sourceIllegal;
+ }
+
+ target += bytesToWrite;
+ if (target > targetEnd) {
+ --source; /* Back up source pointer! */
+ target -= bytesToWrite; result = targetExhausted; break;
+ }
+ switch (bytesToWrite) { /* note: everything falls through. */
+ case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
+ case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
+ case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
+ case 1: *--target = (UTF8) (ch | firstByteMark[bytesToWrite]);
+ }
+ target += bytesToWrite;
+ }
+ *sourceStart = source;
+ *targetStart = target;
+ return result;
+}
+
+/* --------------------------------------------------------------------- */
+
+ConversionResult ConvertUTF8toUTF32 (
+ const UTF8** sourceStart, const UTF8* sourceEnd,
+ UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags) {
+ ConversionResult result = conversionOK;
+ const UTF8* source = *sourceStart;
+ UTF32* target = *targetStart;
+ while (source < sourceEnd) {
+ UTF32 ch = 0;
+ unsigned short extraBytesToRead = trailingBytesForUTF8[*source];
+ if (source + extraBytesToRead >= sourceEnd) {
+ result = sourceExhausted; break;
+ }
+ /* Do this check whether lenient or strict */
+ if (! isLegalUTF8(source, extraBytesToRead+1)) {
+ result = sourceIllegal;
+ break;
+ }
+ /*
+ * The cases all fall through. See "Note A" below.
+ */
+ switch (extraBytesToRead) {
+ case 5: ch += *source++; ch <<= 6;
+ case 4: ch += *source++; ch <<= 6;
+ case 3: ch += *source++; ch <<= 6;
+ case 2: ch += *source++; ch <<= 6;
+ case 1: ch += *source++; ch <<= 6;
+ case 0: ch += *source++;
+ }
+ ch -= offsetsFromUTF8[extraBytesToRead];
+
+ if (target >= targetEnd) {
+ source -= (extraBytesToRead+1); /* Back up the source pointer! */
+ result = targetExhausted; break;
+ }
+ if (ch <= UNI_MAX_LEGAL_UTF32) {
+ /*
+ * UTF-16 surrogate values are illegal in UTF-32, and anything
+ * over Plane 17 (> 0x10FFFF) is illegal.
+ */
+ if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) {
+ if (flags == strictConversion) {
+ source -= (extraBytesToRead+1); /* return to the illegal value itself */
+ result = sourceIllegal;
+ break;
+ } else {
+ *target++ = UNI_REPLACEMENT_CHAR;
+ }
+ } else {
+ *target++ = ch;
+ }
+ } else { /* i.e., ch > UNI_MAX_LEGAL_UTF32 */
+ result = sourceIllegal;
+ *target++ = UNI_REPLACEMENT_CHAR;
+ }
+ }
+ *sourceStart = source;
+ *targetStart = target;
+ return result;
+}
+
+/* ---------------------------------------------------------------------
+
+ Note A.
+ The fall-through switches in UTF-8 reading code save a
+ temp variable, some decrements & conditionals. The switches
+ are equivalent to the following loop:
+ {
+ int tmpBytesToRead = extraBytesToRead+1;
+ do {
+ ch += *source++;
+ --tmpBytesToRead;
+ if (tmpBytesToRead) ch <<= 6;
+ } while (tmpBytesToRead > 0);
+ }
+ In UTF-8 writing code, the switches on "bytesToWrite" are
+ similarly unrolled loops.
+
+ --------------------------------------------------------------------- */
--- /dev/null
+
+#ifndef _CONVERTUTF_H_
+#define _CONVERTUTF_H_
+
+/*
+ * Copyright 2001-2004 Unicode, Inc.
+ *
+ * Disclaimer
+ *
+ * This source code is provided as is by Unicode, Inc. No claims are
+ * made as to fitness for any particular purpose. No warranties of any
+ * kind are expressed or implied. The recipient agrees to determine
+ * applicability of information provided. If this file has been
+ * purchased on magnetic or optical media from Unicode, Inc., the
+ * sole remedy for any claim will be exchange of defective media
+ * within 90 days of receipt.
+ *
+ * Limitations on Rights to Redistribute This Code
+ *
+ * Unicode, Inc. hereby grants the right to freely use the information
+ * supplied in this file in the creation of products supporting the
+ * Unicode Standard, and to make copies of this file in any form
+ * for internal or external distribution as long as this notice
+ * remains attached.
+ */
+
+/* ---------------------------------------------------------------------
+
+ Conversions between UTF32, UTF-16, and UTF-8. Header file.
+
+ Several funtions are included here, forming a complete set of
+ conversions between the three formats. UTF-7 is not included
+ here, but is handled in a separate source file.
+
+ Each of these routines takes pointers to input buffers and output
+ buffers. The input buffers are const.
+
+ Each routine converts the text between *sourceStart and sourceEnd,
+ putting the result into the buffer between *targetStart and
+ targetEnd. Note: the end pointers are *after* the last item: e.g.
+ *(sourceEnd - 1) is the last item.
+
+ The return result indicates whether the conversion was successful,
+ and if not, whether the problem was in the source or target buffers.
+ (Only the first encountered problem is indicated.)
+
+ After the conversion, *sourceStart and *targetStart are both
+ updated to point to the end of last text successfully converted in
+ the respective buffers.
+
+ Input parameters:
+ sourceStart - pointer to a pointer to the source buffer.
+ The contents of this are modified on return so that
+ it points at the next thing to be converted.
+ targetStart - similarly, pointer to pointer to the target buffer.
+ sourceEnd, targetEnd - respectively pointers to the ends of the
+ two buffers, for overflow checking only.
+
+ These conversion functions take a ConversionFlags argument. When this
+ flag is set to strict, both irregular sequences and isolated surrogates
+ will cause an error. When the flag is set to lenient, both irregular
+ sequences and isolated surrogates are converted.
+
+ Whether the flag is strict or lenient, all illegal sequences will cause
+ an error return. This includes sequences such as: <F4 90 80 80>, <C0 80>,
+ or <A0> in UTF-8, and values above 0x10FFFF in UTF-32. Conformant code
+ must check for illegal sequences.
+
+ When the flag is set to lenient, characters over 0x10FFFF are converted
+ to the replacement character; otherwise (when the flag is set to strict)
+ they constitute an error.
+
+ Output parameters:
+ The value "sourceIllegal" is returned from some routines if the input
+ sequence is malformed. When "sourceIllegal" is returned, the source
+ value will point to the illegal value that caused the problem. E.g.,
+ in UTF-8 when a sequence is malformed, it points to the start of the
+ malformed sequence.
+
+ Author: Mark E. Davis, 1994.
+ Rev History: Rick McGowan, fixes & updates May 2001.
+ Fixes & updates, Sept 2001.
+
+------------------------------------------------------------------------ */
+
+/* ---------------------------------------------------------------------
+ The following 4 definitions are compiler-specific.
+ The C standard does not guarantee that wchar_t has at least
+ 16 bits, so wchar_t is no less portable than unsigned short!
+ All should be unsigned values to avoid sign extension during
+ bit mask & shift operations.
+------------------------------------------------------------------------ */
+
+#include <stdint.h>
+#include <stdbool.h>
+
+typedef uint32_t UTF32; /* exactly 32 bits */
+typedef uint16_t UTF16; /* exactly 16 bits */
+typedef uint8_t UTF8; /* exactly 8 bits */
+
+/* Some fundamental constants */
+#define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD
+#define UNI_MAX_BMP (UTF32)0x0000FFFF
+#define UNI_MAX_UTF16 (UTF32)0x0010FFFF
+#define UNI_MAX_UTF32 (UTF32)0x7FFFFFFF
+#define UNI_MAX_LEGAL_UTF32 (UTF32)0x0010FFFF
+
+typedef enum {
+ conversionOK, /* conversion successful */
+ sourceExhausted, /* partial character in source, but hit end */
+ targetExhausted, /* insuff. room in target for conversion */
+ sourceIllegal /* source sequence is illegal/malformed */
+} ConversionResult;
+
+typedef enum {
+ strictConversion = 0,
+ lenientConversion
+} ConversionFlags;
+
+/* This is for C++ and does no harm in C */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ConversionResult ConvertUTF8toUTF16 (
+ const UTF8** sourceStart, const UTF8* sourceEnd,
+ UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags);
+
+ConversionResult ConvertUTF16toUTF8 (
+ const UTF16** sourceStart, const UTF16* sourceEnd,
+ UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags);
+
+ConversionResult ConvertUTF8toUTF32 (
+ const UTF8** sourceStart, const UTF8* sourceEnd,
+ UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags);
+
+ConversionResult ConvertUTF32toUTF8 (
+ const UTF32** sourceStart, const UTF32* sourceEnd,
+ UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags);
+
+ConversionResult ConvertUTF16toUTF32 (
+ const UTF16** sourceStart, const UTF16* sourceEnd,
+ UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags);
+
+ConversionResult ConvertUTF32toUTF16 (
+ const UTF32** sourceStart, const UTF32* sourceEnd,
+ UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags);
+
+bool isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd);
+
+#ifdef __cplusplus
+}
+#endif
+
+/* --------------------------------------------------------------------- */
+
+#endif // _CONVERTUTF_H_
+
-bin_PROGRAMS = yoink
+noinst_LIBRARIES = libdc.a
-yoink_SOURCES = yoink.cc
-yoink_LDFLAGS = -lstdc++
+libdc_a_SOURCES = \
+ ConvertUTF.c \
+ ConvertUTF.h \
+ deserializer.cc \
+ deserializer.hh \
+ dispatcher.cc \
+ dispatcher.hh \
+ engine.cc \
+ engine.hh \
+ fastevents.c \
+ fastevents.h \
+ math.cc \
+ math.hh \
+ matrix.hh \
+ opengl.hh \
+ quaternion.hh \
+ random.cc \
+ random.hh \
+ rectangle.cc \
+ rectangle.hh \
+ serializable.cc \
+ serializable.hh \
+ serializer.cc \
+ serializer.hh \
+ settings.cc \
+ settings.hh \
+ singleton.hh \
+ stringtools.cc \
+ stringtools.hh \
+ texture.cc \
+ texture.hh \
+ thread.hh \
+ timer.cc \
+ timer.hh \
+ vector.hh \
+ video.cc \
+ video.hh \
+ $(ENDLIST)
+
+libdc_a_CPPFLAGS = -I/usr/include/SDL -I$(top_srcdir)/yajl/src -O3
+#libdc_a_LDFLAGS = -lstdc++ -lSDL_image -lSDL_sound
+libdc_a_LIBADD = $(top_srcdir)/yajl/libyajl.a
+
+
+bin_PROGRAMS = yoink
+
+yoink_SOURCES = \
+ YoinkApp.cc \
+ YoinkApp.hh \
+ $(ENDLIST)
+
+yoink_CPPFLAGS = -I/usr/include/SDL -O3
+#yoink_LDFLAGS = -lstdc++ -lSDL_image -lSDL_sound
+yoink_LDADD = libdc.a ../yajl/libyajl.a
--- /dev/null
+
+/*******************************************************************************
+
+ Copyright (c) 2009, Charles McGarvey
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+*******************************************************************************/
+
+#include <iostream>
+#include <string>
+
+#include <boost/bind.hpp>
+
+#include "opengl.hh"
+#include "video.hh"
+
+#include "vector.hh"
+
+#include "YoinkApp.hh"
+
+
+YoinkApp::YoinkApp(int argc, char* argv[])
+ : dc::engine("Yoink "VERSION, argc, argv, "yoinkrc")
+{
+ std::cout << "Yoink "VERSION << std::endl
+ << "Compiled " << __TIME__ " " __DATE__ << std::endl
+ << "Send requests, patches, and bug reports to <" PACKAGE_BUGREPORT
+ << ">." << std::endl << std::endl;
+
+ state = 0.0;
+
+ glEnable(GL_TEXTURE_2D);
+
+ heroineTexture = new dc::texture("Heroine.png");
+
+ glShadeModel(GL_SMOOTH);
+ //glEnable(GL_DEPTH_TEST);
+
+ // Enable transparency:
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
+ glLoadIdentity();
+
+}
+
+YoinkApp::~YoinkApp()
+{
+ delete heroineTexture;
+ std::cout << "Goodbye..." << std::endl;
+}
+
+
+void YoinkApp::update(double t, double dt)
+{
+ //dt *= 0.1;
+
+ prevstate = state;
+ state += dt;
+}
+
+void drawrect(dc::scalar a, dc::scalar b, dc::scalar c, dc::scalar d)
+{
+ glBegin(GL_QUADS);
+ glTexCoord2f(1.0, 1.0);
+ glVertex3d(a, d, 0.0);
+ glTexCoord2f(1.0, 0.0);
+ glVertex3d(a, b, 0.0);
+ glTexCoord2f(0.0, 0.0);
+ glVertex3d(c, b, 0.0);
+ glTexCoord2f(0.0, 1.0);
+ glVertex3d(c, d, 0.0);
+ glEnd();
+}
+
+void YoinkApp::draw(double alpha)
+{
+ static dc::vector3 c1 = dc::vector3::random(0.0, 1.0);
+ static dc::vector3 c2 = dc::vector3::random(0.0, 1.0);
+
+ glClearColor(1.0, 0.0, 0.0, 1.0);
+ glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
+
+ double drawstate = state * alpha + prevstate * (1.0 - alpha);
+ double sinstate = std::sin(drawstate);
+ double cosstate = std::cos(drawstate);
+
+ glBindTexture(GL_TEXTURE_2D, 0);
+
+ glColor3dv(c1.array);
+ drawrect(-cosstate, -sinstate, sinstate, cosstate);
+ glColor3dv(c2.array);
+ drawrect(0.0, 0.0, sinstate, cosstate);
+
+ glColor4f(1.0, 1.0, 1.0, 1.0);
+
+ heroineTexture->bind();
+
+ glBegin(GL_QUADS);
+ glTexCoord2f(0.0, 0.0);
+ glVertex3f(0.0, 0.0, 0.0);
+ glTexCoord2f(1.0/8.0, 0.0);
+ glVertex3f(1.0, 0.0, 0.0);
+ glTexCoord2f(1.0/8.0, 1.0/4.0);
+ glVertex3f(1.0, 1.0, 0.0);
+ glTexCoord2f(0.0, 1.0/4.0);
+ glVertex3f(0.0, 1.0, 0.0);
+ glEnd();
+
+ glFlush();
+}
+
+void YoinkApp::dispatchEvent(const SDL_Event& event)
+{
+ switch (event.type)
+ {
+ case SDL_KEYDOWN:
+ if (event.key.keysym.sym == SDLK_ESCAPE)
+ {
+ stop();
+ }
+ else if (event.key.keysym.sym == SDLK_f)
+ {
+ getVideo().toggleFull();
+ }
+ break;
+
+ case SDL_QUIT:
+ stop();
+ break;
+ }
+}
+
+
+#include "dispatcher.hh"
+
+class Foo : public dc::notification
+{
+public:
+ static void func(const dc::notification& meh)
+ {
+ std::cout << "func: " << std::endl;
+ }
+
+ void snap(int zzz, const dc::notification& nice, float lean)
+ {
+ std::cout << "snap: " << zzz << "," << lean << std::endl;
+ }
+};
+
+void MyHandler(const dc::notification& cool)
+{
+ std::cout << "MyHandler with a notification" << std::endl;
+}
+
+
+int main(int argc, char* argv[])
+{
+ YoinkApp app(argc, argv);
+ return app.run();
+}
+
--- /dev/null
+
+/*******************************************************************************
+
+ Copyright (c) 2009, Charles McGarvey
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+*******************************************************************************/
+
+#ifndef _YOINKAPP_HH_
+#define _YOINKAPP_HH_
+
+#include <iostream>
+#include <string>
+
+#include "engine.hh"
+
+#include "texture.hh"
+
+
+class YoinkApp : public dc::engine
+{
+public:
+ YoinkApp(int argc, char* argv[]);
+ ~YoinkApp();
+
+private:
+ void update(double t, double dt);
+ void draw(double alpha);
+ void dispatchEvent(const SDL_Event& event);
+
+ dc::texture* heroineTexture;
+
+ double state;
+ double prevstate;
+};
+
+
+#endif // _YOINKAPP_HH_
+
--- /dev/null
+
+/*******************************************************************************
+
+ Copyright (c) 2009, Charles McGarvey
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+*******************************************************************************/
+
+#include <fstream>
+#include <queue>
+
+#include <yajl/yajl_parse.h>
+
+#include "serializable.hh"
+#include "deserializer.hh"
+
+
+namespace dc {
+
+
+class deserializer_impl
+{
+public:
+ deserializer_impl(const std::string& filePath, bool comments = false,
+ bool check = false)
+ {
+ std::ifstream* input = new std::ifstream(filePath.c_str());
+ init(*input, true, comments, check);
+ }
+
+ deserializer_impl(std::istream& input, bool comments = false,
+ bool check = false)
+ {
+ init(input, false, comments, check);
+ }
+
+ ~deserializer_impl()
+ {
+ while (!parsed.empty())
+ {
+ delete parsed.front();
+ parsed.pop();
+ }
+
+ if (deleteWhenDone)
+ {
+ delete in;
+ }
+ yajl_free(hand);
+ }
+
+ void throwError()
+ {
+ unsigned char* errorMsg = yajl_get_error(hand, 0, 0, 0);
+ deserializer::parser_error error((char*)errorMsg);
+ yajl_free_error(hand, errorMsg);
+ throw error;
+ }
+
+
+ static int parsedNull(void* ctx)
+ {
+ ((deserializer_impl*)ctx)->parsed.push(new null);
+ return 1;
+ }
+
+ static int parsedBoolean(void* ctx, int value)
+ {
+ ((deserializer_impl*)ctx)->parsed.push(new wrapped_boolean(value));
+ return 1;
+ }
+
+ static int parsedInteger(void* ctx, long value)
+ {
+ ((deserializer_impl*)ctx)->parsed.push(new wrapped_integer(value));
+ return 1;
+ }
+
+ static int parsedFloat(void* ctx, double value)
+ {
+ ((deserializer_impl*)ctx)->parsed.push(new wrapped_real(value));
+ return 1;
+ }
+
+ static int parsedString(void* ctx, const unsigned char* value,
+ unsigned length)
+ {
+ wrapped_string* parsed = new wrapped_string(std::string((char*)value,
+ length));
+ ((deserializer_impl*)ctx)->parsed.push(parsed);
+ return 1;
+ }
+
+ static int parsedBeginMap(void* ctx)
+ {
+ ((deserializer_impl*)ctx)->parsed.push(new wrapped_dictionary);
+ }
+
+ static int parsedMapKey(void* ctx, const unsigned char* value,
+ unsigned length)
+ {
+ return parsedString(ctx, value, length);
+ }
+
+ static int parsedEndMap(void* ctx)
+ {
+ ((deserializer_impl*)ctx)->parsed.push(0);
+ return 1;
+ }
+
+ static int parsedBeginArray(void* ctx)
+ {
+ ((deserializer_impl*)ctx)->parsed.push(new wrapped_array);
+ return 1;
+ }
+
+ static int parsedEndArray(void* ctx)
+ {
+ ((deserializer_impl*)ctx)->parsed.push(0);
+ return 1;
+ }
+
+
+ void parse()
+ {
+ unsigned char buffer[4096];
+
+ yajl_status stat;
+
+ while (parsed.empty() && in->good())
+ {
+ in->read((char*)buffer, sizeof(buffer));
+ unsigned readIn = in->gcount();
+
+ if (readIn > 0)
+ {
+ stat = yajl_parse(hand, buffer, readIn);
+ }
+ else
+ {
+ stat = yajl_parse_complete(hand);
+ }
+
+ if (stat != yajl_status_ok &&
+ stat != yajl_status_insufficient_data)
+ {
+ throwError();
+ }
+ }
+ }
+
+
+ yajl_handle hand;
+
+ std::istream* in;
+ bool deleteWhenDone;
+
+ std::queue<serializable*> parsed;
+
+private:
+ void init(std::istream& input, bool deleteIn, bool comments, bool check)
+ {
+ const yajl_callbacks callbacks =
+ {
+ deserializer_impl::parsedNull,
+ deserializer_impl::parsedBoolean,
+ deserializer_impl::parsedInteger,
+ deserializer_impl::parsedFloat,
+ 0,
+ deserializer_impl::parsedString,
+ deserializer_impl::parsedBeginMap,
+ deserializer_impl::parsedMapKey,
+ deserializer_impl::parsedEndMap,
+ deserializer_impl::parsedBeginArray,
+ deserializer_impl::parsedEndArray
+ };
+
+ in = &input;
+ deleteWhenDone = deleteIn;
+
+ yajl_parser_config config = {comments, check};
+ hand = yajl_alloc(&callbacks, &config, NULL, this);
+ }
+};
+
+
+deserializer::deserializer(const std::string& filePath, bool comments,
+ bool check) : impl(new deserializer_impl(filePath, comments, check)) {}
+
+deserializer::deserializer(std::istream& input, bool comments, bool check) :
+ impl(new deserializer_impl(input, comments, check)) {}
+
+
+serializable_ptr deserializer::deserialize()
+{
+ serializable* ptr = pullNext();
+ if (ptr)
+ {
+ ptr->deserialize(*this);
+ }
+ return serializable_ptr(ptr);
+}
+
+
+serializable* deserializer::pullNext()
+{
+ impl->parse();
+ if (!impl->parsed.empty())
+ {
+ serializable* ptr = impl->parsed.front();
+ return ptr;
+ }
+ return 0;
+}
+
+void deserializer::pop()
+{
+ impl->parsed.pop();
+}
+
+
+} // namespace dc
+
--- /dev/null
+
+/*******************************************************************************
+
+ Copyright (c) 2009, Charles McGarvey
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+*******************************************************************************/
+
+#ifndef _DESERIALIZER_HH_
+#define _DESERIALIZER_HH_
+
+/**
+ * @file deserializer.hh
+ * Deserialize structures and types from input on a stream.
+ */
+
+#include <istream>
+#include <string>
+#include <stdexcept>
+
+#include <boost/shared_ptr.hpp>
+
+
+namespace dc {
+
+
+class serializable;
+typedef boost::shared_ptr<serializable> serializable_ptr;
+
+class deserializer_impl;
+
+class deserializer
+{
+public:
+ deserializer(const std::string& filePath, bool comments = false,
+ bool check = false);
+ deserializer(std::istream& input, bool comments = false, bool check = false);
+
+ serializable_ptr deserialize();
+
+ serializable* pullNext();
+ void pop();
+
+ struct parser_error : std::runtime_error
+ {
+ explicit parser_error(const std::string& what_arg) :
+ std::runtime_error(what_arg) {}
+ };
+
+private:
+ boost::shared_ptr<deserializer_impl> impl;
+};
+
+
+} // namespace dc
+
+
+#endif // _DESERIALIZER_HH_
+
--- /dev/null
+
+/*******************************************************************************
+
+ Copyright (c) 2009, Charles McGarvey
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+*******************************************************************************/
+
+#include <map>
+
+#include "dispatcher.hh"
+
+
+namespace dc {
+
+
+notification::~notification() {}
+
+
+class dispatcher_impl
+{
+public:
+ dispatcher_impl() : id(1) {}
+
+ dispatcher::handler getNewHandlerID()
+ {
+ id += 4;
+ return (dispatcher::handler)id;
+ }
+
+ typedef std::pair<dispatcher::handler,dispatcher::function> callback_t;
+ typedef std::multimap<std::string,callback_t> callback_lookup_t;
+ typedef callback_lookup_t::iterator callback_it_t;
+
+ typedef std::multimap<dispatcher::handler,std::string> handler_lookup_t;
+ typedef handler_lookup_t::iterator handler_it_t;
+
+ unsigned long long id;
+
+ callback_lookup_t callbacks;
+ handler_lookup_t handlers;
+};
+
+
+dispatcher::dispatcher() : impl(new dispatcher_impl) {}
+
+
+dispatcher::handler dispatcher::addHandler(const std::string& message,
+ const function& callback)
+{
+ return addHandler(message, callback, impl->getNewHandlerID());
+}
+
+dispatcher::handler dispatcher::addHandler(const std::string& message,
+ const function& callback, handler id)
+{
+ std::pair<std::string,dispatcher_impl::callback_t>
+ callbackPair(message, dispatcher_impl::callback_t(id, callback));
+
+ std::pair<handler,std::string> handlerPair(id, message);
+
+ impl->callbacks.insert(callbackPair);
+ impl->handlers.insert(handlerPair);
+
+ return id;
+}
+
+
+void dispatcher::removeHandler(handler id)
+{
+ std::pair<dispatcher_impl::handler_it_t,dispatcher_impl::handler_it_t>
+ handlers(impl->handlers.equal_range(id));
+
+ dispatcher_impl::handler_it_t i;
+ for (i = handlers.first; i != handlers.second; i++)
+ {
+ dispatcher_impl::callback_it_t it = impl->callbacks.find((*i).second);
+ dispatcher_impl::callback_it_t last = impl->callbacks.end();
+
+ dispatcher_impl::callback_it_t j;
+ for (j = it; j != last; j++)
+ {
+ if (((*j).second).first == id)
+ {
+ impl->callbacks.erase(j);
+ break;
+ }
+ }
+ }
+
+ impl->handlers.erase(id);
+}
+
+
+void dispatcher::dispatch(const std::string& message)
+{
+ dispatch(message, notification());
+}
+
+void dispatcher::dispatch(const std::string& message, const notification& param)
+{
+ std::pair<dispatcher_impl::callback_it_t,dispatcher_impl::callback_it_t>
+ callbacks(impl->callbacks.equal_range(message));
+
+ dispatcher_impl::callback_it_t i;
+ for (i = callbacks.first; i != callbacks.second; i++)
+ {
+ function callback = ((*i).second).second;
+ callback(param);
+ }
+}
+
+
+} // namespace dc
+
--- /dev/null
+
+/*******************************************************************************
+
+ Copyright (c) 2009, Charles McGarvey
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+*******************************************************************************/
+
+#ifndef _DISPATCHER_HH_
+#define _DISPATCHER_HH_
+
+/**
+ * @file dispatcher.hh
+ * Dispatching of information.
+ */
+
+#include <string>
+
+#include <boost/shared_ptr.hpp>
+#include <boost/function.hpp>
+
+#include "singleton.hh"
+
+
+namespace dc {
+
+
+// Subclass this to create more specific notes to dispatch.
+class notification
+{
+public:
+ virtual ~notification();
+};
+
+
+class dispatcher_impl;
+
+class dispatcher : public singleton<dispatcher>
+{
+public:
+ typedef void* handler;
+
+ dispatcher();
+
+ typedef boost::function<void(const notification&)> function;
+
+ handler addHandler(const std::string& message, const function& callback);
+ handler addHandler(const std::string& message, const function& callback,
+ handler id);
+
+ void removeHandler(handler id);
+
+ void dispatch(const std::string& message);
+ void dispatch(const std::string& message, const notification& param);
+
+private:
+ boost::shared_ptr<dispatcher_impl> impl;
+};
+
+
+} // namespace dc
+
+#endif // _DISPATCHER_HH_
+
--- /dev/null
+
+/*******************************************************************************
+
+ Copyright (c) 2009, Charles McGarvey
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+*******************************************************************************/
+
+#include <iostream>
+#include <cstdlib> // exit
+#include <string>
+#include <stdexcept>
+
+#include <SDL/SDL.h>
+#include "fastevents.h"
+
+#include "random.hh"
+#include "timer.hh"
+#include "video.hh"
+#include "settings.hh"
+#include "dispatcher.hh"
+
+#include "engine.hh"
+
+
+namespace dc {
+
+
+class engine_impl
+{
+public:
+ engine_impl(const std::string& name, int argc, char* argv[],
+ const std::string& configFile, engine* outer) : config(argc, argv),
+ interface(outer)
+ {
+ if (SDL_Init(SDL_INIT_EVERYTHING | SDL_INIT_EVENTTHREAD) != 0)
+ {
+ throw std::runtime_error(SDL_GetError());
+ }
+ if (FE_Init() != 0)
+ {
+ throw std::runtime_error(FE_GetError());
+ }
+
+ rng::seed();
+
+ config.loadFromFile(configFile);
+
+ screen = video_ptr(new video(name));
+ screen->makeActive();
+
+ timestep = 0.01;
+ config.get("engine.timestep", timestep);
+
+ long maxfps = 40;
+ config.get("engine.maxfps", maxfps);
+ drawrate = 1.0 / scalar(maxfps);
+
+ printfps = false;
+ config.get("engine.printfps", printfps);
+ }
+
+ ~engine_impl()
+ {
+ // The video object must be destroyed before we can shutdown SDL.
+ screen.reset();
+
+ FE_Quit();
+ SDL_Quit();
+ }
+
+
+ int run()
+ {
+ scalar ticksNow = ticks();
+
+ scalar nextStep = ticksNow;
+ scalar nextDraw = ticksNow;
+ scalar nextFPSUpdate = ticksNow + 1.0;
+
+ scalar totalTime = 0.0;
+ scalar accumulator = 0.0;
+
+ fps = 0.0;
+ int frameAccum = 0.0;
+
+ running = true;
+ do
+ {
+ dispatchEvents();
+
+ scalar newTicks = ticks();
+ accumulator += newTicks - ticksNow;
+ ticksNow = newTicks;
+
+ if (ticksNow >= nextStep)
+ {
+ interface->update(totalTime, timestep);
+
+ totalTime += timestep;
+ accumulator -= timestep;
+
+ nextStep += timestep;
+ if (ticksNow >= nextStep) nextStep = ticksNow + timestep;
+ }
+
+ if (ticksNow >= nextDraw)
+ {
+ frameAccum++;
+
+ if (ticksNow >= nextFPSUpdate)
+ {
+ fps = frameAccum;// + (ticksNow - nextFPSUpdate) / 1.0;
+ frameAccum = 0;
+
+ nextFPSUpdate += 1.0;
+ if (ticksNow >= nextFPSUpdate) nextFPSUpdate = ticksNow + 1.0;
+
+ if (printfps)
+ {
+ std::cout << "FPS: " << fps << std::endl;
+ }
+ }
+
+ interface->draw(accumulator / timestep);
+ screen->swap();
+
+ nextDraw += drawrate;
+ if (ticksNow >= nextDraw) nextDraw = ticksNow + drawrate;
+ }
+
+ sleep(std::min(nextStep, nextDraw), true);
+ }
+ while (running);
+ }
+
+
+ void dispatchEvents()
+ {
+ SDL_Event event;
+
+ while (FE_PollEvent(&event) == 1)
+ {
+ switch (event.type)
+ {
+ case SDL_KEYDOWN:
+ if (event.key.keysym.sym == SDLK_ESCAPE &&
+ (SDL_GetModState() & KMOD_CTRL) )
+ {
+ exit(0);
+ }
+ break;
+
+ case SDL_VIDEORESIZE:
+ screen->resize(event.resize.w, event.resize.h);
+ break;
+ }
+
+ interface->dispatchEvent(event);
+ }
+ }
+
+
+ settings config;
+ dispatcher relay;
+ video_ptr screen;
+
+ bool running;
+
+ scalar timestep;
+ scalar drawrate;
+
+ long fps;
+ bool printfps;
+
+ engine* interface;
+};
+
+engine::engine(const std::string& name, int argc, char* argv[],
+ const std::string& configFile)
+ : impl(new engine_impl(name, argc, argv, configFile, this)) {}
+
+engine::~engine() {}
+
+
+int engine::run()
+{
+ impl->run();
+}
+
+void engine::stop()
+{
+ impl->running = false;
+}
+
+
+void engine::setTimestep(scalar ts)
+{
+ impl->timestep = ts;
+}
+
+scalar engine::getTimestep()
+{
+ return impl->timestep;
+}
+
+void engine::setMaxFPS(long maxfps)
+{
+ impl->drawrate = 1.0 / scalar(maxfps);
+}
+
+long engine::getMaxFPS()
+{
+ return long(1.0 / impl->drawrate);
+}
+
+
+video& engine::getVideo()
+{
+ return *impl->screen;
+}
+
+long engine::getFPS()
+{
+ return impl->fps;
+}
+
+
+void engine::update(scalar t, scalar dt) {}
+void engine::draw(scalar alpha) {}
+void engine::dispatchEvent(const SDL_Event& event) {}
+
+
+} // namespace dc
+
--- /dev/null
+
+/*******************************************************************************
+
+ Copyright (c) 2009, Charles McGarvey
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+*******************************************************************************/
+
+#ifndef _ENGINE_HH_
+#define _ENGINE_HH_
+
+#include <boost/shared_ptr.hpp>
+#include <SDL/SDL.h>
+
+#include "singleton.hh"
+#include "dispatcher.hh"
+
+
+namespace dc {
+
+
+class engine_impl;
+class video;
+
+class engine : public singleton<engine>
+{
+public:
+ engine(const std::string& name, int argc, char* argv[],
+ const std::string& configFile);
+ virtual ~engine();
+
+ int run();
+ void stop();
+
+ void setTimestep(scalar ts);
+ scalar getTimestep();
+ void setMaxFPS(long maxfps);
+ long getMaxFPS();
+
+ video& getVideo();
+ long getFPS();
+
+ // Override these if you want.
+ virtual void update(scalar t, scalar dt);
+ virtual void draw(scalar alpha);
+ virtual void dispatchEvent(const SDL_Event& event);
+
+private:
+ boost::shared_ptr<engine_impl> impl;
+};
+
+
+} // namespace dc
+
+#endif // _ENGINE_HH_
+
--- /dev/null
+
+/*******************************************************************************
+
+ Copyright (c) 2009, Charles McGarvey
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+*******************************************************************************/
+
+#ifndef _EVENT_HH_
+#define _EVENT_HH_
+
+#include "bz/date.h"
+#include "bz/object.h"
+
+
+namespace bz {
+
+
+class event
+{
+public:
+ typedef enum
+ {
+ left_click_down = 1<<1,
+ left_click_up = 1<<2,
+ right_click_down = 1<<3,
+ right_click_up = 1<<4,
+ other_click_down = 1<<5,
+ other_click_up = 1<<6,
+ mouse_moved = 1<<7,
+ mouse_entered = 1<<8,
+ mouse_exited = 1<<9,
+ key_down = 1<<10,
+ key_up = 1<<11,
+ activated = 1<<12,
+ iconified = 1<<13,
+ deactivated = 1<<14,
+
+ file_new = 1<<20,
+ file_open = 1<<21,
+ file_revert = 1<<22,
+ file_save = 1<<23,
+ file_save_as = 1<<24,
+ edit_undo = 1<<25,
+ edit_redo = 1<<26,
+ edit_copy = 1<<27,
+ edit_cut = 1<<28,
+ edit_paste = 1<<29,
+ edit_select_all = 1<<30,
+ app_quit = 1<<31,
+ any = 0xffffffffU
+ } type;
+
+ // This constructor is for keyboard events:
+ event( type theType, // What happened?
+ unsigned char keycode, // The ASCII value.
+ int modifiers, // Ctrl, Shift, Opt, etc...
+ bool isRepeat ) : // Is the key held down?
+ type_(theType), keycode_(keycode), modifiers_(modifiers),
+ isRepeat_(isRepeat)
+ {
+ timestamp_ = date();
+ id_ = getIdentifier();
+ }
+
+ // This constructor is for mouse events:
+ event( type theType, // What happened?
+ vec2d location, // Where? (window coordinates)
+ vec2d delta, // How far has it moved?
+ int nClick, // How many consecutive clicks?
+ float pressure ) : // How hard was it pushed?
+ type_(theType), location_(location), delta_(delta), nClick_(nClick),
+ pressure_(pressure)
+ {
+ timestamp_ = date();
+ id_ = getIdentifier();
+ }
+
+ // This constructor is for other event types:
+ event( type theType ) : type_(theType) // What happened?
+ {
+ timestamp_ = date();
+ id_ = getIdentifier();
+ }
+
+ // Accessors for all event types:
+ type kind() const { return type_; }
+ const date& timestamp() const { return timestamp_; }
+ unsigned int identifier() const { return id_; }
+
+ void *userInfo() const { return userInfo_; }
+ void setUserInfo( void* userInfo ) { userInfo_ = userInfo; }
+ unsigned int tag() const { return tag_; }
+ void setTag( unsigned int tag ) { tag_ = tag; }
+
+ // Accessors for keyboard events:
+ unsigned char keycode() const { return keycode_; }
+ int modifiers() const { return modifiers_; }
+ bool isRepeat() const { return isRepeat_; }
+
+ // Accessors for mouse events:
+ const vec2d& location() const { return location_; }
+ const vec2d& delta() const { return delta_; }
+ int clicks() const { return nClick_; }
+ float pressure() const { return pressure_; }
+
+private:
+ unsigned int getIdentifier() {
+ static unsigned int identifier = 1;
+ return identifier++;
+ }
+
+ type type_;
+ date timestamp_;
+ unsigned int id_;
+ void *userInfo_;
+ unsigned int tag_;
+
+ unsigned char keycode_;
+ unsigned char modifiers_;
+ bool isRepeat_;
+
+ vec2d location_;
+ vec2d delta_;
+ int nClick_;
+ float pressure_;
+};
+
+} // namespace dc
+
+#endif // _EVENT_HH_
+
--- /dev/null
+/*
+ NET2 is a threaded, event based, network IO library for SDL.
+ Copyright (C) 2002 Bob Pendleton
+
+ 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
+
+ If you do not wish to comply with the terms of the LGPL please
+ contact the author as other terms are available for a fee.
+
+ Bob Pendleton
+ Bob@Pendleton.com
+*/
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "SDL.h"
+#include "SDL_thread.h"
+
+#include "fastevents.h"
+
+//----------------------------------------
+//
+// error handling code
+//
+
+static char* error = NULL;
+
+static __inline__ void setError(char *err)
+{
+ error = err;
+}
+
+char *FE_GetError()
+{
+ return error;
+}
+
+//----------------------------------------
+//
+// Threads, mutexs, thread utils, and
+// thread safe wrappers
+//
+
+static SDL_mutex *eventLock = NULL;
+static SDL_cond *eventWait = NULL;
+static SDL_TimerID eventTimer = 0;
+
+//----------------------------------------
+//
+//
+//
+
+int FE_PushEvent(SDL_Event *ev)
+{
+ SDL_LockMutex(eventLock);
+ while (-1 == SDL_PushEvent(ev))
+ {
+ SDL_CondWait(eventWait, eventLock);
+ }
+ SDL_UnlockMutex(eventLock);
+ SDL_CondSignal(eventWait);
+
+ return 1;
+}
+
+//----------------------------------------
+//
+//
+//
+
+void FE_PumpEvents()
+{
+ SDL_LockMutex(eventLock);
+ SDL_PumpEvents();
+ SDL_UnlockMutex(eventLock);
+}
+
+//----------------------------------------
+//
+//
+//
+
+int FE_PollEvent(SDL_Event *event)
+{
+ int val = 0;
+
+ SDL_LockMutex(eventLock);
+ val = SDL_PollEvent(event);
+ SDL_UnlockMutex(eventLock);
+
+ if (0 < val)
+ {
+ SDL_CondSignal(eventWait);
+ }
+
+ return val;
+}
+
+//----------------------------------------
+//
+// Replacement for SDL_WaitEvent();
+//
+
+int FE_WaitEvent(SDL_Event *event)
+{
+ int val = 0;
+
+ SDL_LockMutex(eventLock);
+ while (0 >= (val = SDL_PollEvent(event)))
+ {
+ SDL_CondWait(eventWait, eventLock);
+ }
+ SDL_UnlockMutex(eventLock);
+ SDL_CondSignal(eventWait);
+
+ return val;
+}
+
+//----------------------------------------
+//
+//
+//
+
+static Uint32 timerCallback(Uint32 interval, void *param)
+{
+ SDL_CondBroadcast(eventWait);
+
+ return interval;
+}
+
+//----------------------------------------
+//
+//
+//
+
+int FE_Init()
+{
+ if (0 == (SDL_INIT_TIMER & SDL_WasInit(SDL_INIT_TIMER)))
+ {
+ SDL_InitSubSystem(SDL_INIT_TIMER);
+ }
+
+ eventLock = SDL_CreateMutex();
+ if (NULL == eventLock)
+ {
+ setError("FE: can't create a mutex");
+ return -1;
+ }
+
+ eventWait = SDL_CreateCond();
+ if (NULL == eventWait)
+ {
+ setError("FE: can't create a condition variable");
+ return -1;
+ }
+
+ eventTimer = SDL_AddTimer(10, timerCallback, NULL);
+ if (NULL == eventTimer)
+ {
+ setError("FE: can't add a timer");
+ return -1;
+ }
+
+ return 0;
+}
+
+//----------------------------------------
+//
+//
+//
+
+void FE_Quit()
+{
+ SDL_DestroyMutex(eventLock);
+ eventLock = NULL;
+
+ SDL_DestroyCond(eventWait);
+ eventWait = NULL;
+
+ SDL_RemoveTimer(eventTimer);
+}
--- /dev/null
+#ifndef _FASTEVENTS_H_
+#define _FASTEVENTS_H_
+/*
+ NET2 is a threaded, event based, network IO library for SDL.
+ Copyright (C) 2002 Bob Pendleton
+
+ 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
+
+ If you do not wish to comply with the terms of the LGPL please
+ contact the author as other terms are available for a fee.
+
+ Bob Pendleton
+ Bob@Pendleton.com
+*/
+
+#include "SDL.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ int FE_Init(); // Initialize FE
+ void FE_Quit(); // shutdown FE
+
+ void FE_PumpEvents(); // replacement for SDL_PumpEvents
+ int FE_PollEvent(SDL_Event *event); // replacement for SDL_PollEvent
+ int FE_WaitEvent(SDL_Event *event); // replacement for SDL_WaitEvent
+ int FE_PushEvent(SDL_Event *event); // replacement for SDL_PushEvent
+
+ char *FE_GetError(); // get the last error
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null
+
+/*******************************************************************************
+
+ Copyright (c) 2009, Charles McGarvey
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+*******************************************************************************/
+
+#include "math.hh"
+#include "vector.hh"
+#include "matrix.hh"
+
+
+namespace dc {
+
+
+vector2 vector2::zero(0.0, 0.0);
+vector3 vector3::zero(0.0, 0.0, 0.0);
+
+matrix3 matrix3::zero(0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0);
+matrix3 matrix3::identity(1.0, 0.0, 0.0,
+ 0.0, 1.0, 0.0,
+ 0.0, 0.0, 1.0);
+
+matrix4 matrix4::zero(0.0, 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, 0.0);
+matrix4 matrix4::identity(1.0, 0.0, 0.0, 0.0,
+ 0.0, 1.0, 0.0, 0.0,
+ 0.0, 0.0, 1.0, 0.0,
+ 0.0, 0.0, 0.0, 1.0);
+
+
+} // namespace dc
+
--- /dev/null
+
+/*******************************************************************************
+
+ Copyright (c) 2009, Charles McGarvey
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+*******************************************************************************/
+
+/**
+ * @file math.hh
+ * General math-related types and functions.
+ */
+
+#ifndef _MATH_HH_
+#define _MATH_HH_
+
+#include <cmath>
+
+
+namespace dc {
+
+
+typedef double scalar; ///< Scalar variable.
+
+
+// Here's a simple way to check the equality of floating-point variables more
+// reliably using approximation.
+
+const scalar default_epsilon = 0.00001; ///< @see equals()
+
+
+/**
+ * Check the equality of scalars with a certain degree of error allowed.
+ */
+
+inline bool equals(scalar a, scalar b, scalar epsilon = default_epsilon)
+{
+ return std::abs(a - b) < epsilon;
+}
+
+
+} // namespace dc
+
+
+#endif // _MATH_HH_
+
--- /dev/null
+
+/*******************************************************************************
+
+ Copyright (c) 2009, Charles McGarvey
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+*******************************************************************************/
+
+#ifndef _MATRIX_HH_
+#define _MATRIX_HH_
+
+/**
+ * @file matrix.hh
+ * Matrix classes.
+ */
+
+#include <cassert>
+
+#include "math.hh"
+
+
+namespace dc {
+
+/**
+ * 3x3 matrix.
+ */
+
+struct matrix3
+{
+ matrix3() {}
+ matrix3(scalar M11, scalar M12, scalar M13,
+ scalar M21, scalar M22, scalar M23,
+ scalar M31, scalar M32, scalar M33)
+ {
+ m11 = M11; m12 = M12; m13 = M13;
+ m21 = M21; m22 = M22; m23 = M23;
+ m31 = M31; m32 = M32; m33 = M33;
+ }
+ matrix3(scalar m[9])
+ {
+ array[0] = m[0]; array[1] = m[1]; array[2] = m[2];
+ array[3] = m[3]; array[4] = m[4]; array[5] = m[5];
+ array[6] = m[6]; array[7] = m[7]; array[8] = m[8];
+ }
+
+ const scalar& operator[](int i) const
+ {
+ assert(i >= 0 && i <= 8 && "Index into matrix3 out of bounds.");
+ return array[i];
+ }
+ scalar& operator[](int i)
+ {
+ assert(i >= 0 && i <= 8 && "Index into matrix3 out of bounds.");
+ return array[i];
+ }
+
+ matrix3 operator+(const matrix3& m) const
+ {
+ return matrix3(m11 + m.m11, m12 + m.m12, m13 + m.m13,
+ m21 + m.m21, m22 + m.m22, m23 + m.m23,
+ m31 + m.m31, m32 + m.m32, m33 + m.m33);
+ }
+ matrix3 operator-(const matrix3& m) const
+ {
+ return matrix3(m11 - m.m11, m12 - m.m12, m13 - m.m13,
+ m21 - m.m21, m22 - m.m22, m23 - m.m23,
+ m31 - m.m31, m32 - m.m32, m33 - m.m33);
+ }
+ matrix3 operator*(const matrix3& m) const
+ {
+ return matrix3(m11 * m.m11 + m12 * m.m21 + m13 * m.m31,
+ m11 * m.m12 + m12 * m.m22 + m13 * m.m32,
+ m11 * m.m13 + m12 * m.m23 + m13 * m.m33,
+ m21 * m.m11 + m22 * m.m21 + m23 * m.m31,
+ m21 * m.m12 + m22 * m.m22 + m23 * m.m32,
+ m21 * m.m13 + m22 * m.m23 + m23 * m.m33,
+ m31 * m.m11 + m32 * m.m21 + m33 * m.m31,
+ m31 * m.m12 + m32 * m.m22 + m33 * m.m32,
+ m32 * m.m13 + m32 * m.m23 + m33 * m.m33);
+ }
+ matrix3 operator*(scalar s) const
+ {
+ return matrix3(m11 * s, m12 * s, m13 * s,
+ m21 * s, m22 * s, m23 * s,
+ m31 * s, m32 * s, m33 * s);
+ }
+ matrix3 operator/(scalar s) const
+ {
+ return matrix3(m11 / s, m12 / s, m13 / s,
+ m21 / s, m22 / s, m23 / s,
+ m31 / s, m32 / s, m33 / s);
+ }
+
+ matrix3& operator+=(const matrix3& m)
+ {
+ m11 += m.m11; m12 += m.m12; m13 += m.m13;
+ m21 += m.m21; m22 += m.m22; m23 += m.m23;
+ m31 += m.m31; m32 += m.m32; m33 += m.m33;
+ return *this;
+ }
+ matrix3& operator-=(const matrix3& m)
+ {
+ m11 -= m.m11; m12 -= m.m12; m13 -= m.m13;
+ m21 -= m.m21; m22 -= m.m22; m23 -= m.m23;
+ m31 -= m.m31; m32 -= m.m32; m33 -= m.m33;
+ return *this;
+ }
+ matrix3& operator*=(const matrix3& m)
+ {
+ return *this = *this * m;
+ }
+ matrix3& operator*=(scalar s)
+ {
+ m11 *= s; m12 *= s; m13 *= s;
+ m21 *= s; m22 *= s; m23 *= s;
+ m31 *= s; m32 *= s; m33 *= s;
+ return *this;
+ }
+ matrix3& operator/=(scalar s)
+ {
+ m11 /= s; m12 /= s; m13 /= s;
+ m21 /= s; m22 /= s; m23 /= s;
+ m31 /= s; m32 /= s; m33 /= s;
+ return *this;
+ }
+
+ matrix3 operator-() const
+ {
+ return matrix3(-m11, -m12, -m13,
+ -m21, -m22, -m23,
+ -m31, -m32, -m33);
+ }
+
+ bool operator==(const matrix3& m) const
+ {
+ return equals(m11,m.m11) && equals(m12,m.m12) && equals(m13,m.m13) &&
+ equals(m21,m.m21) && equals(m22,m.m22) && equals(m23,m.m23) &&
+ equals(m31,m.m31) && equals(m32,m.m32) && equals(m33,m.m33);
+ }
+ bool operator!=(const matrix3& m) const
+ {
+ return !(*this == m);
+ }
+
+
+ union
+ {
+ struct
+ {
+ scalar m11, m21, m31;
+ scalar m12, m22, m32;
+ scalar m13, m23, m33; ///< scalars
+ };
+ scalar array[9]; ///< array
+ };
+
+ static matrix3 zero; ///< zero matrix
+ static matrix3 identity; ///< identity matrix
+};
+
+inline matrix3 operator*(scalar s, const matrix3& m)
+{
+ return m * s;
+}
+inline matrix3 operator/(scalar s, const matrix3& m)
+{
+ return matrix3(s / m.m11, s / m.m12, s / m.m13,
+ s / m.m21, s / m.m22, s / m.m23,
+ s / m.m31, s / m.m32, s / m.m33);
+}
+
+
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+/**
+ * 4x4 matrix.
+ */
+
+struct matrix4
+{
+ matrix4() {}
+ matrix4(scalar M11, scalar M12, scalar M13, scalar M14,
+ scalar M21, scalar M22, scalar M23, scalar M24,
+ scalar M31, scalar M32, scalar M33, scalar M34,
+ scalar M41, scalar M42, scalar M43, scalar M44)
+ {
+ m11 = M11; m12 = M12; m13 = M13; m14 = M14;
+ m21 = M21; m22 = M22; m23 = M23; m24 = M24;
+ m31 = M31; m32 = M32; m33 = M33; m34 = M34;
+ m41 = M41; m42 = M42; m43 = M43; m44 = M44;
+ }
+ matrix4(scalar m[15])
+ {
+ array[0] = m[0]; array[1] = m[1]; array[2] = m[2]; array[3] = m[3];
+ array[4] = m[4]; array[5] = m[5]; array[6] = m[6]; array[7] = m[7];
+ array[8] = m[8]; array[9] = m[9]; array[10] = m[10]; array[11] = m[11];
+ array[12] = m[12]; array[13] = m[13]; array[14] = m[14]; array[15] = m[15];
+ }
+
+ const scalar& operator[](int i) const
+ {
+ assert(i >= 0 && i <= 15 && "Index into matrix4 out of bounds.");
+ return array[i];
+ }
+ scalar& operator[](int i)
+ {
+ assert(i >= 0 && i <= 15 && "Index into matrix4 out of bounds.");
+ return array[i];
+ }
+
+ matrix4 operator+(const matrix4& m) const
+ {
+ return matrix4(m11 + m.m11, m12 + m.m12, m13 + m.m13, m14 + m.m14,
+ m21 + m.m21, m22 + m.m22, m23 + m.m23, m24 + m.m24,
+ m31 + m.m31, m32 + m.m32, m33 + m.m33, m34 + m.m34,
+ m41 + m.m41, m42 + m.m42, m43 + m.m43, m44 + m.m44);
+ }
+ matrix4 operator-(const matrix4& m) const
+ {
+ return matrix4(m11 - m.m11, m12 - m.m12, m13 - m.m13, m14 - m.m14,
+ m21 - m.m21, m22 - m.m22, m23 - m.m23, m24 - m.m24,
+ m31 - m.m31, m32 - m.m32, m33 - m.m33, m34 - m.m34,
+ m41 - m.m41, m42 - m.m42, m43 - m.m43, m44 - m.m44);
+ }
+ matrix4 operator*(const matrix4& m) const // TODO ??
+ {
+ return matrix4(m11 * m.m11 + m12 * m.m21 + m13 * m.m31 + m14 * m.m41,
+ m11 * m.m12 + m12 * m.m22 + m13 * m.m32 + m14 * m.m42,
+ m11 * m.m13 + m12 * m.m23 + m13 * m.m33 + m14 * m.m43,
+ m11 * m.m14 + m12 * m.m24 + m13 * m.m34 + m14 * m.m44,
+ m21 * m.m11 + m22 * m.m21 + m23 * m.m31 + m24 * m.m41,
+ m21 * m.m12 + m22 * m.m22 + m23 * m.m32 + m24 * m.m42,
+ m21 * m.m13 + m22 * m.m23 + m23 * m.m33 + m24 * m.m43,
+ m21 * m.m14 + m22 * m.m24 + m23 * m.m34 + m24 * m.m44,
+ m31 * m.m11 + m32 * m.m21 + m33 * m.m31 + m34 * m.m41,
+ m31 * m.m12 + m32 * m.m22 + m33 * m.m32 + m34 * m.m42,
+ m31 * m.m13 + m32 * m.m23 + m33 * m.m33 + m34 * m.m43,
+ m31 * m.m14 + m32 * m.m24 + m33 * m.m34 + m34 * m.m44,
+ m41 * m.m11 + m42 * m.m21 + m43 * m.m31 + m44 * m.m41,
+ m41 * m.m12 + m42 * m.m22 + m43 * m.m32 + m44 * m.m42,
+ m41 * m.m13 + m42 * m.m23 + m43 * m.m33 + m44 * m.m43,
+ m41 * m.m14 + m42 * m.m24 + m43 * m.m34 + m44 * m.m44);
+ }
+ matrix4 operator*(scalar s) const
+ {
+ return matrix4(m11 * s, m12 * s, m13 * s, m14 * s,
+ m21 * s, m22 * s, m23 * s, m24 * s,
+ m31 * s, m32 * s, m33 * s, m34 * s,
+ m41 * s, m42 * s, m43 * s, m44 * s);
+ }
+ matrix4 operator/(scalar s) const
+ {
+ return matrix4(m11 / s, m12 / s, m13 / s, m14 / s,
+ m21 / s, m22 / s, m23 / s, m24 / s,
+ m31 / s, m32 / s, m33 / s, m34 / s,
+ m41 / s, m42 / s, m43 / s, m44 / s);
+ }
+
+ matrix4& operator+=(const matrix4& m)
+ {
+ m11 += m.m11; m12 += m.m12; m13 += m.m13; m14 += m.m14;
+ m21 += m.m21; m22 += m.m22; m23 += m.m23; m24 += m.m24;
+ m31 += m.m31; m32 += m.m32; m33 += m.m33; m34 += m.m34;
+ m41 += m.m41; m42 += m.m42; m43 += m.m43; m44 += m.m44;
+ return *this;
+ }
+ matrix4& operator-=(const matrix4& m)
+ {
+ m11 -= m.m11; m12 -= m.m12; m13 -= m.m13; m14 -= m.m14;
+ m21 -= m.m21; m22 -= m.m22; m23 -= m.m23; m24 -= m.m24;
+ m31 -= m.m31; m32 -= m.m32; m33 -= m.m33; m34 -= m.m34;
+ m41 -= m.m41; m42 -= m.m42; m43 -= m.m43; m44 -= m.m44;
+ return *this;
+ }
+ matrix4& operator*=(const matrix4& m)
+ {
+ *this = *this * m;
+ return *this;
+ }
+ matrix4& operator*=(scalar s)
+ {
+ m11 *= s; m12 *= s; m13 *= s; m14 *= s;
+ m21 *= s; m22 *= s; m23 *= s; m24 *= s;
+ m31 *= s; m32 *= s; m33 *= s; m34 *= s;
+ m41 *= s; m42 *= s; m43 *= s; m44 *= s;
+ return *this;
+ }
+ matrix4& operator/=(scalar s)
+ {
+ m11 /= s; m12 /= s; m13 /= s; m14 /= s;
+ m21 /= s; m22 /= s; m23 /= s; m24 /= s;
+ m31 /= s; m32 /= s; m33 /= s; m34 /= s;
+ m41 /= s; m42 /= s; m43 /= s; m44 /= s;
+ return *this;
+ }
+
+ matrix4 operator-() const
+ {
+ return matrix4(-m11, -m12, -m13, -m14,
+ -m21, -m22, -m23, -m24,
+ -m31, -m32, -m33, -m34,
+ -m41, -m42, -m43, -m44);
+ }
+
+ bool operator==(const matrix4& m) const
+ {
+ return equals(m11,m.m11) && equals(m12,m.m12) && equals(m13,m.m13) &&
+ equals(m14,m.m14) && equals(m21,m.m21) && equals(m22,m.m22) &&
+ equals(m23,m.m23) && equals(m24,m.m24) && equals(m31,m.m31) &&
+ equals(m32,m.m32) && equals(m33,m.m33) && equals(m34,m.m34) &&
+ equals(m41,m.m41) && equals(m42,m.m42) && equals(m43,m.m43) &&
+ equals(m44,m.m44);
+ }
+ bool operator!=(const matrix4& m) const
+ {
+ return !(*this == m);
+ }
+
+
+ union
+ {
+ struct
+ {
+ scalar m11, m21, m31, m41;
+ scalar m12, m22, m32, m42;
+ scalar m13, m23, m33, m43;
+ scalar m14, m24, m34, m44; ///< scalars
+ };
+ scalar array[16]; ///< array
+ };
+
+ static matrix4 zero; ///< zero matrix
+ static matrix4 identity; ///< identity matrix
+};
+
+inline matrix4 operator*(scalar s, const matrix4& m)
+{
+ return m * s;
+}
+inline matrix4 operator/(scalar s, const matrix4& m)
+{
+ return matrix4(s / m.m11, s / m.m12, s / m.m13, s / m.m14,
+ s / m.m21, s / m.m22, s / m.m23, s / m.m24,
+ s / m.m31, s / m.m32, s / m.m33, s / m.m34,
+ s / m.m41, s / m.m42, s / m.m43, s / m.m44);
+}
+
+
+} // namespace dc
+
+
+#endif // _MATRIX_HH_
+
--- /dev/null
+
+/*******************************************************************************
+
+ Copyright (c) 2009, Charles McGarvey
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+*******************************************************************************/
+
+#ifndef _GL_HH_
+#define _GL_HH_
+
+#ifdef __APPLE__
+#include <OpenGL/gl.h>
+#include <OpenGL/glu.h>
+#include <OpenGL/glext.h>
+#else
+#include <GL/gl.h>
+#include <GL/glu.h>
+#include <GL/glext.h>
+#endif
+
+#endif // _GL_HH_
+
--- /dev/null
+
+/*******************************************************************************
+
+ Copyright (c) 2009, Charles McGarvey
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+*******************************************************************************/
+
+#ifndef _PROFILER_HH_
+#define _PROFILER_HH_
+
+/**
+ * @file profiler.hh
+ * Braindead-simple profiler.
+ */
+
+#include <ctime>
+
+
+namespace dc {
+
+class profiler
+{
+public:
+ profiler(const char* name = "")
+ {
+ start(name);
+ }
+ ~profiler()
+ {
+ stop();
+ }
+
+ void start(const char* name = "")
+ {
+ begin = std::clock();
+ std::cout << "Profiling " << name << "... ";
+ }
+
+ void stop()
+ {
+ if (begin == -1) return;
+ double elapsed = double(std::clock() - begin) / double(CLOCKS_PER_SEC);
+ std::cout << elapsed << " sec" << std::endl;
+ begin = -1;
+ }
+
+ void cancel()
+ {
+ begin = -1;
+ }
+
+private:
+ std::clock_t begin;
+};
+
+} // namespace dc
+
+
+#endif // _PROFILER_HH_
+
--- /dev/null
+
+/*******************************************************************************
+
+ Copyright (c) 2009, Charles McGarvey
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+*******************************************************************************/
+
+#ifndef _QUATERNION_HH_
+#define _QUATERNION_HH_
+
+#include <cassert>
+
+#include "math.hh"
+#include "matrix.hh"
+#include "vector.hh"
+
+
+//
+// Quaternion -> 3x3 Matrix
+//
+// | w^2 + x^2 - y^2 - z^2 2xy - 2wz 2xz + 2yw |
+// | 2xy + 2wz w^2 - x^2 + y^2 - z^2 2yz - 2wx |
+// | 2xz - 2wy 2yz - 2wx w^2 - x^2 - y^2 + z^2 |
+//
+
+namespace dc {
+
+
+class quaternion
+{
+public:
+ // Constructors.
+ quaternion() {}
+ quaternion(scalar X, scalar Y, scalar Z, scalar W) {
+ vec.x = X; vec.y = Y; vec.z = Z; w = W;
+ }
+ quaternion(vector3 v, scalar W = 1.0) {
+ vec = v; w = W;
+ }
+ quaternion(scalar q[4]) {
+ vec.x = q[0]; vec.y = q[1]; vec.z = q[2]; w = q[3];
+ }
+
+ // Accessible by index.
+ const scalar& operator [] (int i) const {
+ assert(i >= 0 && i <= 3 && "Index into quaternion out of bounds.");
+ return *((&vec.x) + i);
+ }
+ scalar& operator [] (int i) {
+ assert(i >= 0 && i <= 3 && "Index into quaternion out of bounds.");
+ //return vec[i];
+ return *((&vec.x) + i);
+ }
+
+ // Basic maths.
+ quaternion operator + (const quaternion& q) const {
+ return quaternion(vec + q.vec, w + q.w);
+ }
+ quaternion operator - (const quaternion& q) const {
+ return quaternion(vec - q.vec, w - q.w);
+ }
+ quaternion operator * (const quaternion& q) const {
+ return quaternion(q.w * vec + w * q.vec + q.vec.cross(vec),
+ w * q.w - q.vec.dot(vec));
+ }
+ quaternion operator * (scalar s) const {
+ return quaternion(vec * s, w * s);
+ }
+ quaternion operator / (scalar s) const {
+ return quaternion(vec / s, w / s);
+ }
+
+ quaternion& operator += (const quaternion& q) {
+ vec += q.vec; w += q.w;
+ return *this;
+ }
+ quaternion& operator -= (const quaternion& q) {
+ vec -= q.vec; w -= q.w;
+ return *this;
+ }
+ quaternion& operator *= (const quaternion& q) {
+ scalar W = w;
+ w = W * q.w - q.vec.dot(vec);
+ vec = q.w * vec + W * q.vec + q.vec.cross(vec);
+ return *this;
+ }
+ quaternion& operator *= (scalar s) {
+ vec *= s; w *= s;
+ return *this;
+ }
+ quaternion& operator /= (scalar s) {
+ vec /= s; w /= s;
+ return *this;
+ }
+
+ // Unary operators.
+ quaternion operator - () const {
+ return quaternion(-vec, -w);
+ }
+
+ // Quaternion operations.
+ quaternion conjugate() const {
+ return quaternion(-vec, w);
+ }
+ void normalize(const vector3& v)
+ {
+ scalar len = length();
+ if (len != 0.0) { *this /= len; }
+ }
+
+ scalar length2() const {
+ return vec.x * vec.x + vec.y * vec.y + vec.z * vec.z + w * w;
+ }
+ scalar length() const {
+ return std::sqrt(length2());
+ }
+
+ // Converting to other types.
+ matrix3 matrix() const {
+ scalar x2 = vec.x * vec.x;
+ scalar y2 = vec.y * vec.y;
+ scalar z2 = vec.z * vec.z;
+ scalar w2 = w * w;
+ scalar xy = vec.x * vec.y;
+ scalar xz = vec.x * vec.z;
+ scalar yzwx = 2 * (vec.y * vec.z - w * vec.x);
+ scalar wy = w * vec.y;
+ scalar wz = w * vec.z;
+ return matrix3(x2 - y2 - z2 + w2, 2 * (xy - wz), 2 * (xz + wy),
+ 2 * (xy + wz), w2 - x2 + y2 - z2, yzwx,
+ 2 * (xz - wy), yzwx, w2 - x2 - y2 + z2);
+ }
+ vector3 axis(scalar& angle) { // Axis of rotation, w/ angle of rotation.
+ vector3 axisVec = axis();
+ angle = 2 * std::acos(w);
+ return axisVec;
+ }
+ vector3 axis() {
+ scalar sa = std::sqrt(1 - w * w);
+ return vec / sa;
+ }
+
+ // Checking equality.
+ bool operator == (const quaternion& q) const {
+ return vec == q.vec && equals(w,q.w);
+ }
+ bool operator != (const quaternion& q) const {
+ return !(*this == q);
+ }
+
+ // Data.
+ vector3 vec;
+ scalar w;
+};
+
+inline quaternion operator * (scalar s, const quaternion& q) {
+ return q * s;
+}
+inline quaternion operator / (scalar s, const quaternion& q) {
+ return quaternion(s / q.vec, s / q.w);
+}
+
+} // namespace dc
+
+
+#endif // _QUATERNION_HH_
+
--- /dev/null
+
+/*******************************************************************************
+
+ Copyright (c) 2009, Charles McGarvey
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+*******************************************************************************/
+
+#include <cstdlib> // srand, rand, RAND_MAX
+#include <ctime> // time
+#include <cmath> // log
+#include <climits> // ULONG_MAX
+
+#include "random.hh"
+
+
+namespace rng {
+
+unsigned seed(unsigned theSeed)
+{
+ srand(theSeed);
+ return theSeed;
+}
+
+unsigned seed()
+{
+ return seed(time(0));
+}
+
+
+template <typename T>
+T get()
+{
+ const float ln2 = 0.693147;
+ static const unsigned bitsPerPiece = std::log(float(RAND_MAX)) / ln2;
+ static const unsigned sizeOfType = sizeof(T) * 8;
+ static const unsigned pieces = sizeOfType / bitsPerPiece +
+ ((sizeOfType % bitsPerPiece) ? 1 : 0);
+
+ T bits = 0;
+
+&n