Index: code/branches/libraries2/src/external/ogreceguirenderer/AUTHORS
===================================================================
--- code/branches/libraries2/src/external/ogreceguirenderer/AUTHORS	(revision 5708)
+++ code/branches/libraries2/src/external/ogreceguirenderer/AUTHORS	(revision 5708)
@@ -0,0 +1,106 @@
+AUTHORS
+=======
+
+OGRE Team 
+---------
+Steve Streeting	(sinbad)              
+Thomas Muldowney (temas)
+James O'Sullivan (_mental_)
+Wladimir J. van der Laan (miathan6/wumpus)
+
+Feature Contributors
+--------------------
+The following list includes developers who have contributed features to OGRE:
+
+Contributor                             Subject Areas 
+-----------                             --------------------------------------
+Adrian Cearnau (cearny)               : Codecs, dynamic library loading
+Jon Anderson (janders)                : octree plugin
+Martin Persson                        : Nature plugin
+Jesse Rusak (jder) 	  				  : Mac OSX port
+Etienne Mallard (earthquakeproof)	  : 3D Studio Model Exporter
+Banania								  : ditto
+Paolo Gavocanov (cTh) 				  : Initial D3D9 port, Meshviewer, 
+                                        3D Studio Scene Exporter
+Ivica Aracic (macross/bytelord)       : Ogre4J, Maya exporter, .scene format
+Jeff Leigh							  : Sky enhancements, debug overlay
+Jose A Milan (jamilan/spoke)          : Paging landscape plugin
+Tuan Kuranes (kuranes)                : ditto
+Stephan Kaiser (psyclonist)           : OgreFsrad, OgreLMTS, .scene format
+Philippe Culet                        : Attaching objects to bones
+Jon L. Griffeth (silent3)             : GUI enhancements
+Dan Sonnemann (oberleutnantdan)       : Timers
+Amit Mathew                           : Profiler
+Dennis Verbeek                        : Lightwave exporter
+David Whittaker                       : Displacement mapping terrain
+Chris Groskopf (staringmonkey)        : OgreTok
+Jeff Doyle (nfz)                      : ATI_fragment_shader compiler, 
+                                        paging landscape
+Patrick Kooman                        : Overlay editor
+Doug Wolanick (icetec)                : DotSceneOctree exporter & plugin
+John Van Vliet (granite/fifty1)       : Maya exporter
+Marcin Zukowski (eru)                 : Demo_CubeMapping and Demo_Water
+Jens Hoffmann                         : Blender exporter
+Michael Reimpell                      : Blender exporter
+Sam le Pirate                         : BMP support
+Attila Tajti (attis)                  : Wings3D exporter
+? (Firestorm)                         : Particle scale and rotate affectors
+Lee Sandberg                          : Hardware occlusion query support
+Phillip Castaneda (pjcast)            : External texture sources / dynamic
+										textures
+Henry Goffin (qsilver)				  : Ultra-fast scaling code in 
+										OgreImageResampler.h
+Federico Di Gregorio (fog)			  : Debian packaging
+
+Others
+------
+The following people have been notable in their support of OGRE through the
+fixing of bugs, testing patches, and various other miscellaneous contributions:
+
+Timo Keller (norondion) 
+Kai-Peter Backman
+Daniel Wessl?n
+Benny Kramek (wolfman8k) 
+Riku Nurminen (rakkis)
+Christopher John Gilbert (thegilb)
+Martin Pollard (xmp)
+Nikita Mikros (santanopoulos)
+Chris Heald (antiarc)
+Michael Casaday
+Evgeni Popov
+Chris McGuirk (leedgitar)
+Te'ja (thiveertm)
+Keith Jackson
+G Nikolakis
+Genva
+Christian Lindequist Larsen (DWORD)
+Chris Heald (Antiarc)
+Green Eyed Monster (monster)
+
+
+
+
+If we've forgotten you in the above list, please contact us!
+
+See Readme.html in the Docs folder for more details, in particular information on the media supplied with the demos.
+
+-----
+
+Copyright 1999-2004 The OGRE Team.
+
+This file is part of OGRE (Object-Oriented Graphics Rendering Engine).
+
+OGRE 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, or (at your option)
+any later version.
+
+OGRE is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with OGRE; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
Index: code/branches/libraries2/src/external/ogreceguirenderer/CMakeLists.txt
===================================================================
--- code/branches/libraries2/src/external/ogreceguirenderer/CMakeLists.txt	(revision 5708)
+++ code/branches/libraries2/src/external/ogreceguirenderer/CMakeLists.txt	(revision 5708)
@@ -0,0 +1,45 @@
+ #
+ #             ORXONOX - the hottest 3D action shooter ever to exist
+ #                             > www.orxonox.net <
+ #
+ #        This program is free software; you can redistribute it and/or
+ #         modify it under the terms of the GNU General Public License
+ #        as published by the Free Software Foundation; either version 2
+ #            of the License, or (at your option) any later version.
+ #
+ #       This program is distributed in the hope that it will be useful,
+ #        but WITHOUT ANY WARRANTY; without even the implied warranty of
+ #        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ #                 GNU General Public License for more details.
+ #
+ #   You should have received a copy of the GNU General Public License along
+ #      with this program; if not, write to the Free Software Foundation,
+ #     Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ #
+
+SET(OCR_FILES
+  OgreCEGUIRenderer.h
+  OgreCEGUIResourceProvider.h
+  OgreCEGUITexture.h
+
+  OgreCEGUIRenderer.cpp
+  OgreCEGUIResourceProvider.cpp
+  OgreCEGUITexture.cpp
+)
+
+# No warnings needed from third party libraries
+REMOVE_COMPILER_FLAGS("-W3 -W4" MSVC)
+ADD_COMPILER_FLAGS("-w")
+
+ORXONOX_ADD_LIBRARY(ogreceguirenderer_orxonox
+  ORXONOX_EXTERNAL
+  LINK_LIBRARIES
+    ${OGRE_LIBRARY}
+    ${CEGUI_LIBRARY}
+  DEFINE_SYMBOL
+    "OGRE_GUIRENDERER_EXPORTS"
+  VERSION
+    1.4.9
+  SOURCE_FILES
+    ${OCR_FILES}
+)
Index: code/branches/libraries2/src/external/ogreceguirenderer/COPYING
===================================================================
--- code/branches/libraries2/src/external/ogreceguirenderer/COPYING	(revision 5708)
+++ code/branches/libraries2/src/external/ogreceguirenderer/COPYING	(revision 5708)
@@ -0,0 +1,514 @@
+		  GNU LESSER GENERAL PUBLIC LICENSE
+		       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+
+           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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  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!
+
+
+
Index: code/branches/libraries2/src/external/ogreceguirenderer/OgreCEGUIRenderer.cpp
===================================================================
--- code/branches/libraries2/src/external/ogreceguirenderer/OgreCEGUIRenderer.cpp	(revision 5708)
+++ code/branches/libraries2/src/external/ogreceguirenderer/OgreCEGUIRenderer.cpp	(revision 5708)
@@ -0,0 +1,793 @@
+/************************************************************************
+	filename: 	OgreCEGUIRenderer.cpp
+	created:	11/5/2004
+	author:		Paul D Turner
+	
+	purpose:	Implementation of Renderer class for Ogre engine
+*************************************************************************/
+/*************************************************************************
+    Crazy Eddie's GUI System (http://www.cegui.org.uk)
+    Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*************************************************************************/
+
+#include <CEGUIImagesetManager.h>
+#include <CEGUIImageset.h>
+#include <CEGUIImage.h>
+#include <CEGUIExceptions.h>
+#include <CEGUISystem.h>
+
+#include "OgreCEGUIRenderer.h"
+#include "OgreCEGUITexture.h"
+#include "OgreCEGUIResourceProvider.h"
+
+#include <OgreRenderSystem.h>
+#include <OgreRoot.h>
+#include <OgreHardwareBufferManager.h>
+#include <OgreRenderWindow.h>
+
+// Start of CEGUI namespace section
+namespace CEGUI
+{
+/*************************************************************************
+	Constants definitions
+*************************************************************************/
+const size_t	OgreCEGUIRenderer::VERTEX_PER_QUAD			= 6;
+const size_t	OgreCEGUIRenderer::VERTEX_PER_TRIANGLE		= 3;
+const size_t	OgreCEGUIRenderer::VERTEXBUFFER_INITIAL_CAPACITY	= 256;
+const size_t    OgreCEGUIRenderer::UNDERUSED_FRAME_THRESHOLD = 50000; // halfs buffer every 8 minutes on 100fps
+
+/*************************************************************************
+	Utility function to create a render operation and vertex buffer to render quads
+*************************************************************************/
+static void createQuadRenderOp(Ogre::RenderOperation &d_render_op, 
+    Ogre::HardwareVertexBufferSharedPtr &d_buffer, size_t nquads)
+{
+    using namespace Ogre;
+    // Create and initialise the Ogre specific parts required for use in rendering later.
+	d_render_op.vertexData = new VertexData;
+	d_render_op.vertexData->vertexStart = 0;
+
+	// setup vertex declaration for the vertex format we use
+	VertexDeclaration* vd = d_render_op.vertexData->vertexDeclaration;
+	size_t vd_offset = 0;
+	vd->addElement(0, vd_offset, VET_FLOAT3, VES_POSITION);
+	vd_offset += VertexElement::getTypeSize(VET_FLOAT3);
+	vd->addElement(0, vd_offset, VET_COLOUR, VES_DIFFUSE);
+	vd_offset += VertexElement::getTypeSize(VET_COLOUR);
+	vd->addElement(0, vd_offset, VET_FLOAT2, VES_TEXTURE_COORDINATES);
+
+	// create hardware vertex buffer
+	d_buffer = HardwareBufferManager::getSingleton().createVertexBuffer(vd->getVertexSize(0), nquads,  
+        HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE, false);
+
+	// bind vertex buffer
+	d_render_op.vertexData->vertexBufferBinding->setBinding(0, d_buffer);
+
+	// complete render operation basic initialisation
+	d_render_op.operationType = RenderOperation::OT_TRIANGLE_LIST;
+	d_render_op.useIndexes = false;
+}
+
+static void destroyQuadRenderOp(Ogre::RenderOperation &d_render_op, 
+    Ogre::HardwareVertexBufferSharedPtr &d_buffer)
+{
+    delete d_render_op.vertexData;
+    d_render_op.vertexData = 0;
+    d_buffer.setNull();
+}
+
+/*************************************************************************
+	Constructor
+*************************************************************************/
+OgreCEGUIRenderer::OgreCEGUIRenderer(Ogre::RenderWindow* window, Ogre::uint8 queue_id, bool post_queue, uint max_quads)
+{
+	constructor_impl(window, queue_id, post_queue, max_quads);
+}
+
+
+/*************************************************************************
+	Constructor (specifying scene manager)
+*************************************************************************/
+OgreCEGUIRenderer::OgreCEGUIRenderer(Ogre::RenderWindow* window, Ogre::uint8 queue_id, bool post_queue, uint max_quads, Ogre::SceneManager* scene_manager)
+{
+	constructor_impl(window, queue_id, post_queue, max_quads);
+
+	// hook into ogre rendering system
+	setTargetSceneManager(scene_manager);
+}
+
+
+/*************************************************************************
+	Destructor
+*************************************************************************/
+OgreCEGUIRenderer::~OgreCEGUIRenderer(void)
+{
+	setTargetSceneManager(NULL);
+
+	if (d_ourlistener)
+	{
+		delete d_ourlistener;
+	}
+
+	// cleanup vertex data we allocated in constructor
+	destroyQuadRenderOp(d_render_op, d_buffer);
+    destroyQuadRenderOp(d_direct_render_op, d_direct_buffer);
+
+	destroyAllTextures();
+}
+
+
+/*************************************************************************
+	add's a quad to the list to be rendered
+*************************************************************************/
+void OgreCEGUIRenderer::addQuad(const Rect& dest_rect, float z, const Texture* tex, const Rect& texture_rect, const ColourRect& colours, QuadSplitMode quad_split_mode)
+{
+	// if not queueing, render directly (as in, right now!). This is used for the mouse cursor.
+	if (!d_queueing)
+	{
+		renderQuadDirect(dest_rect, z, tex, texture_rect, colours, quad_split_mode);
+	}
+	else
+	{
+		d_sorted = false;
+		QuadInfo quad;
+		
+		// set quad position, flipping y co-ordinates, and applying appropriate texel origin offset
+		quad.position.d_left	= dest_rect.d_left;
+		quad.position.d_right	= dest_rect.d_right;
+		quad.position.d_top		= d_display_area.getHeight() - dest_rect.d_top;
+		quad.position.d_bottom	= d_display_area.getHeight() - dest_rect.d_bottom;
+		quad.position.offset(d_texelOffset);
+
+		// convert quad co-ordinates for a -1 to 1 co-ordinate system.
+		quad.position.d_left	/= (d_display_area.getWidth() * 0.5f);
+		quad.position.d_right	/= (d_display_area.getWidth() * 0.5f);
+		quad.position.d_top		/= (d_display_area.getHeight() * 0.5f);
+		quad.position.d_bottom	/= (d_display_area.getHeight() * 0.5f);
+		quad.position.offset(Point(-1.0f, -1.0f));
+
+		quad.z				= -1 + z;
+		quad.texture		= ((OgreCEGUITexture*)tex)->getOgreTexture();
+		quad.texPosition	= texture_rect;
+
+		// covert colours for ogre, note that top / bottom are switched.
+		quad.topLeftCol		= colourToOgre(colours.d_bottom_left);
+		quad.topRightCol	= colourToOgre(colours.d_bottom_right);
+		quad.bottomLeftCol	= colourToOgre(colours.d_top_left);
+		quad.bottomRightCol	= colourToOgre(colours.d_top_right);
+		
+		// set quad split mode
+		quad.splitMode = quad_split_mode;
+
+		d_quadlist.insert(quad);
+	}
+}
+
+
+
+/*************************************************************************
+perform final rendering for all queued renderable quads.
+*************************************************************************/
+void OgreCEGUIRenderer::doRender(void)
+{
+    // Render if overlays enabled and the quad list is not empty
+	if (d_render_sys->_getViewport()->getOverlaysEnabled() && !d_quadlist.empty())
+	{
+        /// Quad list needs to be sorted and thus the vertex buffer rebuilt. If not, we can
+        /// reuse the vertex buffer resulting in a nice speed gain.
+        if(!d_sorted)
+        {
+            sortQuads();
+            /// Resize vertex buffer if it is too small
+            size_t size = d_buffer->getNumVertices();
+            size_t requestedSize = d_quadlist.size()*VERTEX_PER_QUAD;
+            if(size < requestedSize)
+            {
+                /// Double buffer size until smaller than requested size
+                while(size < requestedSize)
+                    size = size * 2;
+                /// Reallocate the buffer
+                destroyQuadRenderOp(d_render_op, d_buffer);
+                createQuadRenderOp(d_render_op, d_buffer, size);
+            }
+            else if(requestedSize < size/2 && d_underused_framecount >= UNDERUSED_FRAME_THRESHOLD)
+            {
+                /// Resize vertex buffer if it has been to big for too long
+                size = size / 2;
+                destroyQuadRenderOp(d_render_op, d_buffer);
+                createQuadRenderOp(d_render_op, d_buffer, size);
+                /// Reset underused framecount so it takes another UNDERUSED_FRAME_THRESHOLD to half again
+                d_underused_framecount = 0;
+            }
+            /// Fill the buffer
+            QuadVertex*	buffmem;
+            buffmem = (QuadVertex*)d_buffer->lock(Ogre::HardwareVertexBuffer::HBL_DISCARD);
+            // iterate over each quad in the list
+            for (QuadList::iterator i = d_quadlist.begin(); i != d_quadlist.end(); ++i)
+            {
+                const QuadInfo& quad = (*i);
+                // setup Vertex 1...
+                buffmem->x = quad.position.d_left;
+                buffmem->y = quad.position.d_bottom;
+                buffmem->z = quad.z;
+                buffmem->diffuse = quad.topLeftCol;
+                buffmem->tu1 = quad.texPosition.d_left;
+                buffmem->tv1 = quad.texPosition.d_bottom;
+                ++buffmem;
+    
+                // setup Vertex 2...
+                
+                // top-left to bottom-right diagonal
+                if (quad.splitMode == TopLeftToBottomRight)
+                {
+                    buffmem->x = quad.position.d_right;
+                    buffmem->y = quad.position.d_bottom;
+                    buffmem->z = quad.z;
+                    buffmem->diffuse = quad.topRightCol;
+                    buffmem->tu1 = quad.texPosition.d_right;
+                    buffmem->tv1 = quad.texPosition.d_bottom;
+                }
+                // bottom-left to top-right diagonal
+                else
+                {
+                    buffmem->x = quad.position.d_right;
+                    buffmem->y = quad.position.d_top;
+                    buffmem->z = quad.z;
+                    buffmem->diffuse = quad.bottomRightCol;
+                    buffmem->tu1 = quad.texPosition.d_right;
+                    buffmem->tv1 = quad.texPosition.d_top;
+                }
+                ++buffmem;
+    
+                // setup Vertex 3...
+                buffmem->x = quad.position.d_left;
+                buffmem->y = quad.position.d_top;
+                buffmem->z = quad.z;
+                buffmem->diffuse = quad.bottomLeftCol;
+                buffmem->tu1 = quad.texPosition.d_left;
+                buffmem->tv1 = quad.texPosition.d_top;
+                ++buffmem;
+    
+                // setup Vertex 4...
+                buffmem->x = quad.position.d_right;
+                buffmem->y = quad.position.d_bottom;
+                buffmem->z = quad.z;
+                buffmem->diffuse = quad.topRightCol;
+                buffmem->tu1 = quad.texPosition.d_right;
+                buffmem->tv1 = quad.texPosition.d_bottom;
+                ++buffmem;
+    
+                // setup Vertex 5...
+                buffmem->x = quad.position.d_right;
+                buffmem->y = quad.position.d_top;
+                buffmem->z = quad.z;
+                buffmem->diffuse = quad.bottomRightCol;
+                buffmem->tu1 = quad.texPosition.d_right;
+                buffmem->tv1 = quad.texPosition.d_top;
+                ++buffmem;
+    
+                // setup Vertex 6...
+                
+                // top-left to bottom-right diagonal
+                if (quad.splitMode == TopLeftToBottomRight)
+                {
+                    buffmem->x = quad.position.d_left;
+                    buffmem->y = quad.position.d_top;
+                    buffmem->z = quad.z;
+                    buffmem->diffuse = quad.bottomLeftCol;
+                    buffmem->tu1 = quad.texPosition.d_left;
+                    buffmem->tv1 = quad.texPosition.d_top;
+                }
+                // bottom-left to top-right diagonal
+                else
+                {
+                    buffmem->x = quad.position.d_left;
+                    buffmem->y = quad.position.d_bottom;
+                    buffmem->z = quad.z;
+                    buffmem->diffuse = quad.topLeftCol;
+                    buffmem->tu1 = quad.texPosition.d_left;
+                    buffmem->tv1 = quad.texPosition.d_bottom;
+                }
+                ++buffmem;
+            }
+    
+            // ensure we leave the buffer in the unlocked state
+            d_buffer->unlock();
+        }
+        
+        /// Render the buffer
+        d_bufferPos = 0;
+		bool first = true;
+
+        // Iterate over each quad in the list and render it
+        QuadList::iterator i = d_quadlist.begin();
+        while(i != d_quadlist.end())
+        {
+            
+            d_currTexture = i->texture;
+            d_render_op.vertexData->vertexStart = d_bufferPos;
+            for (; i != d_quadlist.end(); ++i)
+            {
+                const QuadInfo& quad = (*i);
+                if (d_currTexture != quad.texture)
+				{
+                    /// If it has a different texture, render this quad in next operation
+					/// also need to reset render states
+					first = true;
+		            break;
+				}
+                d_bufferPos += VERTEX_PER_QUAD;
+            }
+            d_render_op.vertexData->vertexCount = d_bufferPos - d_render_op.vertexData->vertexStart;
+            /// Set texture, and do the render
+            d_render_sys->_setTexture(0, true, d_currTexture);
+			if (first)
+			{
+				initRenderStates();
+				first = false;
+			}
+            d_render_sys->_render(d_render_op);
+        }
+
+	}
+    /// Count frames to check if utilization of vertex buffer was below half the capacity for 500,000 frames
+    if(d_bufferPos < d_buffer->getNumVertices()/2)
+       d_underused_framecount++;
+    else
+       d_underused_framecount = 0;
+}
+
+
+/*************************************************************************
+	clear the queue
+*************************************************************************/
+void OgreCEGUIRenderer::clearRenderList(void)
+{
+	d_sorted = true;
+	d_quadlist.clear();
+}
+
+
+/*************************************************************************
+	create an empty texture
+*************************************************************************/
+Texture* OgreCEGUIRenderer::createTexture(void)
+{
+	OgreCEGUITexture* tex = new OgreCEGUITexture(this);
+	d_texturelist.push_back(tex);
+	return tex;
+}
+
+
+/*************************************************************************
+	create a texture and load it with the specified file.
+*************************************************************************/
+Texture* OgreCEGUIRenderer::createTexture(const String& filename, const String& resourceGroup)
+{
+	OgreCEGUITexture* tex = (OgreCEGUITexture*)createTexture();
+	tex->loadFromFile(filename, resourceGroup);
+
+	return tex;
+}
+
+
+/*************************************************************************
+	create a texture and set it to the specified size
+*************************************************************************/
+Texture* OgreCEGUIRenderer::createTexture(float size)
+{
+	OgreCEGUITexture* tex = (OgreCEGUITexture*)createTexture();
+	tex->setOgreTextureSize((uint)size);
+
+	return tex;
+}
+
+
+/*************************************************************************
+	destroy the given texture
+*************************************************************************/
+void OgreCEGUIRenderer::destroyTexture(Texture* texture)
+{
+	if (texture != NULL)
+	{
+		OgreCEGUITexture* tex = (OgreCEGUITexture*)texture;
+
+		d_texturelist.remove(tex);
+		delete tex;
+	}
+}
+
+
+/*************************************************************************
+	destroy all textures still active
+*************************************************************************/
+void OgreCEGUIRenderer::destroyAllTextures(void)
+{
+	while (!d_texturelist.empty())
+	{
+		destroyTexture(*(d_texturelist.begin()));
+	}
+}
+
+
+/*************************************************************************
+	setup states etc	
+*************************************************************************/
+void OgreCEGUIRenderer::initRenderStates(void)
+{
+	using namespace Ogre;
+
+	// set-up matrices
+	d_render_sys->_setWorldMatrix(Matrix4::IDENTITY);
+	d_render_sys->_setViewMatrix(Matrix4::IDENTITY);
+	d_render_sys->_setProjectionMatrix(Matrix4::IDENTITY);
+
+	// initialise render settings
+	d_render_sys->setLightingEnabled(false);
+	d_render_sys->_setDepthBufferParams(false, false);
+	d_render_sys->_setDepthBias(0, 0);
+	d_render_sys->_setCullingMode(CULL_NONE);
+	d_render_sys->_setFog(FOG_NONE);
+	d_render_sys->_setColourBufferWriteEnabled(true, true, true, true);
+	d_render_sys->unbindGpuProgram(GPT_FRAGMENT_PROGRAM);
+	d_render_sys->unbindGpuProgram(GPT_VERTEX_PROGRAM);
+	d_render_sys->setShadingType(SO_GOURAUD);
+	d_render_sys->_setPolygonMode(PM_SOLID);
+
+	// initialise texture settings
+	d_render_sys->_setTextureCoordCalculation(0, TEXCALC_NONE);
+	d_render_sys->_setTextureCoordSet(0, 0);
+	d_render_sys->_setTextureUnitFiltering(0, FO_LINEAR, FO_LINEAR, FO_POINT);
+	d_render_sys->_setTextureAddressingMode(0, d_uvwAddressMode);
+	d_render_sys->_setTextureMatrix(0, Matrix4::IDENTITY);
+#if OGRE_VERSION >= 0x010600
+	d_render_sys->_setAlphaRejectSettings(CMPF_ALWAYS_PASS, 0, false);
+#else
+	d_render_sys->_setAlphaRejectSettings(CMPF_ALWAYS_PASS, 0);
+#endif
+	d_render_sys->_setTextureBlendMode(0, d_colourBlendMode);
+	d_render_sys->_setTextureBlendMode(0, d_alphaBlendMode);
+	d_render_sys->_disableTextureUnitsFrom(1);
+
+	// enable alpha blending
+	d_render_sys->_setSceneBlending(SBF_SOURCE_ALPHA, SBF_ONE_MINUS_SOURCE_ALPHA);
+}
+
+
+ 
+/*************************************************************************
+	sort quads list according to texture	
+*************************************************************************/
+void OgreCEGUIRenderer::sortQuads(void)
+{
+	if (!d_sorted)
+	{
+		d_sorted = true;
+	}
+
+}
+
+/*************************************************************************
+render a quad directly to the display
+*************************************************************************/
+void OgreCEGUIRenderer::renderQuadDirect(const Rect& dest_rect, float z, const Texture* tex, const Rect& texture_rect, const ColourRect& colours, QuadSplitMode quad_split_mode)
+{
+	if (d_render_sys->_getViewport()->getOverlaysEnabled())
+	{
+		z = -1 + z;
+
+		Rect final_rect;
+
+		// set quad position, flipping y co-ordinates, and applying appropriate texel origin offset
+		final_rect.d_left	= dest_rect.d_left;
+		final_rect.d_right	= dest_rect.d_right;
+		final_rect.d_top	= d_display_area.getHeight() - dest_rect.d_top;
+		final_rect.d_bottom	= d_display_area.getHeight() - dest_rect.d_bottom;
+		final_rect.offset(d_texelOffset);
+
+		// convert quad co-ordinates for a -1 to 1 co-ordinate system.
+		final_rect.d_left	/= (d_display_area.getWidth() * 0.5f);
+		final_rect.d_right	/= (d_display_area.getWidth() * 0.5f);
+		final_rect.d_top	/= (d_display_area.getHeight() * 0.5f);
+		final_rect.d_bottom	/= (d_display_area.getHeight() * 0.5f);
+		final_rect.offset(Point(-1.0f, -1.0f));
+
+		// convert colours for ogre, note that top / bottom are switched.
+        uint32 topLeftCol	= colourToOgre(colours.d_bottom_left);
+        uint32 topRightCol	= colourToOgre(colours.d_bottom_right);
+        uint32 bottomLeftCol	= colourToOgre(colours.d_top_left);
+        uint32 bottomRightCol= colourToOgre(colours.d_top_right);
+
+		QuadVertex*	buffmem = (QuadVertex*)d_direct_buffer->lock(Ogre::HardwareVertexBuffer::HBL_DISCARD);
+
+		// setup Vertex 1...
+		buffmem->x	= final_rect.d_left;
+		buffmem->y	= final_rect. d_bottom;
+		buffmem->z	= z;
+		buffmem->diffuse = topLeftCol;
+		buffmem->tu1	= texture_rect.d_left;
+		buffmem->tv1	= texture_rect.d_bottom;
+		++buffmem;
+
+		// setup Vertex 2...
+		
+		// top-left to bottom-right diagonal
+		if (quad_split_mode == TopLeftToBottomRight)
+		{
+			buffmem->x	= final_rect.d_right;
+			buffmem->y = final_rect.d_bottom;
+			buffmem->z	= z;
+			buffmem->diffuse = topRightCol;
+			buffmem->tu1	= texture_rect.d_right;
+			buffmem->tv1	= texture_rect.d_bottom;
+			++buffmem;
+		}
+		// bottom-left to top-right diagonal
+		else
+		{
+			buffmem->x	= final_rect.d_right;
+			buffmem->y = final_rect.d_top;
+			buffmem->z	= z;
+			buffmem->diffuse = bottomRightCol;
+			buffmem->tu1	= texture_rect.d_right;
+			buffmem->tv1	= texture_rect.d_top;
+			++buffmem;
+		}
+
+		// setup Vertex 3...
+		buffmem->x	= final_rect.d_left;
+		buffmem->y	= final_rect.d_top;
+		buffmem->z	= z;
+		buffmem->diffuse = bottomLeftCol;
+		buffmem->tu1	= texture_rect.d_left;
+		buffmem->tv1	= texture_rect.d_top;
+		++buffmem;
+
+		// setup Vertex 4...
+		buffmem->x	= final_rect.d_right;
+		buffmem->y	= final_rect.d_bottom;
+		buffmem->z	= z;
+		buffmem->diffuse = topRightCol;
+		buffmem->tu1	= texture_rect.d_right;
+		buffmem->tv1	= texture_rect.d_bottom;
+		++buffmem;
+
+		// setup Vertex 5...
+		buffmem->x	= final_rect.d_right;
+		buffmem->y	= final_rect.d_top;
+		buffmem->z	= z;
+		buffmem->diffuse = bottomRightCol;
+		buffmem->tu1	= texture_rect.d_right;
+		buffmem->tv1	= texture_rect.d_top;
+		++buffmem;
+
+		// setup Vertex 6...
+		
+		// top-left to bottom-right diagonal
+		if (quad_split_mode == TopLeftToBottomRight)
+		{
+			buffmem->x	= final_rect.d_left;
+			buffmem->y = final_rect.d_top;
+			buffmem->z	= z;
+			buffmem->diffuse = bottomLeftCol;
+			buffmem->tu1	= texture_rect.d_left;
+			buffmem->tv1	= texture_rect.d_top;
+		}
+		// bottom-left to top-right diagonal
+		else
+		{
+			buffmem->x	= final_rect.d_left;
+			buffmem->y = final_rect.d_bottom;
+			buffmem->z	= z;
+			buffmem->diffuse = topLeftCol;
+			buffmem->tu1	= texture_rect.d_left;
+			buffmem->tv1	= texture_rect.d_bottom;
+		}
+
+		d_direct_buffer->unlock();
+
+        //
+		// perform rendering...
+		//
+		d_render_sys->_setTexture(0, true, ((OgreCEGUITexture*)tex)->getOgreTexture()->getName());
+		initRenderStates();
+		d_direct_render_op.vertexData->vertexCount = VERTEX_PER_QUAD;
+		d_render_sys->_render(d_direct_render_op);
+	}
+
+}
+
+/*************************************************************************
+	convert ARGB colour value to whatever the Ogre render system is
+	expecting.	
+*************************************************************************/
+uint32 OgreCEGUIRenderer::colourToOgre(const colour& col) const
+{
+	Ogre::ColourValue cv(col.getRed(), col.getGreen(), col.getBlue(), col.getAlpha());
+
+    uint32 final;
+	d_render_sys->convertColourValue(cv, &final);
+
+	return final;
+}
+
+
+/*************************************************************************
+	Set the scene manager to be used for rendering the GUI.	
+*************************************************************************/
+void OgreCEGUIRenderer::setTargetSceneManager(Ogre::SceneManager* scene_manager)
+{
+	// unhook from current scene manager.
+	if (d_sceneMngr != NULL)
+	{
+		d_sceneMngr->removeRenderQueueListener(d_ourlistener);
+		d_sceneMngr = NULL;
+	}
+
+	// hook new scene manager if that is not NULL
+	if (scene_manager != NULL)
+	{
+		d_sceneMngr = scene_manager;
+		d_sceneMngr->addRenderQueueListener(d_ourlistener);
+	}
+
+}
+
+
+/*************************************************************************
+	Set the target render queue for GUI rendering.	
+*************************************************************************/
+void OgreCEGUIRenderer::setTargetRenderQueue(Ogre::uint8 queue_id, bool post_queue)
+{
+	d_queue_id		= queue_id;
+	d_post_queue	= post_queue;
+
+	if (d_ourlistener != NULL)
+	{
+		d_ourlistener->setTargetRenderQueue(queue_id);
+		d_ourlistener->setPostRenderQueue(post_queue);
+	}
+
+}
+
+
+/*************************************************************************
+	perform main work of the constructor
+*************************************************************************/
+void OgreCEGUIRenderer::constructor_impl(Ogre::RenderWindow* window, Ogre::uint8 queue_id, bool post_queue, uint max_quads)
+{
+	using namespace Ogre;
+
+	// initialise the renderer fields
+	d_queueing		= true;
+	d_queue_id		= queue_id;
+	d_currTexture.isNull();
+	d_post_queue	= post_queue;
+	d_sceneMngr		= NULL;
+	d_bufferPos		= 0;
+	d_sorted		= true;
+	d_ogre_root		= Root::getSingletonPtr();
+	d_render_sys	= d_ogre_root->getRenderSystem();
+    // set ID string
+    d_identifierString = "CEGUI::OgreRenderer - Official Ogre based renderer module for CEGUI";
+
+	// Create and initialise the Ogre specific parts required for use in rendering later.
+    // Main GUI
+    createQuadRenderOp(d_render_op, d_buffer, VERTEXBUFFER_INITIAL_CAPACITY);
+    d_underused_framecount = 0;
+
+    // Mouse cursor
+    createQuadRenderOp(d_direct_render_op, d_direct_buffer, VERTEX_PER_QUAD);
+
+	// Discover display settings and setup d_display_area
+	d_display_area.d_left	= 0;
+	d_display_area.d_top	= 0;
+	d_display_area.d_right	= window->getWidth();
+	d_display_area.d_bottom	= window->getHeight();
+
+	// initialise required texel offset
+	d_texelOffset = Point((float)d_render_sys->getHorizontalTexelOffset(), -(float)d_render_sys->getVerticalTexelOffset());
+
+	// create listener which will handler the rendering side of things for us.
+	d_ourlistener = new CEGUIRQListener(this, queue_id, post_queue);
+
+	// Initialise blending modes to be used.
+	d_colourBlendMode.blendType	= Ogre::LBT_COLOUR;
+	d_colourBlendMode.source1	= Ogre::LBS_TEXTURE;
+	d_colourBlendMode.source2	= Ogre::LBS_DIFFUSE;
+	d_colourBlendMode.operation	= Ogre::LBX_MODULATE;
+
+	d_alphaBlendMode.blendType	= Ogre::LBT_ALPHA;
+	d_alphaBlendMode.source1	= Ogre::LBS_TEXTURE;
+	d_alphaBlendMode.source2	= Ogre::LBS_DIFFUSE;
+	d_alphaBlendMode.operation	= Ogre::LBX_MODULATE;
+
+	d_uvwAddressMode.u = Ogre::TextureUnitState::TAM_CLAMP;
+	d_uvwAddressMode.v = Ogre::TextureUnitState::TAM_CLAMP;
+	d_uvwAddressMode.w = Ogre::TextureUnitState::TAM_CLAMP;
+}
+
+
+/*************************************************************************
+	Create a texture from an existing Ogre::TexturePtr object	
+*************************************************************************/
+Texture* OgreCEGUIRenderer::createTexture(Ogre::TexturePtr& texture)
+{
+	OgreCEGUITexture* t = (OgreCEGUITexture*)createTexture();
+
+	if (!texture.isNull())
+	{
+		t->setOgreTexture(texture);
+	}
+
+	return t;
+
+}
+
+/*************************************************************************
+	Create a resource provider object
+*************************************************************************/
+ResourceProvider* OgreCEGUIRenderer::createResourceProvider(void)
+{
+    d_resourceProvider = new OgreCEGUIResourceProvider();
+    return d_resourceProvider;
+}
+
+/*************************************************************************
+Set the size of the display in pixels.	
+*************************************************************************/
+void OgreCEGUIRenderer::setDisplaySize(const Size& sz)
+{
+	if (d_display_area.getSize() != sz)
+	{
+		d_display_area.setSize(sz);
+
+		EventArgs args;
+		fireEvent(EventDisplaySizeChanged, args, EventNamespace);
+	}
+
+}
+
+/*************************************************************************
+	Callback from Ogre invoked before other stuff in our target queue
+	is rendered
+*************************************************************************/
+void CEGUIRQListener::renderQueueStarted(Ogre::uint8 id, const Ogre::String& invocation, 
+										 bool& skipThisQueue)
+{
+	if ((!d_post_queue) && (d_queue_id == id))
+	{
+		CEGUI::System::getSingleton().renderGUI();
+	}
+
+}
+
+
+/*************************************************************************
+Callback from Ogre invoked after other stuff in our target queue
+is rendered
+*************************************************************************/
+void CEGUIRQListener::renderQueueEnded(Ogre::uint8 id, const Ogre::String& invocation, bool& repeatThisQueue)
+{
+	if ((d_post_queue) && (d_queue_id == id))
+	{
+		CEGUI::System::getSingleton().renderGUI();
+	}
+
+}
+
+} // End of  CEGUI namespace section
Index: code/branches/libraries2/src/external/ogreceguirenderer/OgreCEGUIRenderer.h
===================================================================
--- code/branches/libraries2/src/external/ogreceguirenderer/OgreCEGUIRenderer.h	(revision 5708)
+++ code/branches/libraries2/src/external/ogreceguirenderer/OgreCEGUIRenderer.h	(revision 5708)
@@ -0,0 +1,464 @@
+/************************************************************************
+	filename: 	OgreCEGUIRenderer.h
+	created:	11/5/2004
+	author:		Paul D Turner
+
+	purpose:	Interface for main Ogre GUI renderer class
+*************************************************************************/
+/*************************************************************************
+    Crazy Eddie's GUI System (http://www.cegui.org.uk)
+    Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
+
+    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
+*************************************************************************/
+/*************************************************************************
+	This file contains code that is specific to Ogre (http://www.ogre3d.org)
+*************************************************************************/
+#ifndef _OgreCEGUIRenderer_h_
+#define _OgreCEGUIRenderer_h_
+
+#include <CEGUIBase.h>
+#include <CEGUIRenderer.h>
+#include <CEGUITexture.h>
+
+#include <OgreRenderQueueListener.h>
+#include <OgreSceneManagerEnumerator.h>
+#include <OgreTextureUnitState.h>
+
+#if (OGRE_PLATFORM == OGRE_PLATFORM_WIN32) && !defined(OGRE_STATIC_LIB)
+#   ifdef OGRE_GUIRENDERER_EXPORTS
+#       define OGRE_GUIRENDERER_API __declspec(dllexport)
+#   else
+#       if defined(__MINGW32__)
+#           define OGRE_GUIRENDERER_API
+#       else
+#           define OGRE_GUIRENDERER_API __declspec(dllimport)
+#       endif
+#   endif
+#elif defined ( OGRE_GCC_VISIBILITY )
+#    define OGRE_GUIRENDERER_API  __attribute__ ((visibility("default")))
+#else
+#    define OGRE_GUIRENDERER_API
+#endif
+
+
+// Start of CEGUI namespace section
+namespace CEGUI
+{
+/*************************************************************************
+	Forward refs
+*************************************************************************/
+class OgreCEGUITexture;
+class OgreCEGUIRenderer;
+
+
+/*!
+\brief
+	RenderQueueListener based class used to hook into the ogre rendering system
+*/
+class _OgrePrivate CEGUIRQListener : public Ogre::RenderQueueListener
+{
+public:
+	CEGUIRQListener(OgreCEGUIRenderer* renderer, Ogre::uint8 queue_id, bool post_queue)
+	{
+		d_renderer		= renderer;
+		d_queue_id		= queue_id;
+		d_post_queue	= post_queue;
+	}
+
+	virtual ~CEGUIRQListener() {}
+
+	virtual void	renderQueueStarted(Ogre::uint8 id, const Ogre::String& invocation, bool& skipThisQueue);
+	virtual void	renderQueueEnded(Ogre::uint8 id, const Ogre::String& invocation, bool& repeatThisQueue);
+
+	// methods for adjusting target queue settings
+	void	setTargetRenderQueue(Ogre::uint8 queue_id)		{d_queue_id = queue_id;}
+	void	setPostRenderQueue(bool post_queue)		{d_post_queue = post_queue;}
+
+private:
+	/*************************************************************************
+		Implementation Data
+	*************************************************************************/
+	OgreCEGUIRenderer*				d_renderer;		//!< CEGUI renderer object for Ogre.
+	Ogre::uint8	d_queue_id;		//!< ID of the queue that we are hooked into
+	bool						d_post_queue;	//!< true if we render after everything else in our queue.
+};
+
+
+/*!
+\brief
+	Renderer class to interface with Ogre engine.
+*/
+class OGRE_GUIRENDERER_API OgreCEGUIRenderer : public Renderer
+{
+public:
+	/*!
+	\brief
+		Constructor for renderer class that uses Ogre for rendering. Note that if
+		you use this option you must call setTargetSceneManager before rendering.
+
+	\param window
+		Pointer to an Ogre::RenderWindow object.
+
+	\param queue_id
+		Ogre::uint8 value that specifies where the GUI should appear in the ogre rendering output.
+
+	\param post_queue
+		set to true to have GUI rendered after render queue \a queue_id, or false to have the GUI rendered before render queue
+		\a queue_id.
+
+	\param max_quads
+		Obsolete.  Set to 0.
+
+	*/
+	OgreCEGUIRenderer(Ogre::RenderWindow* window,
+		Ogre::uint8 queue_id = Ogre::RENDER_QUEUE_OVERLAY,
+		bool post_queue = false, uint max_quads = 0);
+
+
+	/*!
+	\brief
+		Constructor for renderer class that uses Ogre for rendering.
+
+	\param window
+		Pointer to an Ogre::RenderWindow object.
+
+	\param queue_id
+		Ogre::uint8 value that specifies where the GUI should appear in the ogre rendering output.
+
+	\param post_queue
+		set to true to have GUI rendered after render queue \a queue_id, or false to have the GUI rendered before render queue
+		\a queue_id.
+
+	\param max_quads
+		Obsolete.  Set to 0.
+
+	\param scene_manager
+		Pointer to an Ogre::SceneManager object that is to be used for GUI rendering.
+	*/
+	OgreCEGUIRenderer(Ogre::RenderWindow* window, Ogre::uint8 queue_id, bool post_queue, uint max_quads, Ogre::SceneManager* scene_manager);
+
+
+	/*!
+	\brief
+		Destructor for Ogre renderer.
+	*/
+	virtual ~OgreCEGUIRenderer(void);
+
+
+
+	// add's a quad to the list to be rendered
+	virtual	void	addQuad(const Rect& dest_rect, float z, const Texture* tex, const Rect& texture_rect, const ColourRect& colours, QuadSplitMode quad_split_mode);
+
+	// perform final rendering for all queued renderable quads.
+	virtual	void	doRender(void);
+
+	// clear the queue
+	virtual	void	clearRenderList(void);
+
+
+	/*!
+	\brief
+		Enable or disable the queueing of quads from this point on.
+
+		This only affects queueing.  If queueing is turned off, any calls to addQuad will cause the quad to be rendered directly.  Note that
+		disabling queueing will not cause currently queued quads to be rendered, nor is the queue cleared - at any time the queue can still
+		be drawn by calling doRender, and the list can be cleared by calling clearRenderList.  Re-enabling the queue causes subsequent quads
+		to be added as if queueing had never been disabled.
+
+	\param setting
+		true to enable queueing, or false to disable queueing (see notes above).
+
+	\return
+		Nothing
+	*/
+	virtual void	setQueueingEnabled(bool setting)		{d_queueing = setting;}
+
+
+	// create an empty texture
+	virtual	Texture*	createTexture(void);
+
+	// create a texture and load it with the specified file.
+	virtual	Texture*	createTexture(const String& filename, const String& resourceGroup = "General");
+
+	// create a texture and set it to the specified size
+	virtual	Texture*	createTexture(float size);
+
+    // create an OGRE resource provider.
+    virtual ResourceProvider* createResourceProvider(void);
+
+	// destroy the given texture
+	virtual	void		destroyTexture(Texture* texture);
+
+	// destroy all textures still active
+	virtual void		destroyAllTextures(void);
+
+
+	/*!
+	\brief
+		Return whether queueing is enabled.
+
+	\return
+		true if queueing is enabled, false if queueing is disabled.
+	*/
+	virtual bool	isQueueingEnabled(void) const	{return d_queueing;}
+
+
+	/*!
+	\brief
+	Return the current width of the display in pixels
+
+	\return
+	float value equal to the current width of the display in pixels.
+	*/
+	virtual float	getWidth(void) const		{return d_display_area.getWidth();}
+
+
+	/*!
+	\brief
+	Return the current height of the display in pixels
+
+	\return
+	float value equal to the current height of the display in pixels.
+	*/
+	virtual float	getHeight(void) const		{return d_display_area.getHeight();}
+
+
+	/*!
+	\brief
+	Return the size of the display in pixels
+
+	\return
+	Size object describing the dimensions of the current display.
+	*/
+	virtual Size	getSize(void) const			{return d_display_area.getSize();}
+
+
+	/*!
+	\brief
+	Return a Rect describing the screen
+
+	\return
+	A Rect object that describes the screen area.  Typically, the top-left values are always 0, and the size of the area described is
+	equal to the screen resolution.
+	*/
+	virtual Rect	getRect(void) const			{return d_display_area;}
+
+
+	/*!
+	\brief
+		Return the maximum texture size available
+
+	\return
+		Size of the maximum supported texture in pixels (textures are always assumed to be square)
+	*/
+	virtual	uint	getMaxTextureSize(void) const		{return 2048;}		// TODO: Change to proper value
+
+
+	/*!
+	\brief
+		Return the horizontal display resolution dpi
+
+	\return
+		horizontal resolution of the display in dpi.
+	*/
+	virtual	uint	getHorzScreenDPI(void) const	{return 96;}
+
+
+	/*!
+	\brief
+		Return the vertical display resolution dpi
+
+	\return
+		vertical resolution of the display in dpi.
+	*/
+	virtual	uint	getVertScreenDPI(void) const	{return 96;}
+
+
+	/*!
+	\brief
+		Set the scene manager to be used for rendering the GUI.
+
+		The GUI system will be unhooked from the current scene manager and attached to what ever
+		is specified here.
+
+	\param scene_manager
+		Pointer to an Ogre::SceneManager object that is the new target Ogre::SceneManager to be
+		used for GUI rendering.
+
+	\return
+		Nothing.
+	*/
+	void	setTargetSceneManager(Ogre::SceneManager* scene_manager);
+
+
+	/*!
+	\brief
+		Set the target render queue for GUI rendering.
+
+	\param queue_id
+		Ogre::uint8 value specifying the render queue that the GUI system should attach to.
+
+	\param post_queue
+		- true to specify that the GUI should render after everything else in render queue \a queue_id.
+		- false to specify the GUI should render before everything else in render queue \a queue_id.
+
+	\return
+		Nothing.
+	*/
+	void	setTargetRenderQueue(Ogre::uint8 queue_id, bool post_queue);
+
+
+	/*!
+	\brief
+		Create a texture from an existing Ogre::TexturePtr object.
+
+	\note
+		If you want to use an Ogre::RenderTexture (for putting rendered output onto Gui elements or other
+		advanced techniques), you can get the Ogre::TexturePtr to be used by calling Ogre::TextureManager::getByName()
+		passing the name returned from Ogre::RenderTexture::getName() (and casting the result as necessary).
+
+	\param texture
+		pointer to an Ogre::TexturePtr object to be used as the basis for the new CEGUI::Texture
+
+	\return
+		Pointer to the newly created CEGUI::TexturePtr object.
+	*/
+	Texture*	createTexture(Ogre::TexturePtr& texture);
+
+
+	/*!
+	\brief
+	Set the size of the display in pixels.
+
+	You do not have to call this method under normal operation as the system
+	will automatically extract the size from the current view port.
+
+	\note
+	This method will cause the EventDisplaySizeChanged event to fire if the
+	display size has changed.
+
+	\param sz
+	Size object describing the size of the display.
+
+	\return
+	Nothing.
+	*/
+	void	setDisplaySize(const Size& sz);
+
+
+private:
+	/************************************************************************
+		Implementation Constants
+	************************************************************************/
+	static const size_t    VERTEX_PER_QUAD;						 //!< number of vertices per quad
+	static const size_t    VERTEX_PER_TRIANGLE;					 //!< number of vertices for a triangle
+    static const size_t    VERTEXBUFFER_INITIAL_CAPACITY;		 //!< initial capacity of the allocated vertex buffer
+    static const size_t    UNDERUSED_FRAME_THRESHOLD;            //!< number of frames to wait before shrinking buffer
+
+	/*************************************************************************
+	    Implementation Structs & classes
+	*************************************************************************/
+	/*!
+	\brief
+		structure used for all vertices.
+	*/
+	struct QuadVertex {
+		float x, y, z;			//!< The position for the vertex.
+		Ogre::RGBA diffuse;		//!< colour of the vertex
+		float tu1, tv1;			//!< texture coordinates
+	};
+
+	/*!
+	\brief
+		structure holding details about a quad to be drawn
+	*/
+	struct QuadInfo
+	{
+		Ogre::TexturePtr		texture;
+		Rect				position;
+		float				z;
+		Rect				texPosition;
+        uint32		        topLeftCol;
+        uint32		        topRightCol;
+        uint32		        bottomLeftCol;
+        uint32		        bottomRightCol;
+
+        QuadSplitMode		splitMode;
+
+		bool operator<(const QuadInfo& other) const
+		{
+			// this is intentionally reversed.
+			return z > other.z;
+		}
+	};
+
+
+	/*************************************************************************
+	    Implementation Methods
+	*************************************************************************/
+	// setup states etc
+	void	initRenderStates(void);
+
+	// sort quads list according to texture
+	void	sortQuads(void);
+
+	// render a quad directly to the display
+	void	renderQuadDirect(const Rect& dest_rect, float z, const Texture* tex, const Rect& texture_rect, const ColourRect& colours, QuadSplitMode quad_split_mode);
+
+	// convert colour value to whatever the Ogre render system is expecting.
+    uint32    colourToOgre(const colour& col) const;
+
+	// perform main work of the constructor.  This does everything except the final hook into the render system.
+	void	constructor_impl(Ogre::RenderWindow* window, Ogre::uint8 queue_id, bool post_queue, uint max_quads);
+
+
+	/*************************************************************************
+	    Implementation Data
+	*************************************************************************/
+	Rect				d_display_area;
+
+	typedef std::multiset<QuadInfo>		QuadList;
+	QuadList d_quadlist;
+	bool	 d_queueing;		//!< setting for queueing control.
+
+	// Ogre specific bits.
+	Ogre::Root*					d_ogre_root;		//!< pointer to the Ogre root object that we attach to
+	Ogre::RenderSystem*			d_render_sys;		//!< Pointer to the render system for Ogre.
+	Ogre::uint8	d_queue_id;			//!< ID of the queue that we are hooked into
+	Ogre::TexturePtr			d_currTexture;		//!< currently set texture;
+	Ogre::RenderOperation		d_render_op;		//!< Ogre render operation we use to do our stuff.
+	Ogre::HardwareVertexBufferSharedPtr	d_buffer;	//!< vertex buffer to queue sprite rendering
+    size_t d_underused_framecount;                  //!< Number of frames elapsed since buffer utilization was above half the capacity
+    Ogre::RenderOperation		d_direct_render_op;		//!< Renderop for cursor
+	Ogre::HardwareVertexBufferSharedPtr	d_direct_buffer;	//!< Renderop for cursor
+	Ogre::SceneManager*			d_sceneMngr;		//!< The scene manager we are hooked into.
+	Ogre::LayerBlendModeEx		d_colourBlendMode;	//!< Controls colour blending mode used.
+	Ogre::LayerBlendModeEx		d_alphaBlendMode;	//!< Controls alpha blending mode used.
+	Ogre::TextureUnitState::UVWAddressingMode d_uvwAddressMode;
+
+	CEGUIRQListener*			d_ourlistener;
+	bool						d_post_queue;		//!< true if we render after everything else in our queue.
+	size_t						d_bufferPos;		//!< index into buffer where next vertex should be put.
+	bool						d_sorted;			//!< true when data in quad list is sorted.
+	Point						d_texelOffset;		//!< Offset required for proper texel mapping.
+
+	std::list<OgreCEGUITexture*> d_texturelist;		//!< List used to track textures.
+};
+
+} // End of  CEGUI namespace section
+
+
+#endif	// end of guard _OgreCEGUIRenderer_h_
Index: code/branches/libraries2/src/external/ogreceguirenderer/OgreCEGUIResourceProvider.cpp
===================================================================
--- code/branches/libraries2/src/external/ogreceguirenderer/OgreCEGUIResourceProvider.cpp	(revision 5708)
+++ code/branches/libraries2/src/external/ogreceguirenderer/OgreCEGUIResourceProvider.cpp	(revision 5708)
@@ -0,0 +1,97 @@
+/************************************************************************
+	filename: 	OgreCEGUIResourceProvider.cpp
+	created:	8/7/2004
+	author:		James '_mental_' O'Sullivan
+
+	purpose:	Implements the Resource Provider common functionality
+*************************************************************************/
+/*************************************************************************
+    Crazy Eddie's GUI System (http://www.cegui.org.uk)
+    Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*************************************************************************/
+#include "OgreCEGUIResourceProvider.h"
+
+#include <CEGUIExceptions.h>
+#include <OgreArchiveManager.h>
+
+
+// Start of CEGUI namespace section
+namespace CEGUI
+{
+    OgreCEGUIResourceProvider::OgreCEGUIResourceProvider() : ResourceProvider()
+    {
+        // set deafult resource group for Ogre
+        d_defaultResourceGroup = Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME.c_str();
+    }
+
+//    void OgreResourceProvider::loadInputSourceContainer(const String& filename, InputSourceContainer& output)
+//   {
+//        Ogre::DataStreamPtr input = Ogre::ResourceGroupManager::getSingleton().openResource(filename.c_str());
+//
+//		if (input.isNull())
+//		{
+//			throw InvalidRequestException((utf8*)
+//				"Scheme::Scheme - Filename supplied for Scheme loading must be valid");
+//		}
+//
+//       XERCES_CPP_NAMESPACE_USE
+//        size_t buffsz = input->size();
+//        unsigned char* mem = reinterpret_cast<unsigned char*>(XMLPlatformUtils::fgArrayMemoryManager->allocate(buffsz));
+//        memcpy(mem, input.getPointer()->getAsString().c_str(), buffsz);
+//        InputSource* mInputSource = new MemBufInputSource(mem, buffsz, filename.c_str(), true);
+//        input.setNull();
+//
+//       output.setData(mInputSource);
+//    }
+
+    void OgreCEGUIResourceProvider::loadRawDataContainer(const String& filename, RawDataContainer& output,  const String& resourceGroup)
+    {
+        String orpGroup;
+        if (resourceGroup.empty())
+            orpGroup = d_defaultResourceGroup.empty() ? Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME.c_str() : d_defaultResourceGroup;
+        else
+            orpGroup = resourceGroup;
+
+        Ogre::DataStreamPtr input =
+            Ogre::ResourceGroupManager::getSingleton().openResource(filename.c_str(), orpGroup.c_str());
+
+		if (input.isNull())
+		{
+            throw InvalidRequestException((utf8*)
+                "OgreCEGUIResourceProvider::loadRawDataContainer - Unable to open resource file '" + filename + (utf8*)"' in resource group '" + orpGroup + (utf8*)"'.");
+        }
+
+		Ogre::String buf = input->getAsString();
+		const size_t memBuffSize = buf.length();
+
+        unsigned char* mem = new unsigned char[memBuffSize];
+        memcpy(mem, buf.c_str(), memBuffSize);
+
+        output.setData(mem);
+        output.setSize(memBuffSize);
+    }
+
+	void OgreCEGUIResourceProvider::unloadRawDataContainer(RawDataContainer& data)
+	{
+		if (data.getDataPtr())
+		{
+			delete[] data.getDataPtr();
+			data.setData(0);
+			data.setSize(0);
+		}
+	}
+} // End of  CEGUI namespace section
Index: code/branches/libraries2/src/external/ogreceguirenderer/OgreCEGUIResourceProvider.h
===================================================================
--- code/branches/libraries2/src/external/ogreceguirenderer/OgreCEGUIResourceProvider.h	(revision 5708)
+++ code/branches/libraries2/src/external/ogreceguirenderer/OgreCEGUIResourceProvider.h	(revision 5708)
@@ -0,0 +1,52 @@
+/************************************************************************
+	filename: 	CEGUIOgreResourceProvider.h
+	created:	8/7/2004
+	author:		James '_mental_' O'Sullivan
+	
+	purpose:	Defines abstract base class for CEGUIData objects
+*************************************************************************/
+/*************************************************************************
+    Crazy Eddie's GUI System (http://www.cegui.org.uk)
+    Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*************************************************************************/
+#ifndef _OgreCEGUIResourceProvider_h_
+#define _OgreCEGUIResourceProvider_h_
+
+#include <CEGUIResourceProvider.h>
+#include "OgreCEGUIRenderer.h"
+
+// Start of CEGUI namespace section
+namespace CEGUI
+{
+class _OgrePrivate OgreCEGUIResourceProvider : public ResourceProvider
+{
+public:
+	/*************************************************************************
+		Construction and Destruction
+	*************************************************************************/
+	OgreCEGUIResourceProvider();
+
+	~OgreCEGUIResourceProvider(void) {}
+
+//    void loadInputSourceContainer(const String& filename, InputSourceContainer& output);
+    void loadRawDataContainer(const String& filename, RawDataContainer& output, const String& resourceGroup);
+    void unloadRawDataContainer(RawDataContainer& output);
+};
+
+} // End of  CEGUI namespace section
+
+#endif	// end of guard _OgreCEGUIResourceProvider_h_
Index: code/branches/libraries2/src/external/ogreceguirenderer/OgreCEGUITexture.cpp
===================================================================
--- code/branches/libraries2/src/external/ogreceguirenderer/OgreCEGUITexture.cpp	(revision 5708)
+++ code/branches/libraries2/src/external/ogreceguirenderer/OgreCEGUITexture.cpp	(revision 5708)
@@ -0,0 +1,268 @@
+/************************************************************************
+	filename: 	OgreCEGUITexture.cpp
+	created:	11/5/2004
+	author:		Paul D Turner
+	
+	purpose:	Implementation of Texture using Ogre engine
+*************************************************************************/
+/*************************************************************************
+    Crazy Eddie's GUI System (http://www.cegui.org.uk)
+    Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*************************************************************************/
+
+#include <CEGUISystem.h>
+#include <CEGUIExceptions.h>
+#include "OgreCEGUITexture.h"
+#include "OgreCEGUIRenderer.h"
+
+#include <OgreTextureManager.h>
+
+// Start of CEGUI namespace section
+namespace CEGUI
+{
+/*************************************************************************
+	Static data definition / initialisation
+*************************************************************************/
+uint32 OgreCEGUITexture::d_texturenumber		= 0;
+
+
+/*************************************************************************
+	Constructor
+*************************************************************************/
+OgreCEGUITexture::OgreCEGUITexture(Renderer* owner) :
+	Texture(owner)
+{
+	d_ogre_texture.setNull();
+	d_isLinked = false;
+}
+
+
+/*************************************************************************
+	Destructor
+*************************************************************************/
+OgreCEGUITexture::~OgreCEGUITexture(void)
+{
+	freeOgreTexture();
+}
+
+
+/*************************************************************************
+	Loads the specified image file into the texture.  The texture is
+	resized as required to hold the image.	
+*************************************************************************/
+void OgreCEGUITexture::loadFromFile(const String& filename, const String& resourceGroup)
+{
+	using namespace Ogre;
+
+	// unload old ogre texture
+	freeOgreTexture();
+
+	// create / load a new ogre texture from the specified image
+	try
+	{
+		TextureManager& textureManager = TextureManager::getSingleton();
+
+		// see if texture already exists
+		Ogre::TexturePtr ogreTexture = (Ogre::TexturePtr)textureManager.getByName(filename.c_str());
+
+		if (!ogreTexture.isNull())
+		{
+			// texture already exists, so create a 'linked' texture (ensures texture is not destroyed twice)
+			d_ogre_texture = ogreTexture;
+			d_isLinked = true;
+		}
+		// texture does not already exist, so load it in
+		else
+		{
+            String orpGroup;
+            if (resourceGroup.empty())
+            {
+                const String& defGrp = CEGUI::System::getSingleton().getResourceProvider()->getDefaultResourceGroup();
+                orpGroup = defGrp.empty() ? Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME.c_str() : defGrp;
+            }
+            else
+            {
+                orpGroup = resourceGroup;
+            }
+
+			d_ogre_texture = TextureManager::getSingleton().load(filename.c_str(), orpGroup.c_str(), TEX_TYPE_2D, 0, 1.0f);
+			d_isLinked = false;
+		}
+
+	}
+	catch(Ogre::Exception e)
+	{
+		throw RendererException((utf8*)"Failed to create Texture object from file '" + filename + "'. Additional Information:\n" + e.getFullDescription().c_str());
+	}
+
+	// if we got a pointer cache some details
+	if (!d_ogre_texture.isNull())
+	{
+		d_width		= d_ogre_texture->getWidth();
+		d_height	= d_ogre_texture->getHeight();
+	}
+	// no texture from image so throw.
+	else
+	{
+		throw RendererException((utf8*)"Failed to create Texture object from file '" + filename + "'.  Ogre returned a NULL pointer.");
+	}
+
+}
+
+
+/*************************************************************************
+	Loads (copies) an image in memory into the texture.  The texture is
+	resized as required to hold the image.	
+*************************************************************************/
+
+void _byteSwap(unsigned char* b, int n)
+{
+    register int i = 0;
+    register int j = n-1;
+    while (i<j)
+    {
+        std::swap(b[i], b[j]);
+        i++, j--;
+    }
+}
+#define byteSwap(x) _byteSwap((unsigned char*) &x,sizeof(x))
+
+void OgreCEGUITexture::loadFromMemory(const void* buffPtr, uint buffWidth, uint buffHeight, PixelFormat pixelFormat)
+{
+	using namespace Ogre;
+
+	// get rid of old texture
+	freeOgreTexture();
+
+	// wrap input buffer with an Ogre DataChunk
+    uint32 bytesize = ((buffWidth * sizeof(uint32)) * buffHeight);
+
+#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+    uint32* swappedBuffer = new uint32[bytesize/4];
+    memcpy(swappedBuffer, buffPtr, bytesize);
+
+    for (int i=0; i < bytesize/4; i++)
+        byteSwap(swappedBuffer[i]);
+
+    DataStreamPtr odc(new MemoryDataStream(static_cast<void*>(swappedBuffer), bytesize, false));
+#else
+	DataStreamPtr odc(new MemoryDataStream(const_cast<void*>(buffPtr), bytesize, false));
+#endif
+
+	// get pixel type for the target texture - the elements here might look wrong, but is just
+	// differences in definition (at the core level, between GL and D3D).
+	Ogre::PixelFormat targetFmt =
+		(pixelFormat == PF_RGBA) ? Ogre::PF_A8R8G8B8 : Ogre::PF_R8G8B8;
+
+	// try to create a Ogre::Texture from the input data
+	d_ogre_texture = TextureManager::getSingleton().loadRawData(getUniqueName(), "General", odc, buffWidth, buffHeight, targetFmt , TEX_TYPE_2D, 0, 1.0f);
+
+	// if we got a pointer cache some details
+	if (!d_ogre_texture.isNull())
+	{
+		d_width		= d_ogre_texture->getWidth();
+		d_height	= d_ogre_texture->getHeight();
+	}
+	// no texture from memory so throw.
+	else
+	{
+		throw RendererException((utf8*)"Failed to create Texture object from memory:  Ogre returned a NULL Ogre::Texture pointer.");
+	}
+
+}
+
+
+/*************************************************************************
+	set the size of the internal Ogre texture.  Previous Ogre texture
+	is lost.	
+*************************************************************************/
+void OgreCEGUITexture::setOgreTextureSize(uint size)
+{
+	using namespace Ogre;
+
+	// unload any current Ogre::Texture
+	freeOgreTexture();
+
+	// Try to create an empty texture of the given size
+	d_ogre_texture = TextureManager::getSingleton().createManual(getUniqueName(), "General", TEX_TYPE_2D, size, size, 0, PF_A8R8G8B8, TU_DEFAULT);
+
+	// if we got a pointer cache some details
+	if (!d_ogre_texture.isNull())
+	{
+		d_width		= d_ogre_texture->getWidth();
+		d_height	= d_ogre_texture->getHeight();
+	}
+	// no texture so throw.
+	else
+	{
+		throw RendererException((utf8*)"Failed to create texture of specified size: Ogre::Texture creation failed.");
+	}
+
+}
+
+
+/*************************************************************************
+	safely free Ogre::Texture texture (can be called multiple times with
+	no ill effect)
+*************************************************************************/
+void OgreCEGUITexture::freeOgreTexture(void)
+{
+	if ((!d_ogre_texture.isNull()) && !d_isLinked)
+	{
+		Ogre::TextureManager::getSingleton().remove(d_ogre_texture->getHandle());
+	}
+	d_ogre_texture.setNull();
+}
+
+
+/*************************************************************************
+	return a Ogre::string that contains a unique name.	
+*************************************************************************/
+Ogre::String OgreCEGUITexture::getUniqueName(void)
+{
+	Ogre::String str;
+
+#ifdef CEGUI_USEOLDOGRESTRING
+	str << "_cegui_ogre_" << d_texturenumber;
+#else
+	Ogre::StringUtil::StrStreamType strstream;
+	strstream << "_cegui_ogre_" << d_texturenumber;
+	str = strstream.str();
+#endif
+
+	++d_texturenumber;
+
+	return str;
+}
+
+
+/*************************************************************************
+	Set the internal Ogre::Texture object.
+*************************************************************************/
+void OgreCEGUITexture::setOgreTexture(Ogre::TexturePtr& texture)
+{
+	freeOgreTexture();
+
+	d_ogre_texture = texture;
+	d_width	 = d_ogre_texture->getWidth();
+	d_height = d_ogre_texture->getHeight();
+	d_isLinked = true;
+}
+
+
+} // End of  CEGUI namespace section
+
Index: code/branches/libraries2/src/external/ogreceguirenderer/OgreCEGUITexture.h
===================================================================
--- code/branches/libraries2/src/external/ogreceguirenderer/OgreCEGUITexture.h	(revision 5708)
+++ code/branches/libraries2/src/external/ogreceguirenderer/OgreCEGUITexture.h	(revision 5708)
@@ -0,0 +1,179 @@
+/************************************************************************
+	filename: 	OgreCEGUITexture.h
+	created:	11/5/2004
+	author:		Paul D Turner
+	
+	purpose:	Interface to Texture implemented via Ogre engine
+*************************************************************************/
+/*************************************************************************
+    Crazy Eddie's GUI System (http://www.cegui.org.uk)
+    Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*************************************************************************/
+#ifndef _OgreCEGUITexture_h_
+#define _OgreCEGUITexture_h_
+
+#include <CEGUIBase.h>
+#include <CEGUIRenderer.h>
+#include <CEGUITexture.h>
+#include "OgreCEGUIRenderer.h"
+
+// Start of CEGUI namespace section
+namespace CEGUI
+{
+/*!
+\brief
+	Texture class that is created by OgreCEGUIRenderer objects
+*/
+class _OgrePrivate OgreCEGUITexture : public Texture
+{
+private:
+	/*************************************************************************
+		Friends (to allow construction and destruction)
+	*************************************************************************/
+	friend	Texture* OgreCEGUIRenderer::createTexture(void);
+	friend	Texture* OgreCEGUIRenderer::createTexture(const String& filename, const String& resourceGroup);
+	friend	Texture* OgreCEGUIRenderer::createTexture(float size);
+	friend	void	 OgreCEGUIRenderer::destroyTexture(Texture* texture);
+
+
+	/*************************************************************************
+		Construction & Destruction (by Renderer object only)
+	*************************************************************************/
+	OgreCEGUITexture(Renderer* owner);
+	virtual ~OgreCEGUITexture(void);
+
+public:
+	/*!
+	\brief
+		Returns the current pixel width of the texture
+
+	\return
+		ushort value that is the current width of the texture in pixels
+	*/
+	virtual	ushort	getWidth(void) const		{return d_width;}
+
+
+	/*!
+	\brief
+		Returns the current pixel height of the texture
+
+	\return
+		ushort value that is the current height of the texture in pixels
+	*/
+	virtual	ushort	getHeight(void) const		{return d_height;}
+
+
+	/*!
+	\brief
+		Loads the specified image file into the texture.  The texture is resized as required to hold the image.
+
+	\param filename
+		The filename of the image file that is to be loaded into the texture
+
+	\return
+		Nothing.
+	*/
+	virtual void	loadFromFile(const String& filename, const String& resourceGroup);
+
+
+	/*!
+	\brief
+		Loads (copies) an image in memory into the texture.  The texture is resized as required to hold the image.
+	
+	\param buffPtr
+		Pointer to the buffer containing the image data
+	
+	\param buffWidth
+		Width of the buffer (in pixels as specified by \a pixelFormat )
+	
+	\param buffHeight
+		Height of the buffer (in pixels as specified by \a pixelFormat )
+	
+	\param pixelFormat
+	PixelFormat value describing the format contained in \a buffPtr
+	
+	\return
+		Nothing.
+	*/
+	virtual void	loadFromMemory(const void* buffPtr, uint buffWidth, uint buffHeight, PixelFormat pixelFormat);
+
+
+	/*!
+	\brief
+		Return a pointer to the internal Ogre::Texture object
+
+	\return
+		Pointer to the Ogre::Texture object currently being used by this Texture object
+	*/
+	Ogre::TexturePtr	getOgreTexture(void) const		{return d_ogre_texture;}
+
+
+	/*!
+	\brief
+		set the size of the internal Ogre texture.  Previous Ogre texture is lost.
+
+	\param size
+		pixel size of the new internal texture.  This will be rounded up to a power of 2.
+
+	\return
+		Nothing.
+	*/
+	void	setOgreTextureSize(uint size);
+
+
+	/*!
+	\brief
+		Set the internal Ogre::TexturePtr object.
+
+	\param texture
+		Reference to an Ogre::TexturePtr object that is to be used by this Texture object.
+
+	\return
+		Nothing.
+	*/
+	void	setOgreTexture(Ogre::TexturePtr& texture);
+
+
+private:
+	/*************************************************************************
+		Implementation Functions
+	*************************************************************************/
+	// safely free Ogre::Texture texture (can be called multiple times with no ill effect)
+	void	freeOgreTexture(void);
+
+	// return a Ogre::string that contains a unique name.
+	Ogre::String	getUniqueName(void);
+
+
+	/*************************************************************************
+		Implementation Data
+	*************************************************************************/
+	static	uint32          d_texturenumber;	//!< Counter used to provide unique texture names.
+
+	Ogre::TexturePtr		d_ogre_texture;		//!< The 'real' texture.
+
+	ushort					d_width;			//!< cached width of the texture
+	ushort					d_height;			//!< cached height of the texture
+
+	bool	d_isLinked;		//!< True if we are linked to a texture we did not actually create.
+};
+
+
+} // End of  CEGUI namespace section
+
+
+#endif	// end of guard _OgreCEGUITexture_h_
Index: code/branches/libraries2/src/external/ogreceguirenderer/VERSION
===================================================================
--- code/branches/libraries2/src/external/ogreceguirenderer/VERSION	(revision 5708)
+++ code/branches/libraries2/src/external/ogreceguirenderer/VERSION	(revision 5708)
@@ -0,0 +1,22 @@
+This library is part of the OGRE v1.6.1 source.
+
+-----
+
+Copyright 1999-2004 The OGRE Team.
+
+This file is part of OGRE (Object-Oriented Graphics Rendering Engine).
+
+OGRE 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, or (at your option)
+any later version.
+
+OGRE is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with OGRE; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
Index: code/branches/libraries2/src/external/ogreceguirenderer/changes_orxonox.diff
===================================================================
--- code/branches/libraries2/src/external/ogreceguirenderer/changes_orxonox.diff	(revision 5708)
+++ code/branches/libraries2/src/external/ogreceguirenderer/changes_orxonox.diff	(revision 5708)
@@ -0,0 +1,96 @@
+--- OgreCEGUIRenderer.cpp	Wed Jan 28 21:14:09 2009
++++ OgreCEGUIRenderer.cpp	Wed Jan 28 21:07:10 2009
+@@ -24,11 +24,11 @@
+     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *************************************************************************/
+ 
+-#include <CEGUI/CEGUIImagesetManager.h>
+-#include <CEGUI/CEGUIImageset.h>
+-#include <CEGUI/CEGUIImage.h>
+-#include <CEGUI/CEGUIExceptions.h>
+-#include <CEGUI/CEGUISystem.h>
++#include <CEGUIImagesetManager.h>
++#include <CEGUIImageset.h>
++#include <CEGUIImage.h>
++#include <CEGUIExceptions.h>
++#include <CEGUISystem.h>
+ 
+ #include "OgreCEGUIRenderer.h"
+ #include "OgreCEGUITexture.h"
+@@ -454,7 +454,11 @@
+ 	d_render_sys->_setTextureUnitFiltering(0, FO_LINEAR, FO_LINEAR, FO_POINT);
+ 	d_render_sys->_setTextureAddressingMode(0, d_uvwAddressMode);
+ 	d_render_sys->_setTextureMatrix(0, Matrix4::IDENTITY);
++#if OGRE_VERSION >= 0x010600
++	d_render_sys->_setAlphaRejectSettings(CMPF_ALWAYS_PASS, 0, false);
++#else
+ 	d_render_sys->_setAlphaRejectSettings(CMPF_ALWAYS_PASS, 0);
++#endif
+ 	d_render_sys->_setTextureBlendMode(0, d_colourBlendMode);
+ 	d_render_sys->_setTextureBlendMode(0, d_alphaBlendMode);
+ 	d_render_sys->_disableTextureUnitsFrom(1);
+--- OgreCEGUIRenderer.h	Wed Jan 28 21:14:09 2009
++++ OgreCEGUIRenderer.h	Wed Jan 28 21:06:46 2009
+@@ -29,9 +29,9 @@
+ #ifndef _OgreCEGUIRenderer_h_
+ #define _OgreCEGUIRenderer_h_
+ 
+-#include <CEGUI/CEGUIBase.h>
+-#include <CEGUI/CEGUIRenderer.h>
+-#include <CEGUI/CEGUITexture.h>
++#include <CEGUIBase.h>
++#include <CEGUIRenderer.h>
++#include <CEGUITexture.h>
+ 
+ #include <OgreRenderQueueListener.h>
+ #include <OgreSceneManagerEnumerator.h>
+--- OgreCEGUIResourceProvider.cpp	Wed Jan 28 21:14:09 2009
++++ OgreCEGUIResourceProvider.cpp	Wed Jan 28 21:07:15 2009
+@@ -25,7 +25,7 @@
+ *************************************************************************/
+ #include "OgreCEGUIResourceProvider.h"
+ 
+-#include <CEGUI/CEGUIExceptions.h>
++#include <CEGUIExceptions.h>
+ #include <OgreArchiveManager.h>
+ 
+ 
+--- OgreCEGUIResourceProvider.h	Wed Jan 28 21:14:09 2009
++++ OgreCEGUIResourceProvider.h	Wed Jan 28 21:06:51 2009
+@@ -26,7 +26,7 @@
+ #ifndef _OgreCEGUIResourceProvider_h_
+ #define _OgreCEGUIResourceProvider_h_
+ 
+-#include <CEGUI/CEGUIResourceProvider.h>
++#include <CEGUIResourceProvider.h>
+ #include "OgreCEGUIRenderer.h"
+ 
+ // Start of CEGUI namespace section
+--- OgreCEGUITexture.cpp	Wed Jan 28 21:14:09 2009
++++ OgreCEGUITexture.cpp	Wed Jan 28 21:07:21 2009
+@@ -24,8 +24,8 @@
+     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *************************************************************************/
+ 
+-#include <CEGUI/CEGUISystem.h>
+-#include <CEGUI/CEGUIExceptions.h>
++#include <CEGUISystem.h>
++#include <CEGUIExceptions.h>
+ #include "OgreCEGUITexture.h"
+ #include "OgreCEGUIRenderer.h"
+ 
+--- OgreCEGUITexture.h	Wed Jan 28 21:14:09 2009
++++ OgreCEGUITexture.h	Wed Jan 28 21:07:06 2009
+@@ -26,9 +26,9 @@
+ #ifndef _OgreCEGUITexture_h_
+ #define _OgreCEGUITexture_h_
+ 
+-#include <CEGUI/CEGUIBase.h>
+-#include <CEGUI/CEGUIRenderer.h>
+-#include <CEGUI/CEGUITexture.h>
++#include <CEGUIBase.h>
++#include <CEGUIRenderer.h>
++#include <CEGUITexture.h>
+ #include "OgreCEGUIRenderer.h"
+ 
+ // Start of CEGUI namespace section
