diff --git a/LICENCE.md b/LICENCE.md
new file mode 100644
index 0000000..746a255
--- /dev/null
+++ b/LICENCE.md
@@ -0,0 +1,643 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If 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 convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Use with the GNU Affero General Public License.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+
+
+ADDITIONAL TERMS APPLICABLE TO THE RETURN TO CASTLE WOLFENSTEIN GPL SOURCE CODE.
+
+	The following additional terms (�Additional Terms�) supplement and modify the GNU General Public License, Version 3 (�GPL�) applicable to the Return to Castle Wolfenstein GPL Source Code (�RTCW Source Code�).  In addition to the terms and conditions of the GPL, the RTCW Source Code is subject to the further restrictions below.
+
+1. Replacement of Section 15.  Section 15 of the GPL shall be deleted in its entirety and replaced with the following:
+
+�15. Disclaimer of Warranty.  
+
+THE PROGRAM IS PROVIDED WITHOUT ANY WARRANTIES, WHETHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, TITLE AND MERCHANTABILITY.  THE PROGRAM IS BEING DELIVERED OR MADE AVAILABLE �AS IS�, �WITH ALL FAULTS� AND WITHOUT WARRANTY OR REPRESENTATION.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.�
+
+2. Replacement of Section 16.  Section 16 of the GPL shall be deleted in its entirety and replaced with the following:
+
+�16.	LIMITATION OF LIABILITY.  
+
+UNDER NO CIRCUMSTANCES SHALL ANY COPYRIGHT HOLDER OR ITS AFFILIATES, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, FOR ANY DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, DIRECT, INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL OR PUNITIVE DAMAGES ARISING FROM, OUT OF OR IN CONNECTION WITH THE USE OR INABILITY TO USE THE PROGRAM OR OTHER DEALINGS WITH THE PROGRAM(INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), WHETHER OR NOT ANY COPYRIGHT HOLDER OR SUCH OTHER PARTY RECEIVES NOTICE OF ANY SUCH DAMAGES AND WHETHER OR NOT SUCH DAMAGES COULD HAVE BEEN FORESEEN.�
+
+3. LEGAL NOTICES; NO TRADEMARK LICENSE; ORIGIN.  You must reproduce faithfully all trademark, copyright and other proprietary and legal notices on any copies of the Program or any other required author attributions.  This license does not grant you rights to use any copyright holder or any other party�s name, logo, or trademarks.  Neither the name of the copyright holder or its affiliates, or any other party who modifies and/or conveys the Program may be used to endorse or promote products derived from this software without specific prior written permission.  The origin of the Program must not be misrepresented; you must not claim that you wrote the original Program.  Altered source versions must be plainly marked as such, and must not be misrepresented as being the original Program.
+
+4. INDEMNIFICATION.  IF YOU CONVEY A COVERED WORK AND AGREE WITH ANY RECIPIENT OF THAT COVERED WORK THAT YOU WILL ASSUME ANY LIABILITY FOR THAT COVERED WORK, YOU HEREBY AGREE TO INDEMNIFY, DEFEND AND HOLD HARMLESS THE OTHER LICENSORS AND AUTHORS OF THAT COVERED WORK FOR ANY DAMAEGS, DEMANDS, CLAIMS, LOSSES, CAUSES OF ACTION, LAWSUITS, JUDGMENTS EXPENSES (INCLUDING WITHOUT LIMITATION REASONABLE ATTORNEYS' FEES AND EXPENSES) OR ANY OTHER LIABLITY ARISING FROM, RELATED TO OR IN CONNECTION WITH YOUR ASSUMPTIONS OF LIABILITY.
diff --git a/MP/.gitignore b/MP/.gitignore
index 39355ba..4e5fede 100644
--- a/MP/.gitignore
+++ b/MP/.gitignore
@@ -37,3 +37,5 @@ profile
 # Microsoft Visual Studio
 ####################
 *.sdf
+*.opensdf
+*.suo
diff --git a/MP/Makefile b/MP/Makefile
index 5447e44..d50e848 100644
--- a/MP/Makefile
+++ b/MP/Makefile
@@ -3,10 +3,8 @@
 #
 # GNU Make required
 #
-
 COMPILE_PLATFORM=$(shell uname | sed -e 's/_.*//' | tr '[:upper:]' '[:lower:]' | sed -e 's/\//_/g')
-COMPILE_ARCH=$(shell uname -m | sed -e 's/i.86/x86/' | sed -e 's/^arm.*/arm/')
-ARM_VER_CHECK=$(shell uname -m)
+COMPILE_ARCH=$(shell uname -m | sed -e 's/i.86/x86/')
 
 ifeq ($(COMPILE_PLATFORM),sunos)
   # Solaris uname and GNU uname differ
@@ -92,10 +90,6 @@ ifeq ($(COMPILE_ARCH),axp)
   COMPILE_ARCH=alpha
 endif
 
-ifeq ($(COMPILE_ARCH),sparc64)
-  COMPILE_ARCH=sparc
-endif
-
 ifndef ARCH
 ARCH=$(COMPILE_ARCH)
 endif
@@ -126,7 +120,7 @@ endif
 export CROSS_COMPILING
 
 ifndef VERSION
-VERSION=1.51c-MP
+VERSION=1.51d-MP
 endif
 
 ifndef CLIENTBIN
@@ -262,7 +256,7 @@ USE_YACC=0
 endif
 
 ifndef DEBUG_CFLAGS
-DEBUG_CFLAGS=-g -O0
+DEBUG_CFLAGS=-ggdb -O0
 endif
 
 ifndef USE_ANTIWALLHACK
@@ -311,6 +305,7 @@ OPUSFILEDIR=$(MOUNT_DIR)/opusfile-0.9
 ZDIR=$(MOUNT_DIR)/zlib-1.2.11
 FTDIR=$(MOUNT_DIR)/freetype-2.9
 SPLDIR=$(MOUNT_DIR)/splines
+TOOLSDIR=$(MOUNT_DIR)/tools
 Q3ASMDIR=$(MOUNT_DIR)/tools/asm
 LBURGDIR=$(MOUNT_DIR)/tools/lcc/lburg
 Q3CPPDIR=$(MOUNT_DIR)/tools/lcc/cpp
@@ -359,11 +354,21 @@ ifneq ($(BUILD_CLIENT),0)
   endif
 endif
 
+# Add git version info
+USE_GIT=
+ifeq ($(wildcard ../.git),../.git)
+  GIT_REV=$(shell git show -s --pretty=format:%h-%ad --date=short)
+  ifneq ($(GIT_REV),)
+    VERSION:=$(VERSION)_GIT_$(GIT_REV)
+    USE_GIT=1
+  endif
+endif
+
+
 #############################################################################
 # SETUP AND BUILD -- LINUX
 #############################################################################
 
-## Defaults
 INSTALL=install
 MKDIR=mkdir -p
 EXTRA_FILES=
@@ -374,41 +379,43 @@ ifneq (,$(findstring "$(COMPILE_PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu
 endif
 
 ifneq (,$(findstring "$(PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu" "gnu"))
-
   BASE_CFLAGS = -Wall -fno-strict-aliasing \
     -pipe -DUSE_ICON -DARCH_STRING=\\\"$(FILE_ARCH)\\\"
   CLIENT_CFLAGS += $(SDL_CFLAGS)
 
-  OPTIMIZEVM = -O3
-  OPTIMIZE = $(OPTIMIZEVM) -ffast-math
-
   ifeq ($(ARCH),x86_64)
     OPTIMIZEVM = -O3
     OPTIMIZE = $(OPTIMIZEVM) -ffast-math
-  endif
+  else
   ifeq ($(ARCH),x86)
     OPTIMIZEVM = -O3 -march=i586
     OPTIMIZE = $(OPTIMIZEVM) -ffast-math
-  endif
+  else
   ifeq ($(ARCH),ppc)
+    OPTIMIZEVM = -O3
+    OPTIMIZE = $(OPTIMIZEVM) -ffast-math
     ALTIVEC_CFLAGS = -maltivec
   endif
   ifeq ($(ARCH),ppc64)
+    OPTIMIZEVM = -O3
+    OPTIMIZE = $(OPTIMIZEVM) -ffast-math
     ALTIVEC_CFLAGS = -maltivec
   endif
   ifeq ($(ARCH),sparc)
-    OPTIMIZE += -mtune=ultrasparc3 -mv8plus
-    OPTIMIZEVM += -mtune=ultrasparc3 -mv8plus
+    OPTIMIZEVM += -mcpu=v9 -mtune=v9 -mv8plus
+    OPTIMIZE = $(OPTIMIZEVM) -ffast-math
   endif
   ifeq ($(ARCH),sparc64)
-    OPTIMIZE += -mtune=ultrasparc3 -mv8plus
-    OPTIMIZEVM += -mtune=ultrasparc3 -mv8plus
+    OPTIMIZEVM += -mcpu=v9 -mtune=v9 -mv8plus
+    OPTIMIZE = $(OPTIMIZEVM) -ffast-math
   endif
   ifeq ($(ARCH),alpha)
     # According to http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=410555
     # -ffast-math will cause the client to die with SIGFPE on Alpha
     OPTIMIZE = $(OPTIMIZEVM)
   endif
+  endif
+  endif
 
   SHLIBEXT=so
   SHLIBCFLAGS=-fPIC -fvisibility=hidden
@@ -425,11 +432,11 @@ ifneq (,$(findstring "$(PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu" "gnu")
     ifeq ($(CROSS_COMPILING),1)
       ifeq ($(ARCH),x86)
       SDL_LIBS = $(LIBSDIR)/linux32/libSDL2main.a \
-                 $(LIBSDIR)/linux32/libSDL2-2.0.so.0.9.0
+                 $(LIBSDIR)/linux32/libSDL2-2.0.so.0.18.0
       endif
       ifeq ($(ARCH),x86_64)
       SDL_LIBS = $(LIBSDIR)/linux64/libSDL2main.a \
-                 $(LIBSDIR)/linux64/libSDL2-2.0.so.0.9.0
+                 $(LIBSDIR)/linux64/libSDL2-2.0.so.0.18.0
       endif
     endif
   endif
@@ -474,31 +481,55 @@ ifeq ($(PLATFORM),darwin)
   LIBS = -framework Cocoa
   CLIENT_LIBS=
   RENDERER_LIBS=
-  OPTIMIZEVM= -O3
+  OPTIMIZEVM = -O3
+
+  # Default minimum Mac OS X version
+  ifeq ($(MACOSX_VERSION_MIN),)
+    MACOSX_VERSION_MIN=10.5
+    ifeq ($(ARCH),arm64)
+      MACOSX_VERSION_MIN=11.0
+    endif
+  endif
+
+  MACOSX_MAJOR=$(shell echo $(MACOSX_VERSION_MIN) | cut -d. -f1)
+  MACOSX_MINOR=$(shell echo $(MACOSX_VERSION_MIN) | cut -d. -f2)
+  ifeq ($(shell test $(MACOSX_MINOR) -gt 9; echo $$?),0)
+    # Multiply and then remove decimal. 10.10 -> 101000.0 -> 101000
+    MAC_OS_X_VERSION_MIN_REQUIRED=$(shell echo "$(MACOSX_MAJOR) * 10000 + $(MACOSX_MINOR) * 100" | bc | cut -d. -f1)
+  else
+    # Multiply by 100 and then remove decimal. 10.7 -> 1070.0 -> 1070
+    MAC_OS_X_VERSION_MIN_REQUIRED=$(shell echo "$(MACOSX_VERSION_MIN) * 100" | bc | cut -d. -f1)
+  endif
+
+  LDFLAGS += -mmacosx-version-min=$(MACOSX_VERSION_MIN)
+  BASE_CFLAGS += -mmacosx-version-min=$(MACOSX_VERSION_MIN) \
+                 -DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED)
 
-  BASE_CFLAGS = -Wall
+  MACOSX_ARCH=$(ARCH)
+  ifeq ($(ARCH),x86)
+    MACOSX_ARCH=i386
+  endif
 
   ifeq ($(ARCH),ppc)
-    BASE_CFLAGS += -arch ppc -mmacosx-version-min=10.5 \
-      -DMAC_OS_X_VERSION_MIN_REQUIRED=1050 -DMAC_OS_X_VERSION_MAX_ALLOWED=1060
+    BASE_CFLAGS += -arch ppc
     ALTIVEC_CFLAGS = -faltivec
   endif
   ifeq ($(ARCH),ppc64)
-    BASE_CFLAGS += -arch ppc64 -mmacosx-version-min=10.5 \
-      -DMAC_OS_X_VERSION_MIN_REQUIRED=1050 -DMAC_OS_X_VERSION_MAX_ALLOWED=1060
+    BASE_CFLAGS += -arch ppc64
     ALTIVEC_CFLAGS = -faltivec
   endif
   ifeq ($(ARCH),x86)
     OPTIMIZEVM += -march=prescott -mfpmath=sse
     # x86 vm will crash without -mstackrealign since MMX instructions will be
     # used no matter what and they corrupt the frame pointer in VM calls
-    BASE_CFLAGS += -arch i386 -mstackrealign -mmacosx-version-min=10.6 \
-      -DMAC_OS_X_VERSION_MIN_REQUIRED=1060
+    BASE_CFLAGS += -arch i386 -m32 -mstackrealign
   endif
   ifeq ($(ARCH),x86_64)
     OPTIMIZEVM += -mfpmath=sse
-    BASE_CFLAGS += -arch x86_64 -mmacosx-version-min=10.6 \
-      -DMAC_OS_X_VERSION_MIN_REQUIRED=1060
+    BASE_CFLAGS += -arch x86_64
+  endif
+  ifeq ($(ARCH),arm64)
+    BASE_CFLAGS += -arch arm64
   endif
 
   # When compiling on OSX for OSX, we're not cross compiling as far as the
@@ -509,26 +540,47 @@ ifeq ($(PLATFORM),darwin)
   endif
 
   ifeq ($(CROSS_COMPILING),1)
-    ifeq ($(ARCH),ppc)
-      CC=powerpc-apple-darwin10-gcc
-      RANLIB=powerpc-apple-darwin10-ranlib
-    else
-      ifeq ($(ARCH),x86)
-        CC=i686-apple-darwin10-gcc
-        RANLIB=i686-apple-darwin10-ranlib
-      else
-        $(error Architecture $(ARCH) is not supported when cross compiling)
+    # If CC is already set to something generic, we probably want to use
+    # something more specific
+    ifneq ($(findstring $(strip $(CC)),cc gcc),)
+      CC=
+    endif
+
+    ifndef CC
+      ifndef DARWIN
+        # macOS 10.5 SDK
+          DARWIN=9
+        ifeq ($(ARCH),arm64)
+          # macOS 11.0 SDK
+          DARWIN=20.1
+        endif
+      endif
+
+      CC=$(MACOSX_ARCH)-apple-darwin$(DARWIN)-cc
+      RANLIB=$(MACOSX_ARCH)-apple-darwin$(DARWIN)-ranlib
+      LIPO=$(MACOSX_ARCH)-apple-darwin$(DARWIN)-lipo
+
+      ifeq ($(call bin_path, $(CC)),)
+        $(error Unable to find osxcross $(CC))
       endif
     endif
   endif
 
+  ifndef LIPO
+    LIPO=lipo
+  endif
+
   BASE_CFLAGS += -fno-strict-aliasing -fno-common -pipe
 
   ifeq ($(USE_OPENAL),1)
+    ifneq ($(USE_LOCAL_HEADERS),1)
+      CLIENT_CFLAGS += -I/System/Library/Frameworks/OpenAL.framework/Headers
+    endif
     ifneq ($(USE_OPENAL_DLOPEN),1)
       ifneq ($(USE_INTERNAL_LIBS),1)
         CLIENT_CFLAGS += $(OPENAL_CFLAGS)
         CLIENT_LIBS += $(THREAD_LIBS) $(OPENAL_LIBS)
+        CLIENT_EXTRA_FILES += $(LIBSDIR)/macosx/libopenal.dylib
       else
         CLIENT_LIBS += -framework OpenAL
       endif
@@ -544,30 +596,28 @@ ifeq ($(PLATFORM),darwin)
 
   BASE_CFLAGS += -D_THREAD_SAFE=1
 
+  CLIENT_LIBS += -framework IOKit
+  RENDERER_LIBS += -framework OpenGL
+
   ifeq ($(USE_LOCAL_HEADERS),1)
+    # libSDL2-2.0.0.dylib for PPC is SDL 2.0.1 + changes to compile
     ifneq ($(findstring $(ARCH),ppc ppc64),)
-      CLIENT_CFLAGS += -I$(SDLHDIR)/include-2.0.1
+      BASE_CFLAGS += -I$(SDLHDIR)/include-2.0.1
     else
-      CLIENT_CFLAGS += -I$(SDLHDIR)/include
+      BASE_CFLAGS += -I$(SDLHDIR)/include
     endif
-  else
-    CLIENT_CFLAGS += $(SDL_CFLAGS)
-  endif
 
-  # We copy sdlmain before ranlib'ing it so that subversion doesn't think
-  #  the file has been modified by each build.
-  ifeq ($(USE_INTERNAL_LIBS),1)
+    # We copy sdlmain before ranlib'ing it so that subversion doesn't think
+    #  the file has been modified by each build.
     LIBSDLMAIN=$(B)/libSDL2main.a
     LIBSDLMAINSRC=$(LIBSDIR)/macosx/libSDL2main.a
-    CLIENT_LIBS += -framework IOKit $(LIBSDIR)/macosx/libSDL2-2.0.0.dylib
-    RENDERER_LIBS += -framework OpenGL $(LIBSDIR)/macosx/libSDL2-2.0.0.dylib
+    CLIENT_LIBS += $(LIBSDIR)/macosx/libSDL2-2.0.0.dylib
+    RENDERER_LIBS += $(LIBSDIR)/macosx/libSDL2-2.0.0.dylib
+    CLIENT_EXTRA_FILES += $(LIBSDIR)/macosx/libSDL2-2.0.0.dylib
   else
-    CLIENT_LIBS += -framework IOKit $(SDL_LIBS)
-    RENDERER_LIBS += -framework OpenGL $(SDL_LIBS)
-  endif
-
-  ifeq ($(USE_INTERNAL_LIBS),1)
-    CLIENT_EXTRA_FILES += $(LIBSDIR)/macosx/libSDL2-2.0.0.dylib $(LIBSDIR)/macosx/libopenal.dylib
+    BASE_CFLAGS += -I/Library/Frameworks/SDL2.framework/Headers
+    CLIENT_LIBS += -framework SDL2
+    RENDERER_LIBS += -framework SDL2
   endif
 
   OPTIMIZE = $(OPTIMIZEVM) -ffast-math
@@ -635,7 +685,7 @@ ifdef MINGW
   # using generic windres if specific one is not present
   ifndef WINDRES
     WINDRES=windres
-   endif
+  endif
 
   ifeq ($(CC),)
     $(error Cannot find a suitable cross compiler for $(PLATFORM))
@@ -670,6 +720,11 @@ ifdef MINGW
   SHLIBCFLAGS=
   SHLIBLDFLAGS=-shared $(LDFLAGS)
 
+  # clang 3.5 doesn't support this
+  ifneq ("$(CC)", $(findstring "$(CC)", "clang" "clang++"))
+    LDFLAGS += -mwindows -static -static-libgcc -static-libstdc++
+  endif
+
   BINEXT=.exe
 
   ifeq ($(CROSS_COMPILING),0)
@@ -678,14 +733,22 @@ ifdef MINGW
 
   ifeq ($(COMPILE_PLATFORM),cygwin)
     TOOLS_BINEXT=.exe
-    TOOLS_CC=$(CC)
+    
+    # Under cygwin the default of using gcc for TOOLS_CC won't work, so
+    # we need to figure out the appropriate compiler to use, based on the
+    # host architecture that we're running under (as tools run on the host)
+    ifeq ($(COMPILE_ARCH),x86_64)
+      TOOLS_MINGW_PREFIXES=x86_64-w64-mingw32 amd64-mingw32msvc
+    endif
+    ifeq ($(COMPILE_ARCH),x86)
+      TOOLS_MINGW_PREFIXES=i686-w64-mingw32 i586-mingw32msvc i686-pc-mingw32
+    endif
+
+    TOOLS_CC=$(firstword $(strip $(foreach TOOLS_MINGW_PREFIX, $(TOOLS_MINGW_PREFIXES), \
+      $(call bin_path, $(TOOLS_MINGW_PREFIX)-gcc))))
   endif
 
   LIBS= -lws2_32 -lwinmm -lpsapi
-  # clang 3.5 doesn't support this
-  ifneq ("$(CC)", $(findstring "$(CC)", "clang" "clang++"))
-    CLIENT_LDFLAGS += -mwindows -static -static-libgcc -static-libstdc++
-  endif
   CLIENT_LIBS = -lgdi32 -lole32
   RENDERER_LIBS = -lgdi32 -lole32
 
@@ -711,28 +774,25 @@ ifdef MINGW
     endif
   endif
 
+
   # libmingw32 must be linked before libSDLmain
   CLIENT_LIBS += -lmingw32
   RENDERER_LIBS += -lmingw32
 
   ifeq ($(USE_LOCAL_HEADERS),1)
     CLIENT_CFLAGS += -I$(SDLHDIR)/include
-  endif
-
-  ifeq ($(USE_INTERNAL_LIBS),1)
     ifeq ($(ARCH),x86)
     CLIENT_LIBS += $(LIBSDIR)/win32/libSDL2main.a \
-                   $(LIBSDIR)/win32/libSDL2.dll.a
+                      $(LIBSDIR)/win32/libSDL2.dll.a
     RENDERER_LIBS += $(LIBSDIR)/win32/libSDL2main.a \
-                     $(LIBSDIR)/win32/libSDL2.dll.a
+                      $(LIBSDIR)/win32/libSDL2.dll.a
     SDLDLL=SDL2.dll
     CLIENT_EXTRA_FILES += $(LIBSDIR)/win32/SDL2.dll $(LIBSDIR)/win32/OpenAL32.dll
-    endif
-    ifeq ($(ARCH),x86_64)
+    else
     CLIENT_LIBS += $(LIBSDIR)/win64/libSDL264main.a \
-                   $(LIBSDIR)/win64/libSDL264.dll.a
+                      $(LIBSDIR)/win64/libSDL264.dll.a
     RENDERER_LIBS += $(LIBSDIR)/win64/libSDL264main.a \
-                     $(LIBSDIR)/win64/libSDL264.dll.a
+                      $(LIBSDIR)/win64/libSDL264.dll.a
     SDLDLL=SDL264.dll
     CLIENT_EXTRA_FILES += $(LIBSDIR)/win64/SDL264.dll $(LIBSDIR)/win64/OpenAL64.dll
     endif
@@ -746,52 +806,112 @@ ifdef MINGW
 else # ifdef MINGW
 
 #############################################################################
-# SETUP AND BUILD -- *BSD (is dying)
+# SETUP AND BUILD -- FREEBSD
 #############################################################################
 
-ifneq (,$(findstring "$(PLATFORM)", "freebsd" "openbsd" "netbsd"))
+ifeq ($(PLATFORM),freebsd)
 
-  BASE_CFLAGS = -Wall -fno-strict-aliasing \
-    -pipe -DUSE_ICON -DMAP_ANONYMOUS=MAP_ANON
+  # flags
+  BASE_CFLAGS = \
+    -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \
+    -DUSE_ICON -DMAP_ANONYMOUS=MAP_ANON
   CLIENT_CFLAGS += $(SDL_CFLAGS)
 
-  OPTIMIZEVM = -O3
+  OPTIMIZEVM =
   OPTIMIZE = $(OPTIMIZEVM) -ffast-math
 
+  SHLIBEXT=so
+  SHLIBCFLAGS=-fPIC
+  SHLIBLDFLAGS=-shared $(LDFLAGS)
+
+  THREAD_LIBS=-lpthread
+  # don't need -ldl (FreeBSD)
+  LIBS=-lm
+
+  CLIENT_LIBS =
+
+  CLIENT_LIBS += $(SDL_LIBS)
+  RENDERER_LIBS = $(SDL_LIBS)
+
+  # optional features/libraries
+  ifeq ($(USE_OPENAL),1)
+    ifeq ($(USE_OPENAL_DLOPEN),1)
+      CLIENT_LIBS += $(THREAD_LIBS) $(OPENAL_LIBS)
+    endif
+  endif
+
+  ifeq ($(USE_CURL),1)
+    CLIENT_CFLAGS += $(CURL_CFLAGS)
+    ifeq ($(USE_CURL_DLOPEN),1)
+      CLIENT_LIBS += $(CURL_LIBS)
+    endif
+  endif
+
+  # cross-compiling tweaks
+  ifeq ($(ARCH),x86)
+    ifeq ($(CROSS_COMPILING),1)
+      BASE_CFLAGS += -m32
+    endif
+  endif
+  ifeq ($(ARCH),x86_64)
+    ifeq ($(CROSS_COMPILING),1)
+      BASE_CFLAGS += -m64
+    endif
+  endif
+else # ifeq freebsd
+
+#############################################################################
+# SETUP AND BUILD -- OPENBSD
+#############################################################################
+
+ifeq ($(PLATFORM),openbsd)
+
+  BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \
+    -pipe -DUSE_ICON -DMAP_ANONYMOUS=MAP_ANON
+  CLIENT_CFLAGS += $(SDL_CFLAGS)
+
   ifeq ($(ARCH),x86_64)
     OPTIMIZEVM = -O3
     OPTIMIZE = $(OPTIMIZEVM) -ffast-math
-    FILE_ARCH = amd64
-  endif
+  else
   ifeq ($(ARCH),x86)
     OPTIMIZEVM = -O3 -march=i586
     OPTIMIZE = $(OPTIMIZEVM) -ffast-math
-  endif
+  else
   ifeq ($(ARCH),ppc)
+    OPTIMIZEVM = -O3
+    OPTIMIZE = $(OPTIMIZEVM) -ffast-math
     ALTIVEC_CFLAGS = -maltivec
   endif
   ifeq ($(ARCH),ppc64)
+    OPTIMIZEVM = -O3
+    OPTIMIZE = $(OPTIMIZEVM) -ffast-math
     ALTIVEC_CFLAGS = -maltivec
   endif
   ifeq ($(ARCH),sparc)
-    OPTIMIZE += -mtune=ultrasparc3 -mv8plus
-    OPTIMIZEVM += -mtune=ultrasparc3 -mv8plus
+    OPTIMIZEVM += -mcpu=v9 -mtune=v9 -mv8plus
+    OPTIMIZE = $(OPTIMIZEVM) -ffast-math
   endif
   ifeq ($(ARCH),sparc64)
-    OPTIMIZE += -mtune=ultrasparc3 -mv8plus
-    OPTIMIZEVM += -mtune=ultrasparc3 -mv8plus
+    OPTIMIZEVM += -mcpu=v9 -mtune=v9 -mv8plus
+    OPTIMIZE = $(OPTIMIZEVM) -ffast-math
   endif
   ifeq ($(ARCH),alpha)
     # According to http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=410555
     # -ffast-math will cause the client to die with SIGFPE on Alpha
     OPTIMIZE = $(OPTIMIZEVM)
   endif
+  endif
+  endif
 
   ifeq ($(USE_CURL),1)
     CLIENT_CFLAGS += $(CURL_CFLAGS)
     USE_CURL_DLOPEN=0
   endif
 
+  # no shm_open on OpenBSD
+  USE_MUMBLE=0
+
   SHLIBEXT=so
   SHLIBCFLAGS=-fPIC
   SHLIBLDFLAGS=-shared $(LDFLAGS)
@@ -815,7 +935,28 @@ ifneq (,$(findstring "$(PLATFORM)", "freebsd" "openbsd" "netbsd"))
       CLIENT_LIBS += $(CURL_LIBS)
     endif
   endif
-else # ifeq *BSD
+else # ifeq openbsd
+
+#############################################################################
+# SETUP AND BUILD -- NETBSD
+#############################################################################
+
+ifeq ($(PLATFORM),netbsd)
+
+  LIBS=-lm
+  SHLIBEXT=so
+  SHLIBCFLAGS=-fPIC
+  SHLIBLDFLAGS=-shared $(LDFLAGS)
+  THREAD_LIBS=-lpthread
+
+  BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes
+
+  ifeq ($(ARCH),x86)
+    HAVE_VM_COMPILED=true
+  endif
+
+  BUILD_CLIENT = 0
+else # ifeq netbsd
 
 #############################################################################
 # SETUP AND BUILD -- IRIX
@@ -858,7 +999,9 @@ ifeq ($(PLATFORM),sunos)
 
   ifneq ($(ARCH),x86)
     ifneq ($(ARCH),sparc)
-      $(error arch $(ARCH) is currently not supported)
+      ifneq ($(ARCH),sparc64)
+        $(error arch $(ARCH) is currently not supported)
+      endif
     endif
   endif
 
@@ -866,19 +1009,23 @@ ifeq ($(PLATFORM),sunos)
     -pipe -DUSE_ICON
   CLIENT_CFLAGS += $(SDL_CFLAGS)
 
-  OPTIMIZEVM = -O3
-
   ifeq ($(ARCH),sparc)
-    OPTIMIZEVM += -O3 -mtune=ultrasparc3 -mv8plus -mno-faster-structs
+    OPTIMIZEVM += -mcpu=v9 -mtune=v9 -mv8plus
+    OPTIMIZE = $(OPTIMIZEVM) -ffast-math
+  endif
+  ifeq ($(ARCH),sparc64)
+    OPTIMIZEVM += -mcpu=v9 -mtune=v9 -mv8plus
+    OPTIMIZE = $(OPTIMIZEVM) -ffast-math
   endif
   ifeq ($(ARCH),x86)
-    OPTIMIZEVM += -march=i586
+    OPTIMIZEVM += -march=i586 -fomit-frame-pointer \
+      -falign-functions=2 -fstrength-reduce
+    OPTIMIZE = $(OPTIMIZEVM) -ffast-math
+    BASE_CFLAGS += -m32
     CLIENT_CFLAGS += -I/usr/X11/include/NVIDIA
     CLIENT_LDFLAGS += -L/usr/X11/lib/NVIDIA -R/usr/X11/lib/NVIDIA
   endif
 
-  OPTIMIZE = $(OPTIMIZEVM) -ffast-math
-
   SHLIBEXT=so
   SHLIBCFLAGS=-fPIC
   SHLIBLDFLAGS=-shared $(LDFLAGS)
@@ -896,7 +1043,7 @@ else # ifeq sunos
 #############################################################################
 # SETUP AND BUILD -- GENERIC
 #############################################################################
-  BASE_CFLAGS =
+  BASE_CFLAGS=
   OPTIMIZE = -O3
 
   SHLIBEXT=so
@@ -906,7 +1053,9 @@ else # ifeq sunos
 endif #Linux
 endif #darwin
 endif #MINGW
-endif #*BSD
+endif #FreeBSD
+endif #OpenBSD
+endif #NetBSD
 endif #IRIX
 endif #SunOS
 
@@ -945,11 +1094,7 @@ ifndef HAVE_VM_COMPILED
   HAVE_VM_COMPILED=false
 endif
 
-ifneq ($(findstring $(ARCH),x86 x86_64 ppc ppc64 sparc sparc64),)
-  HAVE_VM_COMPILED=true
-endif
-
-ifeq ($(ARM_VER_CHECK),armv7l)
+ifneq ($(filter $(ARCH),armv7l x86 x86_64 ppc sparc),)
   HAVE_VM_COMPILED=true
 endif
 
@@ -1046,7 +1191,7 @@ endif
 
 ifeq ($(NEED_OPUS),1)
   ifeq ($(USE_INTERNAL_OPUS),1)
-      OPUS_CFLAGS = -DOPUS_BUILD -DHAVE_LRINTF -DFLOAT_APPROX -DUSE_ALLOCA \
+    OPUS_CFLAGS = -DOPUS_BUILD -DHAVE_LRINTF -DFLOATING_POINT -DFLOAT_APPROX -DUSE_ALLOCA \
       -I$(OPUSDIR)/include -I$(OPUSDIR)/celt -I$(OPUSDIR)/silk \
       -I$(OPUSDIR)/silk/float -I$(OPUSFILEDIR)/include
   else
@@ -1108,7 +1253,7 @@ ifeq ($(USE_INTERNAL_JPEG),1)
   BASE_CFLAGS += -DUSE_INTERNAL_JPEG
   BASE_CFLAGS += -I$(JPDIR)
 else
-  # IJG libjpeg doesn't have $(PKG_CONFIG), but libjpeg-turbo uses libjpeg.pc;
+  # IJG libjpeg doesn't have pkg-config, but libjpeg-turbo uses libjpeg.pc;
   # we fall back to hard-coded answers if libjpeg.pc is unavailable
   JPEG_CFLAGS ?= $(shell $(PKG_CONFIG) --silence-errors --cflags libjpeg || true)
   JPEG_LIBS ?= $(shell $(PKG_CONFIG) --silence-errors --libs libjpeg || echo -ljpeg)
@@ -1216,9 +1361,7 @@ endef
 define DO_REF_STR
 $(echo_cmd) "REF_STR $<"
 $(Q)rm -f $@
-$(Q)echo "const char *fallbackShader_$(notdir $(basename $<)) =" >> $@
-$(Q)cat $< | sed -e 's/^/\"/;s/$$/\\n\"/' | tr -d '\r' >> $@
-$(Q)echo ";" >> $@
+$(Q)$(STRINGIFY) $< $@
 endef
 
 define DO_BOT_CC
@@ -1348,7 +1491,7 @@ targets: makedirs
 	@echo "  PKG_CONFIG: $(PKG_CONFIG)"
 	@echo "  CC: $(CC)"
 	@echo "  CXX: $(CXX)"
-ifdef MINGW
+ifeq ($(PLATFORM),mingw32)
 	@echo "  WINDRES: $(WINDRES)"
 endif
 	@echo ""
@@ -1361,10 +1504,20 @@ endif
 	@echo "  SERVER_CFLAGS:"
 	$(call print_wrapped, $(SERVER_CFLAGS))
 	@echo ""
+	@echo "  TOOLS_CFLAGS:"
+	$(call print_wrapped, $(TOOLS_CFLAGS))
+	@echo ""
 	@echo "  LDFLAGS:"
-ifneq ($(LDFLAGS),)
 	$(call print_wrapped, $(LDFLAGS))
-endif
+	@echo ""
+	@echo "  CLIENT_LDFLAGS:"
+	$(call print_wrapped, $(CLIENT_LDFLAGS))
+	@echo ""
+	@echo "  SERVER_LDFLAGS:"
+	$(call print_wrapped, $(SERVER_LDFLAGS))
+	@echo ""
+	@echo "  TOOLS_LDFLAGS:"
+	$(call print_wrapped, $(TOOLS_LDFLAGS))
 	@echo ""
 	@echo "  LIBS:"
 	$(call print_wrapped, $(LIBS))
@@ -1372,6 +1525,15 @@ endif
 	@echo "  CLIENT_LIBS:"
 	$(call print_wrapped, $(CLIENT_LIBS))
 	@echo ""
+	@echo "  RENDERER_LIBS:"
+	$(call print_wrapped, $(RENDERER_LIBS))
+	@echo ""
+	@echo "  TOOLS_LIBS:"
+	$(call print_wrapped, $(TOOLS_LIBS))
+	@echo ""
+	@echo "  SERVER_LIBS:"
+	$(call print_wrapped, $(SERVER_LIBS))
+	@echo ""
 	@echo "  Output:"
 	$(call print_list, $(NAKED_TARGETS))
 	@echo ""
@@ -1390,8 +1552,17 @@ else
 endif
 
 $(B).zip: $(TARGETS)
+ifeq ($(PLATFORM),darwin)
+  ifdef ARCHIVE
+	@("./make-macosx-app.sh" release $(ARCH); if [ "$$?" -eq 0 ] && [ -d "$(B)/iowolfmp.app" ]; then rm -f $@; cd $(B) && zip --symlinks -r9 ../../$@ `find "iowolfmp.app" -print | sed -e "s!$(B)/!!g"`; else rm -f $@; cd $(B) && zip -r9 ../../$@ $(NAKED_TARGETS); fi)
+  endif
+endif
+ifneq ($(PLATFORM),darwin)
+  ifdef ARCHIVE
 	@rm -f $@
 	@(cd $(B) && zip -r9 ../../$@ $(NAKED_TARGETS))
+  endif
+endif
 
 makedirs:
 	@$(MKDIR) $(B)/splines
@@ -1459,6 +1630,7 @@ Q3RCC       = $(B)/tools/q3rcc$(TOOLS_BINEXT)
 Q3CPP       = $(B)/tools/q3cpp$(TOOLS_BINEXT)
 Q3LCC       = $(B)/tools/q3lcc$(TOOLS_BINEXT)
 Q3ASM       = $(B)/tools/q3asm$(TOOLS_BINEXT)
+STRINGIFY   = $(B)/tools/stringify$(TOOLS_BINEXT)
 
 LBURGOBJ= \
   $(B)/tools/lburg/lburg.o \
@@ -1552,6 +1724,10 @@ $(Q3LCC): $(Q3LCCOBJ) $(Q3RCC) $(Q3CPP)
 	$(echo_cmd) "LD $@"
 	$(Q)$(TOOLS_CC) $(TOOLS_CFLAGS) $(TOOLS_LDFLAGS) -o $@ $(Q3LCCOBJ) $(TOOLS_LIBS)
 
+$(STRINGIFY): $(TOOLSDIR)/stringify.c
+	$(echo_cmd) "TOOLS_CC $@"
+	$(Q)$(TOOLS_CC) $(TOOLS_CFLAGS) $(TOOLS_LDFLAGS) -o $@ $(TOOLSDIR)/stringify.c $(TOOLS_LIBS)
+
 define DO_Q3LCC
 $(echo_cmd) "Q3LCC $<"
 $(Q)$(Q3LCC) $(BASEGAME_CFLAGS) -o $@ $<
@@ -2150,15 +2326,16 @@ endif
 
 ifeq ($(HAVE_VM_COMPILED),true)
   ifneq ($(findstring $(ARCH),x86 x86_64),)
-    Q3OBJ += $(B)/client/vm_x86.o
+    Q3OBJ += \
+      $(B)/client/vm_x86.o
   endif
-  ifneq ($(findstring $(ARCH),ppc ppc64),)
+  ifneq ($(findstring $(ARCH),ppc),)
     Q3OBJ += $(B)/client/vm_powerpc.o $(B)/client/vm_powerpc_asm.o
   endif
-  ifneq ($(findstring $(ARCH),sparc sparc64),)
+  ifneq ($(findstring $(ARCH),sparc),)
     Q3OBJ += $(B)/client/vm_sparc.o
   endif
-  ifeq ($(ARM_VER_CHECK),armv7l)
+  ifeq ($(ARCH),armv7l)
     Q3OBJ += $(B)/client/vm_armv7l.o
   endif
 endif
@@ -2215,7 +2392,11 @@ endif
 ifneq ($(strip $(LIBSDLMAIN)),)
 ifneq ($(strip $(LIBSDLMAINSRC)),)
 $(LIBSDLMAIN) : $(LIBSDLMAINSRC)
+ifeq ($(PLATFORM),darwin)
+	$(LIPO) -extract $(MACOSX_ARCH) $< -o $@
+else
 	cp $< $@
+endif
 	$(RANLIB) $@
 endif
 endif
@@ -2325,15 +2506,16 @@ endif
 
 ifeq ($(HAVE_VM_COMPILED),true)
   ifneq ($(findstring $(ARCH),x86 x86_64),)
-    Q3DOBJ += $(B)/ded/vm_x86.o
+    Q3DOBJ += \
+      $(B)/ded/vm_x86.o
   endif
-  ifneq ($(findstring $(ARCH),ppc ppc64),)
+  ifneq ($(findstring $(ARCH),ppc),)
     Q3DOBJ += $(B)/ded/vm_powerpc.o $(B)/ded/vm_powerpc_asm.o
   endif
-  ifneq ($(findstring $(ARCH),sparc sparc64),)
+  ifneq ($(findstring $(ARCH),sparc),)
     Q3DOBJ += $(B)/ded/vm_sparc.o
   endif
-  ifeq ($(ARM_VER_CHECK),armv7l)
+  ifeq ($(ARCH),armv7l)
     Q3DOBJ += $(B)/ded/vm_armv7l.o
   endif
 endif
@@ -2405,11 +2587,11 @@ Q3CGVMOBJ = $(Q3CGOBJ_:%.o=%.asm)
 ifdef MINGW
 $(B)/$(BASEGAME)/cgame_mp_$(SHLIBNAME): $(Q3CGOBJ)
 	$(echo_cmd) "LD $@"
-	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3CGOBJ)
+	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3CGOBJ) $(LIBS)
 else
 $(B)/$(BASEGAME)/cgame.mp.$(SHLIBNAME): $(Q3CGOBJ)
 	$(echo_cmd) "LD $@"
-	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3CGOBJ)
+	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3CGOBJ) $(LIBS)
 endif
 $(B)/$(BASEGAME)/vm/cgame.mp.qvm: $(Q3CGVMOBJ) $(CGDIR)/cg_syscalls.asm $(Q3ASM)
 	$(echo_cmd) "Q3ASM $@"
@@ -2480,11 +2662,11 @@ Q3GVMOBJ = $(Q3GOBJ_:%.o=%.asm)
 ifdef MINGW
 $(B)/$(BASEGAME)/qagame_mp_$(SHLIBNAME): $(Q3GOBJ)
 	$(echo_cmd) "LD $@"
-	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3GOBJ)
+	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3GOBJ) $(LIBS)
 else
 $(B)/$(BASEGAME)/qagame.mp.$(SHLIBNAME): $(Q3GOBJ)
 	$(echo_cmd) "LD $@"
-	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3GOBJ)
+	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3GOBJ) $(LIBS)
 endif
 $(B)/$(BASEGAME)/vm/qagame.mp.qvm: $(Q3GVMOBJ) $(GDIR)/g_syscalls.asm $(Q3ASM)
 	$(echo_cmd) "Q3ASM $@"
@@ -2514,11 +2696,11 @@ Q3UIVMOBJ = $(Q3UIOBJ_:%.o=%.asm)
 ifdef MINGW
 $(B)/$(BASEGAME)/ui_mp_$(SHLIBNAME): $(Q3UIOBJ)
 	$(echo_cmd) "LD $@"
-	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3UIOBJ)
+	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3UIOBJ) $(LIBS)
 else
 $(B)/$(BASEGAME)/ui.mp.$(SHLIBNAME): $(Q3UIOBJ)
 	$(echo_cmd) "LD $@"
-	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3UIOBJ)
+	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3UIOBJ) $(LIBS)
 endif
 $(B)/$(BASEGAME)/vm/ui.mp.qvm: $(Q3UIVMOBJ) $(UIDIR)/ui_syscalls.asm $(Q3ASM)
 	$(echo_cmd) "Q3ASM $@"
@@ -2605,7 +2787,7 @@ $(B)/renderer/%.o: $(RDIR)/%.c
 $(B)/renderer/tr_altivec.o: $(RDIR)/tr_altivec.c
 	$(DO_REF_CC_ALTIVEC)
 
-$(B)/rend2/glsl/%.c: $(R2DIR)/glsl/%.glsl
+$(B)/rend2/glsl/%.c: $(R2DIR)/glsl/%.glsl $(STRINGIFY)
 	$(DO_REF_STR)
 
 $(B)/rend2/glsl/%.o: $(B)/rend2/glsl/%.c
@@ -2717,6 +2899,14 @@ $(B)/ded/win_resource.o: $(SYSDIR)/win_resource.rc $(SYSDIR)/win_manifest.xml
 $(B)/ded/%.o: $(NDIR)/%.c
 	$(DO_DED_CC)
 
+# Extra dependencies to ensure the git version is incorporated
+ifeq ($(USE_GIT),1)
+  $(B)/client/cl_console.o : ../.git
+  $(B)/client/common.o : ../.git
+  $(B)/ded/common.o : ../.git
+endif
+
+
 #############################################################################
 ## GAME MODULE RULES
 #############################################################################
@@ -2768,6 +2958,7 @@ OBJ = $(Q3OBJ) $(Q3ROBJ) $(Q3R2OBJ) $(Q3DOBJ) $(JPGOBJ) $(FTOBJ) \
 TOOLSOBJ = $(LBURGOBJ) $(Q3CPPOBJ) $(Q3RCCOBJ) $(Q3LCCOBJ) $(Q3ASMOBJ)
 STRINGOBJ = $(Q3R2STRINGOBJ)
 
+
 copyfiles: release
 	@if [ ! -d $(COPYDIR)/$(BASEGAME) ]; then echo "You need to set COPYDIR to where your RTCW data is!"; fi
 ifneq ($(BUILD_GAME_SO),0)
@@ -2834,7 +3025,7 @@ toolsclean2:
 	@echo "TOOLS_CLEAN $(B)"
 	@rm -f $(TOOLSOBJ)
 	@rm -f $(TOOLSOBJ_D_FILES)
-	@rm -f $(LBURG) $(DAGCHECK_C) $(Q3RCC) $(Q3CPP) $(Q3LCC) $(Q3ASM)
+	@rm -f $(LBURG) $(DAGCHECK_C) $(Q3RCC) $(Q3CPP) $(Q3LCC) $(Q3ASM) $(STRINGIFY)
 
 distclean: clean toolsclean
 	@rm -rf $(BUILD_DIR)
diff --git a/MP/code/asm/vm_x86_64.asm b/MP/code/asm/vm_x86_64.asm
index 87e04f4..f84eb8f 100644
--- a/MP/code/asm/vm_x86_64.asm
+++ b/MP/code/asm/vm_x86_64.asm
@@ -28,13 +28,35 @@
 ; Call to compiled code after setting up the register environment for the VM
 ; prototype:
 ; uint8_t qvmcall64(int *programStack, int *opStack, intptr_t *instructionPointers, byte *dataBase);
+;
+; This call-stub has its own custom calling convention due to pushing all non-volatile registers
+; to the stack. The game uses set/longjmp which on Windows uses "RtlUnwindEx" to unwind the callstack.
+; This function cannot be unwound by default due to the custom calling convention.
+; To allow unwinding, we need to add custom SEH unwind data to the function.
 
-qvmcall64 PROC
-  push rsi							; push non-volatile registers to stack
+qvmcall64 PROC FRAME
+  push r12							; push all non-volatile registers to stack
+  .pushreg r12
+  push r13
+  .pushreg r13
+  push r14
+  .pushreg r14
+  push r15
+  .pushreg r15
   push rdi
+  .pushreg rdi
+  push rsi
+  .pushreg rsi
   push rbx
+  .pushreg rbx
+  push rbp
+  .pushreg rbp
+  
   ; need to save pointer in rcx so we can write back the programData value to caller
   push rcx
+  .pushreg rcx
+  
+  .endprolog						; custom unwind data ends here
 
   ; registers r8 and r9 have correct value already thanx to __fastcall
   xor rbx, rbx						; opStackOfs starts out being 0
@@ -48,9 +70,14 @@ qvmcall64 PROC
   mov dword ptr [rcx], esi			; write back the programStack value
   mov al, bl						; return opStack offset
 
+  pop rbp							; restore all non-volatile registers after the call
   pop rbx
-  pop rdi
   pop rsi
+  pop rdi
+  pop r15
+  pop r14
+  pop r13
+  pop r12
   
   ret
 qvmcall64 ENDP
diff --git a/MP/code/botlib/be_ai_goal.c b/MP/code/botlib/be_ai_goal.c
index 4e90b8e..fce39a7 100644
--- a/MP/code/botlib/be_ai_goal.c
+++ b/MP/code/botlib/be_ai_goal.c
@@ -641,8 +641,7 @@ void BotGoalName( int number, char *name, int size ) {
 	for ( li = levelitems; li; li = li->next )
 	{
 		if ( li->number == number ) {
-			strncpy( name, itemconfig->iteminfo[li->iteminfo].name, size - 1 );
-			name[size - 1] = '\0';
+			Q_strncpyz( name, itemconfig->iteminfo[li->iteminfo].name, size );
 			return;
 		} //end for
 	} //end for
diff --git a/MP/code/cgame/cg_weapons.c b/MP/code/cgame/cg_weapons.c
index 79a1f82..c6a2914 100644
--- a/MP/code/cgame/cg_weapons.c
+++ b/MP/code/cgame/cg_weapons.c
@@ -2412,6 +2412,26 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent
 	// Ridah
 	firing = ( ( cent->currentState.eFlags & EF_FIRING ) != 0 );
 
+	// Prevent firing flamethrower and tesla in noclip or when leaning or when underwater
+	if ( ps && firing && (weaponNum == WP_TESLA || weaponNum == WP_FLAMETHROWER) )
+	{
+		vec3_t point;
+		int cont = 0;
+		VectorCopy (ps->origin, point);	// crashes here
+		point[2] += ps->viewheight;
+		cont = trap_CM_PointContents( point, 0 );
+	
+		// player is in noclip mode - no fire
+		if ( ps->pm_type == PM_NOCLIP )
+			firing = qfalse;
+		// player is leaning - no fire
+		if ( ps->leanf != 0 )
+			firing = qfalse;
+		// player is underwater - no fire
+		if ( cont & CONTENTS_WATER )
+			firing = qfalse;
+	}
+
 	CG_PositionEntityOnTag( &gun, parent, "tag_weapon", 0, NULL );
 
 	playerScaled = (qboolean)( cgs.clientinfo[ cent->currentState.clientNum ].playermodelScale[0] != 0 );
@@ -2547,7 +2567,7 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent
 
 
 	// make sure we aren't looking at cg.predictedPlayerEntity for LG
-	nonPredictedCent = &cg_entities[cent->currentState.clientNum];
+	nonPredictedCent = &cg_entities[cent->currentState.number];
 
 	// if the index of the nonPredictedCent is not the same as the clientNum
 	// then this is a fake player (like on the single player podiums), so
diff --git a/MP/code/client/cl_main.c b/MP/code/client/cl_main.c
index 41b69b8..b7e6c3c 100644
--- a/MP/code/client/cl_main.c
+++ b/MP/code/client/cl_main.c
@@ -3441,8 +3441,10 @@ static __attribute__ ((format (printf, 2, 3))) void QDECL CL_RefPrintf( int prin
 		Com_Printf( "%s", msg );
 	} else if ( print_level == PRINT_WARNING ) {
 		Com_Printf( S_COLOR_YELLOW "%s", msg );		// yellow
+	} else if ( print_level == PRINT_ERROR ) {
+		Com_Printf (S_COLOR_RED "%s", msg);		// red
 	} else if ( print_level == PRINT_DEVELOPER ) {
-		Com_DPrintf( S_COLOR_RED "%s", msg );		// red
+		Com_DPrintf( S_COLOR_RED "%s", msg );		// red - developer only
 	}
 }
 
@@ -5393,12 +5395,12 @@ static trans_t* AllocTrans( char *original, char *translated[MAX_LANGUAGES] ) {
 	memset( t, 0, sizeof( trans_t ) );
 
 	if ( original ) {
-		strncpy( t->original, original, MAX_TRANS_STRING );
+		Q_strncpyz( t->original, original, MAX_TRANS_STRING );
 	}
 
 	if ( translated ) {
 		for ( i = 0; i < MAX_LANGUAGES; i++ )
-			strncpy( t->translated[i], translated[i], MAX_TRANS_STRING );
+			Q_strncpyz( t->translated[i], translated[i], MAX_TRANS_STRING );
 	}
 
 	return t;
@@ -5757,7 +5759,7 @@ void CL_LoadTransTable( const char *fileName ) {
 			t->fromFile = qtrue;
 
 			for ( i = 0; i < MAX_LANGUAGES; i++ )
-				strncpy( t->translated[i], translated[i], MAX_TRANS_STRING );
+				Q_strncpyz( t->translated[i], translated[i], MAX_TRANS_STRING );
 		}
 
 		token = COM_Parse( &text_p );
diff --git a/MP/code/client/snd_mix.c b/MP/code/client/snd_mix.c
index 31ed5a3..c6910fd 100644
--- a/MP/code/client/snd_mix.c
+++ b/MP/code/client/snd_mix.c
@@ -175,7 +175,7 @@ void S_TransferPaintBuffer(int endtime)
 	{	// general case
 		p = (int *) paintbuffer;
 		count = (endtime - s_paintedtime) * dma.channels;
-		out_idx = (s_paintedtime * dma.channels) % dma.samples;
+		out_idx = ((unsigned int)s_paintedtime * dma.channels) % dma.samples;
 		step = 3 - MIN(dma.channels, 2);
 
 		if ((dma.isfloat) && (dma.samplebits == 32))
@@ -197,6 +197,7 @@ void S_TransferPaintBuffer(int endtime)
 				else if (val < -32767)  /* clamp to one less than max to make division max out at -1.0f. */
 					val = -32767;
 				out[out_idx] = ((float) val) / 32767.0f;
+				out_idx = (out_idx + 1) % dma.samples;
 			}
 		}
 		else if (dma.samplebits == 16)
@@ -550,7 +551,7 @@ void S_PaintChannels( int endtime ) {
 		// paint in the channels.
 		ch = s_channels;
 		for ( i = 0; i < MAX_CHANNELS ; i++, ch++ ) {		
-			if ( !ch->thesfx || (ch->leftvol<0.25 && ch->rightvol<0.25 )) {
+			if ( ch->startSample == START_SAMPLE_IMMEDIATE || !ch->thesfx || (ch->leftvol<0.25 && ch->rightvol<0.25 )) {
 				continue;
 			}
 
diff --git a/MP/code/game/ai_dmq3.c b/MP/code/game/ai_dmq3.c
index c1dadd0..8d9b52e 100644
--- a/MP/code/game/ai_dmq3.c
+++ b/MP/code/game/ai_dmq3.c
@@ -1990,7 +1990,7 @@ void BotMapScripts( bot_state_t *bs ) {
 						if ( BotSameTeam( bs, i ) ) {
 							shootbutton = qfalse;
 							break;
-						} else if (bs->enemy == i) {
+						} else if (gametype < GT_CTF || bs->enemy == i) {
 							shootbutton = qtrue;
 						}
 					}
diff --git a/MP/code/game/g_cmds.c b/MP/code/game/g_cmds.c
index 5609f31..082b2a8 100644
--- a/MP/code/game/g_cmds.c
+++ b/MP/code/game/g_cmds.c
@@ -1904,6 +1904,22 @@ void Cmd_Activate_f( gentity_t *ent ) {
 		return;
 	}
 
+	traceEnt = &g_entities[ tr.entityNum ];
+
+	if ( traceEnt->classname && Q_stricmp( traceEnt->classname, "trigger_hurt" ) == 0 ) {
+		// ignore trigger_hurt so it's possible to pickup chalice (-1472 -3472 284) at the end of map crypt2
+		trap_Trace( &tr, tr.endpos, NULL, NULL, end, tr.entityNum, ( CONTENTS_SOLID | CONTENTS_BODY | CONTENTS_CORPSE | CONTENTS_TRIGGER ) );
+
+		// muzzle and trigger_hurt are in player bbox?
+		if ( tr.entityNum == ent->s.number ) {
+			return;
+		}
+	}
+
+	if ( tr.surfaceFlags & SURF_NOIMPACT ) {
+		return;
+	}
+
 	if ( tr.entityNum == ENTITYNUM_WORLD ) {
 		return;
 	}
diff --git a/MP/code/game/g_main.c b/MP/code/game/g_main.c
index ecd67bb..f76a724 100644
--- a/MP/code/game/g_main.c
+++ b/MP/code/game/g_main.c
@@ -493,6 +493,19 @@ void G_CheckForCursorHints( gentity_t *ent ) {
 	trap_Trace( tr, offset, NULL, NULL, end, ps->clientNum, trace_contents );
 	// dhm - end
 
+	traceEnt = &g_entities[tr->entityNum];
+
+	if ( traceEnt->classname && Q_stricmp( traceEnt->classname, "trigger_hurt" ) == 0 ) {
+		// ignore trigger_hurt so it's possible to pickup chalice (-1472 -3472 284) at the end of map crypt2
+		trap_Trace( tr, tr->endpos, NULL, NULL, end, tr->entityNum, trace_contents );
+
+		// muzzle and trigger_hurt are in player bbox?
+		if ( tr->entityNum == ps->clientNum ) {
+			tr->entityNum = ENTITYNUM_NONE;
+			tr->fraction = 1;
+		}
+	}
+
 	// reset all
 	hintType    = ps->serverCursorHint      = HINT_NONE;
 	hintVal     = ps->serverCursorHintVal   = 0;
@@ -713,6 +726,7 @@ void G_CheckForCursorHints( gentity_t *ent ) {
 			} else if ( checkEnt->s.eType == ET_ALARMBOX )      {
 				if ( checkEnt->health > 0 ) {
 //					hintDist	= CH_BREAKABLE_DIST;
+					hintDist	= CH_ACTIVATE_DIST;
 					hintType    = HINT_ACTIVATE;
 				}
 			} else if ( checkEnt->s.eType == ET_ITEM )      {
diff --git a/MP/code/qcommon/common.c b/MP/code/qcommon/common.c
index 8806f8c..f0b00b1 100644
--- a/MP/code/qcommon/common.c
+++ b/MP/code/qcommon/common.c
@@ -2500,7 +2500,7 @@ void Com_ReadCDKey( const char *filename ) {
 
 	FS_SV_FOpenFileRead( fbuffer, &f );
 	if ( !f ) {
-		Q_strncpyz( cl_cdkey, "                ", 17 );
+		Com_Memset( cl_cdkey, '\0', 17 );
 		return;
 	}
 
@@ -2512,7 +2512,7 @@ void Com_ReadCDKey( const char *filename ) {
 	if ( CL_CDKeyValidate( buffer, NULL ) ) {
 		Q_strncpyz( cl_cdkey, buffer, 17 );
 	} else {
-		Q_strncpyz( cl_cdkey, "                ", 17 );
+		Com_Memset( cl_cdkey, '\0', 17 );
 	}
 }
 
@@ -2530,7 +2530,7 @@ void Com_AppendCDKey( const char *filename ) {
 
 	FS_SV_FOpenFileRead( fbuffer, &f );
 	if ( !f ) {
-		Q_strncpyz( &cl_cdkey[16], "                ", 17 );
+		Com_Memset( &cl_cdkey[16], '\0', 17 );
 		return;
 	}
 
@@ -2542,7 +2542,7 @@ void Com_AppendCDKey( const char *filename ) {
 	if ( CL_CDKeyValidate( buffer, NULL ) ) {
 		strcat( &cl_cdkey[16], buffer );
 	} else {
-		Q_strncpyz( &cl_cdkey[16], "                ", 17 );
+		Com_Memset( &cl_cdkey[16], '\0', 17 );
 	}
 }
 
diff --git a/MP/code/qcommon/files.c b/MP/code/qcommon/files.c
index 7460b4d..1e5e946 100644
--- a/MP/code/qcommon/files.c
+++ b/MP/code/qcommon/files.c
@@ -3229,27 +3229,26 @@ void FS_AddGameDirectory( const char *path, const char *dir, qboolean allowUnzip
 		numfiles = MAX_PAKFILES;
 	}
 	for ( i = 0 ; i < numfiles ; i++ ) {
-		sorted[i] = pakfiles[i];
-// JPW NERVE KLUDGE: sorry, temp mod mp_* to _p_* so "mp_pak*" gets alphabetically sorted before "pak*"
+		if ( pakfiles ) {
+			sorted[i] = pakfiles[i];
 
-		if ( !Q_strncmp( sorted[i],"mp_",3 ) ) {
-			memcpy( sorted[i],"zz",2 );
+			// JPW NERVE KLUDGE: sorry, temp mod mp_* to _p_* so "mp_pak*" gets alphabetically sorted before "pak*"
+			if ( !Q_strncmp( sorted[i],"mp_",3 ) ) {
+				memcpy( sorted[i],"zz",2 );
+			}
+			// jpw
 		}
-
-// jpw
 	}
 
 	qsort( sorted, numfiles, sizeof(char*), paksort );
 
 	for ( i = 0 ; i < numfiles ; i++ ) {
 		if ( Q_strncmp( sorted[i],"sp_",3 ) ) { // JPW NERVE -- exclude sp_*
-// JPW NERVE KLUDGE: fix filenames broken in mp/sp/pak sort above
-
+			// JPW NERVE KLUDGE: fix filenames broken in mp/sp/pak sort above
 			if ( !Q_strncmp( sorted[i],"zz_",3 ) ) {
 				memcpy( sorted[i],"mp",2 );
 			}
-
-// jpw
+			// jpw
 			pakfile = FS_BuildOSPath( path, dir, sorted[i] );
 			if ( ( pak = FS_LoadZipFile( pakfile, sorted[i] ) ) == 0 ) {
 				continue;
diff --git a/MP/code/qcommon/q_platform.h b/MP/code/qcommon/q_platform.h
index f832c2b..ad197b0 100644
--- a/MP/code/qcommon/q_platform.h
+++ b/MP/code/qcommon/q_platform.h
@@ -156,6 +156,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #define idx64 1
 #define ARCH_STRING "x86_64"
 #define Q3_LITTLE_ENDIAN
+#elif defined __aarch64__
+#define ARCH_STRING "arm64"
+#define Q3_LITTLE_ENDIAN
 #endif
 
 #define DLL_EXT ".dylib"
@@ -229,6 +232,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #define ARCH_STRING "amd64"
 #elif defined __axp__
 #define ARCH_STRING "alpha"
+#elif defined __powerpc64__
+#define ARCH_STRING "powerpc64"
+#elif defined __powerpc__
+#define ARCH_STRING "powerpc"
+#elif defined __riscv
+#define ARCH_STRING "riscv64"
 #endif
 
 #if BYTE_ORDER == BIG_ENDIAN
diff --git a/MP/code/qcommon/q_shared.c b/MP/code/qcommon/q_shared.c
index 28d7513..ad962bd 100644
--- a/MP/code/qcommon/q_shared.c
+++ b/MP/code/qcommon/q_shared.c
@@ -140,6 +140,11 @@ void COM_StripExtension2( const char *in, char *out, int destsize ) {
 	*out = 0;
 }
 
+/*
+============
+COM_StripFilename
+============
+*/
 void COM_StripFilename( char *in, char *out ) {
 	char *end;
 	Q_strncpyz( out, in, strlen( in ) );
diff --git a/MP/code/qcommon/q_shared.h b/MP/code/qcommon/q_shared.h
index 7658fdf..97bc654 100644
--- a/MP/code/qcommon/q_shared.h
+++ b/MP/code/qcommon/q_shared.h
@@ -88,7 +88,7 @@ If you have questions concerning this license or the applicable additional terms
 #define LEGACY_HEARTBEAT_FOR_MASTER	"Wolfenstein-1"
 
 #ifndef PRODUCT_VERSION
-  #define PRODUCT_VERSION "1.51c-MP"
+  #define PRODUCT_VERSION "1.51d-MP"
 #endif
 
 #ifndef OLD_PRODUCT_VERSION
@@ -416,6 +416,8 @@ typedef vec_t vec3_t[3];
 typedef vec_t vec4_t[4];
 typedef vec_t vec5_t[5];
 
+typedef vec_t quat_t[4];
+
 typedef int fixed4_t;
 typedef int fixed8_t;
 typedef int fixed16_t;
@@ -643,6 +645,8 @@ typedef struct {
 
 #define Byte4Copy(a,b)			((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2],(b)[3]=(a)[3])
 
+#define QuatCopy(a,b)			((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2],(b)[3]=(a)[3])
+
 #define SnapVector( v ) {v[0] = ( (int)( v[0] ) ); v[1] = ( (int)( v[1] ) ); v[2] = ( (int)( v[2] ) );}
 
 // just in case you don't want to use the macros
diff --git a/MP/code/qcommon/qcommon.h b/MP/code/qcommon/qcommon.h
index a677f94..d4be796 100644
--- a/MP/code/qcommon/qcommon.h
+++ b/MP/code/qcommon/qcommon.h
@@ -413,6 +413,8 @@ typedef enum {
 	TRAP_TESTPRINTFLOAT
 } sharedTraps_t;
 
+typedef intptr_t (QDECL *vmMainProc)(intptr_t callNum, intptr_t arg0, intptr_t arg1, intptr_t arg2, intptr_t arg3, intptr_t arg4, intptr_t arg5, intptr_t arg6, intptr_t arg7, intptr_t arg8, intptr_t arg9, intptr_t arg10, intptr_t arg11);
+
 void    VM_Init( void );
 vm_t	*VM_Create( const char *module, intptr_t (*systemCalls)(intptr_t *),
 					vmInterpret_t interpret );
@@ -1202,7 +1204,7 @@ void Sys_LeaveCriticalSection( void *ptr );
 
 // FIXME: wants win32 implementation
 char* Sys_GetDLLName( const char *name );
-void	* QDECL Sys_LoadGameDll( const char *name, intptr_t (QDECL **entryPoint)(intptr_t, ...),
+void	* QDECL Sys_LoadGameDll( const char *name, vmMainProc *entryPoint,
 				  intptr_t (QDECL *systemcalls)(intptr_t, ...) );
 void    Sys_UnloadDll( void *dllHandle );
 
diff --git a/MP/code/qcommon/vm_local.h b/MP/code/qcommon/vm_local.h
index 4e9dab9..8a8d91d 100644
--- a/MP/code/qcommon/vm_local.h
+++ b/MP/code/qcommon/vm_local.h
@@ -154,7 +154,7 @@ struct vm_s {
 
 	// for dynamic linked modules
 	void		*dllHandle;
-	intptr_t			(QDECL *entryPoint)( intptr_t callNum, ... );
+	vmMainProc	entryPoint;
 	void (*destroy)(vm_t* self);
 
 	// for interpreted modules
diff --git a/MP/code/rend2/glsl/lightall_fp.glsl b/MP/code/rend2/glsl/lightall_fp.glsl
index 443aff1..28b59eb 100644
--- a/MP/code/rend2/glsl/lightall_fp.glsl
+++ b/MP/code/rend2/glsl/lightall_fp.glsl
@@ -89,6 +89,9 @@ float RayIntersectDisplaceMap(vec2 dp, vec2 ds, sampler2D normalMap)
 	// current size of search window
 	float size = 1.0 / float(linearSearchSteps);
 
+	// adjust position if offset above surface
+	dp -= ds * r_parallaxMapOffset;
+
 	// current depth position
 	float depth = 0.0;
 
@@ -141,7 +144,7 @@ float RayIntersectDisplaceMap(vec2 dp, vec2 ds, sampler2D normalMap)
 	}
 #endif
 
-	return bestDepth;
+	return bestDepth - r_parallaxMapOffset;
 }
 
 float LightRay(vec2 dp, vec2 ds, sampler2D normalMap)
@@ -201,7 +204,7 @@ vec3 CalcSpecular(vec3 specular, float NH, float EH, float roughness)
 	float rr = roughness*roughness;
 	float rrrr = rr*rr;
 	float d = (NH * NH) * (rrrr - 1.0) + 1.0;
-	float v = (EH * EH) * (roughness + 0.5);
+	float v = (EH * EH) * (roughness + 0.5) + EPSILON;
 	return specular * (rrrr / (4.0 * d * d * v));
 }
 
@@ -222,7 +225,7 @@ float CalcLightAttenuation(float point, float normDist)
 	return attenuation;
 }
 
-#if defined(USE_BOX_CUBEMAP_PARALLAX) && __VERSION__ >= 130
+#if defined(USE_BOX_CUBEMAP_PARALLAX)
 vec4 hitCube(vec3 ray, vec3 pos, vec3 invSize, float lod, samplerCube tex)
 {
 	// find any hits on cubemap faces facing the camera
@@ -261,7 +264,8 @@ void main()
 	float NL, NH, NE, EH, attenuation;
 
 #if defined(USE_LIGHT) && !defined(USE_FAST_LIGHT)
-	mat3 tangentToWorld = mat3(var_Tangent.xyz, var_Bitangent.xyz, var_Normal.xyz);
+	vec3 surfNormal = (!gl_FrontFacing ? var_Normal : -var_Normal).xyz;
+	mat3 tangentToWorld = mat3(var_Tangent.xyz, var_Bitangent.xyz, surfNormal);
 	viewDir = vec3(var_Normal.w, var_Tangent.w, var_Bitangent.w);
 	E = normalize(viewDir);
 #endif
@@ -332,7 +336,7 @@ void main()
 	N.z = sqrt(clamp((0.25 - N.x * N.x) - N.y * N.y, 0.0, 1.0));
 	N = tangentToWorld * N;
   #else
-	N = var_Normal.xyz;
+	N = surfNormal;
   #endif
 
 	N = normalize(N);
@@ -358,7 +362,7 @@ void main()
 
   #if !defined(USE_LIGHT_VECTOR)
 	ambientColor = lightColor;
-	float surfNL = clamp(dot(var_Normal.xyz, L), 0.0, 1.0);
+	float surfNL = clamp(dot(surfNormal, L), 0.0, 1.0);
 
 	// reserve 25% ambient to avoid black areas on normalmaps
 	lightColor *= 0.75;
diff --git a/MP/code/rend2/tr_glsl.c b/MP/code/rend2/tr_glsl.c
index c65cc9f..6e05934 100644
--- a/MP/code/rend2/tr_glsl.c
+++ b/MP/code/rend2/tr_glsl.c
@@ -1143,6 +1143,8 @@ void GLSL_InitGPUShaders(void)
 
 					if (r_parallaxMapShadows->integer)
 						Q_strcat(extradefines, 1024, "#define USE_PARALLAXMAP_SHADOWS\n");
+
+					Q_strcat(extradefines, 1024, va("#define r_parallaxMapOffset %f\n", r_parallaxMapOffset->value));
 				}
 			}
 
diff --git a/MP/code/rend2/tr_image.c b/MP/code/rend2/tr_image.c
index c1eca66..df5abbe 100644
--- a/MP/code/rend2/tr_image.c
+++ b/MP/code/rend2/tr_image.c
@@ -1781,7 +1781,9 @@ static GLenum RawImage_GetFormat(const byte *data, int numPixels, GLenum picForm
 	}
 	else if(lightMap)
 	{
-		if(r_greyscale->integer)
+		// GL_LUMINANCE is not valid for OpenGL 3.2 Core context and
+		// everything becomes solid black
+		if(0 && r_greyscale->integer)
 			internalFormat = GL_LUMINANCE;
 		else
 			internalFormat = GL_RGBA;
@@ -1796,7 +1798,7 @@ static GLenum RawImage_GetFormat(const byte *data, int numPixels, GLenum picForm
 		// select proper internal format
 		if ( samples == 3 )
 		{
-			if(r_greyscale->integer)
+			if(0 && r_greyscale->integer)
 			{
 				if(r_texturebits->integer == 16 || r_texturebits->integer == 32)
 					internalFormat = GL_LUMINANCE8;
@@ -1833,7 +1835,7 @@ static GLenum RawImage_GetFormat(const byte *data, int numPixels, GLenum picForm
 		}
 		else if ( samples == 4 )
 		{
-			if(r_greyscale->integer)
+			if(0 && r_greyscale->integer)
 			{
 				if(r_texturebits->integer == 16 || r_texturebits->integer == 32)
 					internalFormat = GL_LUMINANCE8_ALPHA8;
@@ -2289,7 +2291,9 @@ image_t *R_CreateImage2( const char *name, byte *pic, int width, int height, GLe
 		case GL_DEPTH_COMPONENT32_ARB:
 			// Fix for sampling depth buffer on old nVidia cards.
 			// from http://www.idevgames.com/forums/thread-4141-post-34844.html#pid34844
-			qglTextureParameterfEXT(image->texnum, textureTarget, GL_DEPTH_TEXTURE_MODE, GL_LUMINANCE);
+			if ( !QGL_VERSION_ATLEAST( 3, 0 ) ) {
+				qglTextureParameterfEXT(image->texnum, textureTarget, GL_DEPTH_TEXTURE_MODE, GL_LUMINANCE);
+			}
 			qglTextureParameterfEXT(image->texnum, textureTarget, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
 			qglTextureParameterfEXT(image->texnum, textureTarget, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
 			break;
diff --git a/MP/code/rend2/tr_init.c b/MP/code/rend2/tr_init.c
index a7bff64..9a3de72 100644
--- a/MP/code/rend2/tr_init.c
+++ b/MP/code/rend2/tr_init.c
@@ -37,6 +37,7 @@ glRefConfig_t glRefConfig;
 qboolean    textureFilterAnisotropic = qfalse;
 int         maxAnisotropy = 0;
 float       displayAspect = 0.0f;
+qboolean    haveClampToEdge = qfalse;
 
 glstate_t glState;
 
@@ -150,6 +151,7 @@ cvar_t  *r_normalMapping;
 cvar_t  *r_specularMapping;
 cvar_t  *r_deluxeMapping;
 cvar_t  *r_parallaxMapping;
+cvar_t  *r_parallaxMapOffset;
 cvar_t  *r_parallaxMapShadows;
 cvar_t  *r_cubeMapping;
 cvar_t  *r_cubemapSize;
@@ -360,6 +362,12 @@ static void InitOpenGL( void ) {
 		}
 	}
 
+	// check for GLSL function textureCubeLod()
+	if ( r_cubeMapping->integer && !QGL_VERSION_ATLEAST( 3, 0 ) ) {
+		ri.Printf( PRINT_WARNING, "WARNING: Disabled r_cubeMapping because it requires OpenGL 3.0\n" );
+		ri.Cvar_Set( "r_cubeMapping", "0" );
+	}
+
 	// set default state
 	GL_SetDefaultState();
 }
@@ -1125,31 +1133,16 @@ Workaround for ri.Printf's 1024 characters buffer limit.
 */
 void R_PrintLongString(const char *string) {
 	char buffer[1024];
-	const char *p = string;
-	int remainingLength = strlen(string);
+	const char *p;
+	int size = strlen(string);
 
-	while (remainingLength > 0)
+	p = string;
+	while(size > 0)
 	{
-		// Take as much characters as possible from the string without splitting words between buffers
-		// This avoids the client console splitting a word up when one half fits on the current line,
-		// but the second half would have to be written on a new line
-		int charsToTake = sizeof(buffer) - 1;
-		if (remainingLength > charsToTake) {
-			while (p[charsToTake - 1] > ' ' && p[charsToTake] > ' ') {
-				charsToTake--;
-				if (charsToTake == 0) {
-					charsToTake = sizeof(buffer) - 1;
-					break;
-				}
-			}
-		} else if (remainingLength < charsToTake) {
-			charsToTake = remainingLength;
-		}
-
-		Q_strncpyz( buffer, p, charsToTake + 1 );
+		Q_strncpyz(buffer, p, sizeof (buffer) );
 		ri.Printf( PRINT_ALL, "%s", buffer );
-		remainingLength -= charsToTake;
-		p += charsToTake;
+		p += 1023;
+		size -= 1023;
 	}
 }
 
@@ -1174,6 +1167,7 @@ void GfxInfo_f( void ) {
 	ri.Printf( PRINT_ALL, "GL_RENDERER: %s\n", glConfig.renderer_string );
 	ri.Printf( PRINT_ALL, "GL_VERSION: %s\n", glConfig.version_string );
 	ri.Printf( PRINT_ALL, "GL_EXTENSIONS: " );
+	// glConfig.extensions_string is a limited length so get the full list directly
 	if ( qglGetStringi )
 	{
 		GLint numExtensions;
@@ -1187,7 +1181,7 @@ void GfxInfo_f( void ) {
 	}
 	else
 	{
-		R_PrintLongString( glConfig.extensions_string );
+		R_PrintLongString( (char *) qglGetString( GL_EXTENSIONS ) );
 	}
 	ri.Printf( PRINT_ALL, "\n" );
 	ri.Printf( PRINT_ALL, "GL_MAX_TEXTURE_SIZE: %d\n", glConfig.maxTextureSize );
@@ -1383,6 +1377,7 @@ void R_Register( void ) {
 	r_specularMapping = ri.Cvar_Get( "r_specularMapping", "1", CVAR_ARCHIVE | CVAR_LATCH );
 	r_deluxeMapping = ri.Cvar_Get( "r_deluxeMapping", "1", CVAR_ARCHIVE | CVAR_LATCH );
 	r_parallaxMapping = ri.Cvar_Get( "r_parallaxMapping", "0", CVAR_ARCHIVE | CVAR_LATCH );
+	r_parallaxMapOffset = ri.Cvar_Get( "r_parallaxMapOffset", "0", CVAR_ARCHIVE | CVAR_LATCH );
 	r_parallaxMapShadows = ri.Cvar_Get( "r_parallaxMapShadows", "0", CVAR_ARCHIVE | CVAR_LATCH );
 	r_cubeMapping = ri.Cvar_Get( "r_cubeMapping", "0", CVAR_ARCHIVE | CVAR_LATCH );
 	r_cubemapSize = ri.Cvar_Get( "r_cubemapSize", "128", CVAR_ARCHIVE | CVAR_LATCH );
@@ -1447,7 +1442,7 @@ void R_Register( void ) {
 	r_dynamiclight = ri.Cvar_Get( "r_dynamiclight", "1", CVAR_ARCHIVE );
 	r_dlightBacks = ri.Cvar_Get( "r_dlightBacks", "1", CVAR_ARCHIVE );
 	r_finish = ri.Cvar_Get( "r_finish", "0", CVAR_ARCHIVE );
-	r_textureMode = ri.Cvar_Get( "r_textureMode", "GL_LINEAR_MIPMAP_NEAREST", CVAR_ARCHIVE );
+	r_textureMode = ri.Cvar_Get( "r_textureMode", "GL_LINEAR_MIPMAP_LINEAR", CVAR_ARCHIVE );
 
 	r_swapInterval = ri.Cvar_Get( "r_swapInterval", "0",
 					CVAR_ARCHIVE | CVAR_LATCH );
@@ -1674,6 +1669,8 @@ void R_Init( void ) {
 		ri.Printf( PRINT_ALL, "glGetError() = 0x%x\n", err );
 	}
 
+	// print info
+	GfxInfo_f();
 	ri.Printf( PRINT_ALL, "----- finished R_Init -----\n" );
 }
 
@@ -1724,6 +1721,7 @@ void RE_Shutdown( qboolean destroyWindow ) {
 		textureFilterAnisotropic = qfalse;
 		maxAnisotropy = 0;
 		displayAspect = 0.0f;
+		haveClampToEdge = qfalse;
 
 		Com_Memset( &glState, 0, sizeof( glState ) );
 	}
diff --git a/MP/code/rend2/tr_local.h b/MP/code/rend2/tr_local.h
index fc6a36f..9022be4 100644
--- a/MP/code/rend2/tr_local.h
+++ b/MP/code/rend2/tr_local.h
@@ -1065,6 +1065,12 @@ typedef struct srfBspSurface_s
 	float			*heightLodError;
 } srfBspSurface_t;
 
+typedef struct {
+	vec3_t translate;
+	quat_t rotate;
+	vec3_t scale;
+} iqmTransform_t;
+
 // inter-quake-model
 typedef struct {
 	int		num_vertexes;
@@ -1098,8 +1104,9 @@ typedef struct {
 
 	char		*jointNames;
 	int		*jointParents;
-	float		*jointMats;
-	float		*poseMats;
+	float		*bindJoints; // [num_joints * 12]
+	float		*invBindJoints; // [num_joints * 12]
+	iqmTransform_t	*poses; // [num_frames * num_poses]
 	float		*bounds;
 
 	int		numVaoSurfaces;
@@ -1804,6 +1811,7 @@ extern qboolean  textureFilterAnisotropic;
 extern int       maxAnisotropy;
 extern glRefConfig_t glRefConfig;
 extern float     displayAspect;
+extern qboolean  haveClampToEdge;
 
 //
 // cvars
@@ -1963,6 +1971,7 @@ extern  cvar_t  *r_normalMapping;
 extern  cvar_t  *r_specularMapping;
 extern  cvar_t  *r_deluxeMapping;
 extern  cvar_t  *r_parallaxMapping;
+extern  cvar_t  *r_parallaxMapOffset;
 extern  cvar_t  *r_parallaxMapShadows;
 extern  cvar_t  *r_cubeMapping;
 extern  cvar_t  *r_cubemapSize;
diff --git a/MP/code/rend2/tr_model_iqm.c b/MP/code/rend2/tr_model_iqm.c
index eeba198..328b0d5 100644
--- a/MP/code/rend2/tr_model_iqm.c
+++ b/MP/code/rend2/tr_model_iqm.c
@@ -2,6 +2,7 @@
 ===========================================================================
 Copyright (C) 2011 Thilo Schulz <thilo@tjps.eu>
 Copyright (C) 2011 Matthias Bentrup <matthias.bentrup@googlemail.com>
+Copyright (C) 2011-2019 Zack Middleton <zturtleman@gmail.com>
 
 This file is part of Quake III Arena source code.
 
@@ -44,7 +45,7 @@ static qboolean IQM_CheckRange( iqmHeader_t *header, int offset,
 }
 // "multiply" 3x4 matrices, these are assumed to be the top 3 rows
 // of a 4x4 matrix with the last row = (0 0 0 1)
-static void Matrix34Multiply( float *a, float *b, float *out ) {
+static void Matrix34Multiply( const float *a, const float *b, float *out ) {
 	out[ 0] = a[0] * b[0] + a[1] * b[4] + a[ 2] * b[ 8];
 	out[ 1] = a[0] * b[1] + a[1] * b[5] + a[ 2] * b[ 9];
 	out[ 2] = a[0] * b[2] + a[1] * b[6] + a[ 2] * b[10];
@@ -58,23 +59,7 @@ static void Matrix34Multiply( float *a, float *b, float *out ) {
 	out[10] = a[8] * b[2] + a[9] * b[6] + a[10] * b[10];
 	out[11] = a[8] * b[3] + a[9] * b[7] + a[10] * b[11] + a[11];
 }
-static void InterpolateMatrix( float *a, float *b, float lerp, float *mat ) {
-	float unLerp = 1.0f - lerp;
-
-	mat[ 0] = a[ 0] * unLerp + b[ 0] * lerp;
-	mat[ 1] = a[ 1] * unLerp + b[ 1] * lerp;
-	mat[ 2] = a[ 2] * unLerp + b[ 2] * lerp;
-	mat[ 3] = a[ 3] * unLerp + b[ 3] * lerp;
-	mat[ 4] = a[ 4] * unLerp + b[ 4] * lerp;
-	mat[ 5] = a[ 5] * unLerp + b[ 5] * lerp;
-	mat[ 6] = a[ 6] * unLerp + b[ 6] * lerp;
-	mat[ 7] = a[ 7] * unLerp + b[ 7] * lerp;
-	mat[ 8] = a[ 8] * unLerp + b[ 8] * lerp;
-	mat[ 9] = a[ 9] * unLerp + b[ 9] * lerp;
-	mat[10] = a[10] * unLerp + b[10] * lerp;
-	mat[11] = a[11] * unLerp + b[11] * lerp;
-}
-static void JointToMatrix( vec4_t rot, vec3_t scale, vec3_t trans,
+static void JointToMatrix( const quat_t rot, const vec3_t scale, const vec3_t trans,
 			   float *mat ) {
 	float xx = 2.0f * rot[0] * rot[0];
 	float yy = 2.0f * rot[1] * rot[1];
@@ -99,8 +84,7 @@ static void JointToMatrix( vec4_t rot, vec3_t scale, vec3_t trans,
 	mat[10] = scale[2] * (1.0f - (xx + yy));
 	mat[11] = trans[2];
 }
-static void Matrix34Invert( float *inMat, float *outMat )
-{
+static void Matrix34Invert( const float *inMat, float *outMat ) {
 	vec3_t trans;
 	float invSqrLen, *v;
 
@@ -120,6 +104,62 @@ static void Matrix34Invert( float *inMat, float *outMat )
 	outMat[ 7] = -DotProduct(outMat + 4, trans);
 	outMat[11] = -DotProduct(outMat + 8, trans);
 }
+static void QuatSlerp(const quat_t from, const quat_t _to, float fraction, quat_t out) {
+	float angle, cosAngle, sinAngle, backlerp, lerp;
+	quat_t to;
+
+	// cos() of angle
+	cosAngle = from[0] * _to[0] + from[1] * _to[1] + from[2] * _to[2] + from[3] * _to[3];
+
+	// negative handling is needed for taking shortest path (required for model joints)
+	if ( cosAngle < 0.0f ) {
+		cosAngle = -cosAngle;
+		to[0] = - _to[0];
+		to[1] = - _to[1];
+		to[2] = - _to[2];
+		to[3] = - _to[3];
+	} else {
+		QuatCopy( _to, to );
+	}
+
+	if ( cosAngle < 0.999999f ) {
+		// spherical lerp (slerp)
+		angle = acosf( cosAngle );
+		sinAngle = sinf( angle );
+		backlerp = sinf( ( 1.0f - fraction ) * angle ) / sinAngle;
+		lerp = sinf( fraction * angle ) / sinAngle;
+	} else {
+		// linear lerp
+		backlerp = 1.0f - fraction;
+		lerp = fraction;
+	}
+
+	out[0] = from[0] * backlerp + to[0] * lerp;
+	out[1] = from[1] * backlerp + to[1] * lerp;
+	out[2] = from[2] * backlerp + to[2] * lerp;
+	out[3] = from[3] * backlerp + to[3] * lerp;
+}
+static vec_t QuatNormalize2( const quat_t v, quat_t out) {
+	float	length, ilength;
+
+	length = v[0]*v[0] + v[1]*v[1] + v[2]*v[2] + v[3]*v[3];
+
+	if (length) {
+		/* writing it this way allows gcc to recognize that rsqrt can be used */
+		ilength = 1/(float)sqrt (length);
+		/* sqrt(length) = length * (1 / sqrt(length)) */
+		length *= ilength;
+		out[0] = v[0]*ilength;
+		out[1] = v[1]*ilength;
+		out[2] = v[2]*ilength;
+		out[3] = v[3]*ilength;
+	} else {
+		out[0] = out[1] = out[2] = 0;
+		out[3] = -1;
+	}
+
+	return length;
+}
 
 /*
 =================
@@ -139,7 +179,7 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
 	unsigned short		*framedata;
 	char			*str;
 	int			i, j, k;
-	float			jointInvMats[IQM_MAX_JOINTS * 12] = {0.0f};
+	iqmTransform_t		*transform;
 	float			*mat, *matInv;
 	size_t			size, joint_names;
 	byte			*dataPtr;
@@ -562,10 +602,11 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
 	if( header->num_joints ) {
 		size += joint_names;								// joint names
 		size += header->num_joints * sizeof(int);			// joint parents
-		size += header->num_joints * 12 * sizeof( float );	// joint mats
+		size += header->num_joints * 12 * sizeof(float);	// bind joint matricies
+		size += header->num_joints * 12 * sizeof(float);	// inverse bind joint matricies
 	}
 	if( header->num_poses ) {
-		size += header->num_poses * header->num_frames * 12 * sizeof( float ); // pose mats
+		size += header->num_poses * header->num_frames * sizeof(iqmTransform_t); // pose transforms
 	}
 	if( header->ofs_bounds ) {
 		size += header->num_frames * 6 * sizeof(float);		// model bounds
@@ -636,12 +677,15 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
 		iqmData->jointParents = (int*)dataPtr;
 		dataPtr += header->num_joints * sizeof(int);		// joint parents
 
-		iqmData->jointMats = (float*)dataPtr;
-		dataPtr += header->num_joints * 12 * sizeof( float ); // joint mats
+		iqmData->bindJoints = (float*)dataPtr;
+		dataPtr += header->num_joints * 12 * sizeof(float);		// bind joint matricies
+
+		iqmData->invBindJoints = (float*)dataPtr;
+		dataPtr += header->num_joints * 12 * sizeof(float);		// inverse bind joint matricies
 	}
 	if( header->num_poses ) {
-		iqmData->poseMats = (float*)dataPtr;
-		dataPtr += header->num_poses * header->num_frames * 12 * sizeof( float ); // pose mats
+		iqmData->poses = (iqmTransform_t*)dataPtr;
+		dataPtr += header->num_poses * header->num_frames * sizeof(iqmTransform_t); // pose transforms
 	}
 	if( header->ofs_bounds ) {
 		iqmData->bounds = (float*)dataPtr;
@@ -807,22 +851,23 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
 			iqmData->jointParents[i] = joint->parent;
 		}
 
-		// calculate joint matrices and their inverses
-		// joint inverses are needed only until the pose matrices are calculated
-		mat = iqmData->jointMats;
-		matInv = jointInvMats;
+		// calculate bind joint matrices and their inverses
+		mat = iqmData->bindJoints;
+		matInv = iqmData->invBindJoints;
 		joint = (iqmJoint_t *)((byte *)header + header->ofs_joints);
 		for( i = 0; i < header->num_joints; i++, joint++ ) {
 			float baseFrame[12], invBaseFrame[12];
 
+			QuatNormalize2( joint->rotate, joint->rotate );
+
 			JointToMatrix( joint->rotate, joint->scale, joint->translate, baseFrame );
 			Matrix34Invert( baseFrame, invBaseFrame );
 
 			if ( joint->parent >= 0 )
 			{
-				Matrix34Multiply( iqmData->jointMats + 12 * joint->parent, baseFrame, mat );
+				Matrix34Multiply( iqmData->bindJoints + 12 * joint->parent, baseFrame, mat );
 				mat += 12;
-				Matrix34Multiply( invBaseFrame, jointInvMats + 12 * joint->parent, matInv );
+				Matrix34Multiply( invBaseFrame, iqmData->invBindJoints + 12 * joint->parent, matInv );
 				matInv += 12;
 			}
 			else
@@ -837,16 +882,15 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
 
 	if( header->num_poses )
 	{
-		// calculate pose matrices
+		// calculate pose transforms
+		transform = iqmData->poses;
 		framedata = (unsigned short *)((byte *)header + header->ofs_frames);
-		mat = iqmData->poseMats;
 		for( i = 0; i < header->num_frames; i++ ) {
 			pose = (iqmPose_t *)((byte *)header + header->ofs_poses);
-			for( j = 0; j < header->num_poses; j++, pose++ ) {
+			for( j = 0; j < header->num_poses; j++, pose++, transform++ ) {
 				vec3_t	translate;
-				vec4_t	rotate;
+				quat_t	rotate;
 				vec3_t	scale;
-				float	mat1[12], mat2[12];
 
 				translate[0] = pose->channeloffset[0];
 				if( pose->mask & 0x001)
@@ -881,18 +925,9 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
 				if( pose->mask & 0x200)
 					scale[2] += *framedata++ * pose->channelscale[9];
 
-				// construct transformation matrix
-				JointToMatrix( rotate, scale, translate, mat1 );
-
-				if( pose->parent >= 0 ) {
-					Matrix34Multiply( iqmData->jointMats + 12 * pose->parent,
-							  mat1, mat2 );
-				} else {
-					Com_Memcpy( mat2, mat1, sizeof(mat1) );
-				}
-
-				Matrix34Multiply( mat2, jointInvMats + 12 * j, mat );
-				mat += 12;
+				VectorCopy( translate, transform->translate );
+				QuatNormalize2( rotate, transform->rotate );
+				VectorCopy( scale, transform->scale );
 			}
 		}
 	}
@@ -1306,37 +1341,59 @@ void R_AddIQMSurfaces( trRefEntity_t *ent ) {
 
 
 static void ComputePoseMats( iqmData_t *data, int frame, int oldframe,
-			      float backlerp, float *mat ) {
-	float	*mat1, *mat2;
-	int	*joint = data->jointParents;
-	int	i;
-
+			      float backlerp, float *poseMats ) {
+	iqmTransform_t relativeJoints[IQM_MAX_JOINTS];
+	iqmTransform_t *relativeJoint;
+	const iqmTransform_t *pose;
+	const iqmTransform_t *oldpose;
+	const int *jointParent;
+	const float *invBindMat;
+	float *poseMat, lerp;
+	int i;
+
+	relativeJoint = relativeJoints;
+
+	// copy or lerp animation frame pose
 	if ( oldframe == frame ) {
-		mat1 = data->poseMats + 12 * data->num_poses * frame;
-		for( i = 0; i < data->num_poses; i++, joint++ ) {
-			if( *joint >= 0 ) {
-				Matrix34Multiply( mat + 12 * *joint,
-						  mat1 + 12*i, mat + 12*i );
-			} else {
-				Com_Memcpy( mat + 12*i, mat1 + 12*i, 12 * sizeof(float) );
-			}
+		pose = &data->poses[frame * data->num_poses];
+		for ( i = 0; i < data->num_poses; i++, pose++, relativeJoint++ ) {
+			VectorCopy( pose->translate, relativeJoint->translate );
+			QuatCopy( pose->rotate, relativeJoint->rotate );
+			VectorCopy( pose->scale, relativeJoint->scale );
 		}
-	} else  {
-		mat1 = data->poseMats + 12 * data->num_poses * frame;
-		mat2 = data->poseMats + 12 * data->num_poses * oldframe;
-		
-		for( i = 0; i < data->num_poses; i++, joint++ ) {
-			if( *joint >= 0 ) {
-				float tmpMat[12];
-				InterpolateMatrix( mat1 + 12*i, mat2 + 12*i,
-						   backlerp, tmpMat );
-				Matrix34Multiply( mat + 12 * *joint,
-						  tmpMat, mat + 12*i );
-				
-			} else {
-				InterpolateMatrix( mat1 + 12*i, mat2 + 12*i,
-						   backlerp, mat + 12*i );
-			}
+	} else {
+		lerp = 1.0f - backlerp;
+		pose = &data->poses[frame * data->num_poses];
+		oldpose = &data->poses[oldframe * data->num_poses];
+		for ( i = 0; i < data->num_poses; i++, oldpose++, pose++, relativeJoint++ ) {
+			relativeJoint->translate[0] = oldpose->translate[0] * backlerp + pose->translate[0] * lerp;
+			relativeJoint->translate[1] = oldpose->translate[1] * backlerp + pose->translate[1] * lerp;
+			relativeJoint->translate[2] = oldpose->translate[2] * backlerp + pose->translate[2] * lerp;
+
+			relativeJoint->scale[0] = oldpose->scale[0] * backlerp + pose->scale[0] * lerp;
+			relativeJoint->scale[1] = oldpose->scale[1] * backlerp + pose->scale[1] * lerp;
+			relativeJoint->scale[2] = oldpose->scale[2] * backlerp + pose->scale[2] * lerp;
+
+			QuatSlerp( oldpose->rotate, pose->rotate, lerp, relativeJoint->rotate );
+		}
+	}
+
+	// multiply by inverse of bind pose and parent 'pose mat' (bind pose transform matrix)
+	relativeJoint = relativeJoints;
+	jointParent = data->jointParents;
+	invBindMat = data->invBindJoints;
+	poseMat = poseMats;
+	for ( i = 0; i < data->num_poses; i++, relativeJoint++, jointParent++, invBindMat += 12, poseMat += 12 ) {
+		float mat1[12], mat2[12];
+
+		JointToMatrix( relativeJoint->rotate, relativeJoint->scale, relativeJoint->translate, mat1 );
+
+		if ( *jointParent >= 0 ) {
+			Matrix34Multiply( &data->bindJoints[(*jointParent)*12], mat1, mat2 );
+			Matrix34Multiply( mat2, invBindMat, mat1 );
+			Matrix34Multiply( &poseMats[(*jointParent)*12], mat1, poseMat );
+		} else {
+			Matrix34Multiply( mat1, invBindMat, poseMat );
 		}
 	}
 }
@@ -1347,7 +1404,7 @@ static void ComputeJointMats( iqmData_t *data, int frame, int oldframe,
 	int	i;
 
 	if ( data->num_poses == 0 ) {
-		Com_Memcpy( mat, data->jointMats, data->num_joints * 12 * sizeof(float) );
+		Com_Memcpy( mat, data->bindJoints, data->num_joints * 12 * sizeof(float) );
 		return;
 	}
 
@@ -1359,7 +1416,7 @@ static void ComputeJointMats( iqmData_t *data, int frame, int oldframe,
 
 		Com_Memcpy(outmat, mat1, sizeof(outmat));
 
-		Matrix34Multiply( outmat, data->jointMats + 12*i, mat1 );
+		Matrix34Multiply( outmat, data->bindJoints + 12*i, mat1 );
 	}
 }
 
@@ -1427,20 +1484,21 @@ void RB_IQMSurfaceAnim( surfaceType_t *surface ) {
 			float *vtxMat = &influenceVtxMat[12*i];
 			float *nrmMat = &influenceNrmMat[9*i];
 			int	j;
-			float	blendWeights[4] = {0};
-			int		numWeights;
-
-			for ( numWeights = 0; numWeights < 4; numWeights++ ) {
-				if ( data->blendWeightsType == IQM_FLOAT )
-					blendWeights[numWeights] = data->influenceBlendWeights.f[4*influence + numWeights];
-				else
-					blendWeights[numWeights] = (float)data->influenceBlendWeights.b[4*influence + numWeights] / 255.0f;
+			float	blendWeights[4];
 
-				if ( blendWeights[numWeights] <= 0.0f )
-					break;
+			if ( data->blendWeightsType == IQM_FLOAT ) {
+				blendWeights[0] = data->influenceBlendWeights.f[4*influence + 0];
+				blendWeights[1] = data->influenceBlendWeights.f[4*influence + 1];
+				blendWeights[2] = data->influenceBlendWeights.f[4*influence + 2];
+				blendWeights[3] = data->influenceBlendWeights.f[4*influence + 3];
+			} else {
+				blendWeights[0] = (float)data->influenceBlendWeights.b[4*influence + 0] / 255.0f;
+				blendWeights[1] = (float)data->influenceBlendWeights.b[4*influence + 1] / 255.0f;
+				blendWeights[2] = (float)data->influenceBlendWeights.b[4*influence + 2] / 255.0f;
+				blendWeights[3] = (float)data->influenceBlendWeights.b[4*influence + 3] / 255.0f;
 			}
 
-			if ( numWeights == 0 ) {
+			if ( blendWeights[0] <= 0.0f ) {
 				// no blend joint, use identity matrix.
 				vtxMat[0] = identityMatrix[0];
 				vtxMat[1] = identityMatrix[1];
@@ -1470,7 +1528,11 @@ void RB_IQMSurfaceAnim( surfaceType_t *surface ) {
 				vtxMat[10] = blendWeights[0] * poseMats[12 * data->influenceBlendIndexes[4*influence + 0] + 10];
 				vtxMat[11] = blendWeights[0] * poseMats[12 * data->influenceBlendIndexes[4*influence + 0] + 11];
 
-				for( j = 1; j < numWeights; j++ ) {
+				for( j = 1; j < 4; j++ ) {
+					if ( blendWeights[j] <= 0.0f ) {
+						break;
+					}
+
 					vtxMat[0] += blendWeights[j] * poseMats[12 * data->influenceBlendIndexes[4*influence + j] + 0];
 					vtxMat[1] += blendWeights[j] * poseMats[12 * data->influenceBlendIndexes[4*influence + j] + 1];
 					vtxMat[2] += blendWeights[j] * poseMats[12 * data->influenceBlendIndexes[4*influence + j] + 2];
diff --git a/MP/code/renderer/tr_backend.c b/MP/code/renderer/tr_backend.c
index 7c936d1..25ff1b9 100644
--- a/MP/code/renderer/tr_backend.c
+++ b/MP/code/renderer/tr_backend.c
@@ -888,8 +888,8 @@ void RE_UploadCinematic( int w, int h, int cols, int rows, const byte *data, int
 #endif
 		qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
 		qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
-		qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
-		qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
+		qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, haveClampToEdge ? GL_CLAMP_TO_EDGE : GL_CLAMP );
+		qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, haveClampToEdge ? GL_CLAMP_TO_EDGE : GL_CLAMP );
 	} else {
 		if ( dirty ) {
 			// otherwise, just subimage upload it so that drivers can tell we are going to be changing
diff --git a/MP/code/renderer/tr_image.c b/MP/code/renderer/tr_image.c
index 2a285a3..2efa664 100644
--- a/MP/code/renderer/tr_image.c
+++ b/MP/code/renderer/tr_image.c
@@ -1151,7 +1151,7 @@ image_t *R_CreateImage( const char *name, byte *pic, int width, int height,
 	image->width = width;
 	image->height = height;
 	if (flags & IMGFLAG_CLAMPTOEDGE)
-		glWrapClampMode = GL_CLAMP_TO_EDGE;
+		glWrapClampMode = haveClampToEdge ? GL_CLAMP_TO_EDGE : GL_CLAMP;
 	else
 		glWrapClampMode = GL_REPEAT;
 
diff --git a/MP/code/renderer/tr_init.c b/MP/code/renderer/tr_init.c
index a1e95ea..6df01be 100644
--- a/MP/code/renderer/tr_init.c
+++ b/MP/code/renderer/tr_init.c
@@ -34,6 +34,7 @@ glconfig_t  glConfig;
 qboolean    textureFilterAnisotropic = qfalse;
 int         maxAnisotropy = 0;
 float       displayAspect = 0.0f;
+qboolean    haveClampToEdge = qfalse;
 
 glstate_t glState;
 
@@ -1030,31 +1031,16 @@ Workaround for ri.Printf's 1024 characters buffer limit.
 */
 void R_PrintLongString(const char *string) {
 	char buffer[1024];
-	const char *p = string;
-	int remainingLength = strlen(string);
+	const char *p;
+	int size = strlen(string);
 
-	while (remainingLength > 0)
+	p = string;
+	while(size > 0)
 	{
-		// Take as much characters as possible from the string without splitting words between buffers
-		// This avoids the client console splitting a word up when one half fits on the current line,
-		// but the second half would have to be written on a new line
-		int charsToTake = sizeof(buffer) - 1;
-		if (remainingLength > charsToTake) {
-			while (p[charsToTake - 1] > ' ' && p[charsToTake] > ' ') {
-				charsToTake--;
-				if (charsToTake == 0) {
-					charsToTake = sizeof(buffer) - 1;
-					break;
-				}
-			}
-		} else if (remainingLength < charsToTake) {
-			charsToTake = remainingLength;
-		}
-
-		Q_strncpyz( buffer, p, charsToTake + 1 );
+		Q_strncpyz(buffer, p, sizeof (buffer) );
 		ri.Printf( PRINT_ALL, "%s", buffer );
-		remainingLength -= charsToTake;
-		p += charsToTake;
+		p += 1023;
+		size -= 1023;
 	}
 }
 
@@ -1079,6 +1065,7 @@ void GfxInfo_f( void ) {
 	ri.Printf( PRINT_ALL, "GL_RENDERER: %s\n", glConfig.renderer_string );
 	ri.Printf( PRINT_ALL, "GL_VERSION: %s\n", glConfig.version_string );
 	ri.Printf( PRINT_ALL, "GL_EXTENSIONS: " );
+	// glConfig.extensions_string is a limited length so get the full list directly
 #ifndef USE_OPENGLES
 	if ( qglGetStringi )
 	{
@@ -1094,7 +1081,7 @@ void GfxInfo_f( void ) {
 	else
 #endif
 	{
-		R_PrintLongString( glConfig.extensions_string );
+		R_PrintLongString( (char *) qglGetString( GL_EXTENSIONS ) );
 	}
 	ri.Printf( PRINT_ALL, "\n" );
 	ri.Printf( PRINT_ALL, "GL_MAX_TEXTURE_SIZE: %d\n", glConfig.maxTextureSize );
@@ -1275,7 +1262,7 @@ void R_Register( void ) {
 	r_dynamiclight = ri.Cvar_Get( "r_dynamiclight", "1", CVAR_ARCHIVE );
 	r_dlightBacks = ri.Cvar_Get( "r_dlightBacks", "1", CVAR_ARCHIVE );
 	r_finish = ri.Cvar_Get( "r_finish", "0", CVAR_ARCHIVE );
-	r_textureMode = ri.Cvar_Get( "r_textureMode", "GL_LINEAR_MIPMAP_NEAREST", CVAR_ARCHIVE );
+	r_textureMode = ri.Cvar_Get( "r_textureMode", "GL_LINEAR_MIPMAP_LINEAR", CVAR_ARCHIVE );
 
 	r_swapInterval = ri.Cvar_Get( "r_swapInterval", "0",
 					CVAR_ARCHIVE | CVAR_LATCH );
@@ -1484,6 +1471,8 @@ void R_Init( void ) {
 		ri.Printf( PRINT_ALL, "glGetError() = 0x%x\n", err );
 	}
 
+	// print info
+	GfxInfo_f();
 	ri.Printf( PRINT_ALL, "----- finished R_Init -----\n" );
 }
 
@@ -1526,6 +1515,7 @@ void RE_Shutdown( qboolean destroyWindow ) {
 		textureFilterAnisotropic = qfalse;
 		maxAnisotropy = 0;
 		displayAspect = 0.0f;
+		haveClampToEdge = qfalse;
 
 		Com_Memset( &glState, 0, sizeof( glState ) );
 	}
diff --git a/MP/code/renderer/tr_local.h b/MP/code/renderer/tr_local.h
index 00fe159..a442153 100644
--- a/MP/code/renderer/tr_local.h
+++ b/MP/code/renderer/tr_local.h
@@ -696,6 +696,12 @@ typedef struct {
 	drawVert_t      *verts;
 } srfTriangles_t;
 
+typedef struct {
+	vec3_t translate;
+	quat_t rotate;
+	vec3_t scale;
+} iqmTransform_t;
+
 // inter-quake-model
 typedef struct {
 	int		num_vertexes;
@@ -729,8 +735,9 @@ typedef struct {
 
 	char		*jointNames;
 	int		*jointParents;
-	float		*jointMats;
-	float		*poseMats;
+	float		*bindJoints; // [num_joints * 12]
+	float		*invBindJoints; // [num_joints * 12]
+	iqmTransform_t	*poses; // [num_frames * num_poses]
 	float		*bounds;
 } iqmData_t;
 
@@ -1122,6 +1129,7 @@ extern glstate_t glState;           // outside of TR since it shouldn't be clear
 extern qboolean  textureFilterAnisotropic;
 extern int       maxAnisotropy;
 extern float     displayAspect;
+extern qboolean  haveClampToEdge;
 
 //
 // cvars
diff --git a/MP/code/renderer/tr_model_iqm.c b/MP/code/renderer/tr_model_iqm.c
index f11666f..f873759 100644
--- a/MP/code/renderer/tr_model_iqm.c
+++ b/MP/code/renderer/tr_model_iqm.c
@@ -2,6 +2,7 @@
 ===========================================================================
 Copyright (C) 2011 Thilo Schulz <thilo@tjps.eu>
 Copyright (C) 2011 Matthias Bentrup <matthias.bentrup@googlemail.com>
+Copyright (C) 2011-2019 Zack Middleton <zturtleman@gmail.com>
 
 This file is part of Quake III Arena source code.
 
@@ -44,7 +45,7 @@ static qboolean IQM_CheckRange( iqmHeader_t *header, int offset,
 }
 // "multiply" 3x4 matrices, these are assumed to be the top 3 rows
 // of a 4x4 matrix with the last row = (0 0 0 1)
-static void Matrix34Multiply( float *a, float *b, float *out ) {
+static void Matrix34Multiply( const float *a, const float *b, float *out ) {
 	out[ 0] = a[0] * b[0] + a[1] * b[4] + a[ 2] * b[ 8];
 	out[ 1] = a[0] * b[1] + a[1] * b[5] + a[ 2] * b[ 9];
 	out[ 2] = a[0] * b[2] + a[1] * b[6] + a[ 2] * b[10];
@@ -58,23 +59,7 @@ static void Matrix34Multiply( float *a, float *b, float *out ) {
 	out[10] = a[8] * b[2] + a[9] * b[6] + a[10] * b[10];
 	out[11] = a[8] * b[3] + a[9] * b[7] + a[10] * b[11] + a[11];
 }
-static void InterpolateMatrix( float *a, float *b, float lerp, float *mat ) {
-	float unLerp = 1.0f - lerp;
-
-	mat[ 0] = a[ 0] * unLerp + b[ 0] * lerp;
-	mat[ 1] = a[ 1] * unLerp + b[ 1] * lerp;
-	mat[ 2] = a[ 2] * unLerp + b[ 2] * lerp;
-	mat[ 3] = a[ 3] * unLerp + b[ 3] * lerp;
-	mat[ 4] = a[ 4] * unLerp + b[ 4] * lerp;
-	mat[ 5] = a[ 5] * unLerp + b[ 5] * lerp;
-	mat[ 6] = a[ 6] * unLerp + b[ 6] * lerp;
-	mat[ 7] = a[ 7] * unLerp + b[ 7] * lerp;
-	mat[ 8] = a[ 8] * unLerp + b[ 8] * lerp;
-	mat[ 9] = a[ 9] * unLerp + b[ 9] * lerp;
-	mat[10] = a[10] * unLerp + b[10] * lerp;
-	mat[11] = a[11] * unLerp + b[11] * lerp;
-}
-static void JointToMatrix( vec4_t rot, vec3_t scale, vec3_t trans,
+static void JointToMatrix( const quat_t rot, const vec3_t scale, const vec3_t trans,
 			   float *mat ) {
 	float xx = 2.0f * rot[0] * rot[0];
 	float yy = 2.0f * rot[1] * rot[1];
@@ -99,8 +84,7 @@ static void JointToMatrix( vec4_t rot, vec3_t scale, vec3_t trans,
 	mat[10] = scale[2] * (1.0f - (xx + yy));
 	mat[11] = trans[2];
 }
-static void Matrix34Invert( float *inMat, float *outMat )
-{
+static void Matrix34Invert( const float *inMat, float *outMat ) {
 	vec3_t trans;
 	float invSqrLen, *v;
 
@@ -120,6 +104,62 @@ static void Matrix34Invert( float *inMat, float *outMat )
 	outMat[ 7] = -DotProduct(outMat + 4, trans);
 	outMat[11] = -DotProduct(outMat + 8, trans);
 }
+static void QuatSlerp(const quat_t from, const quat_t _to, float fraction, quat_t out) {
+	float angle, cosAngle, sinAngle, backlerp, lerp;
+	quat_t to;
+
+	// cos() of angle
+	cosAngle = from[0] * _to[0] + from[1] * _to[1] + from[2] * _to[2] + from[3] * _to[3];
+
+	// negative handling is needed for taking shortest path (required for model joints)
+	if ( cosAngle < 0.0f ) {
+		cosAngle = -cosAngle;
+		to[0] = - _to[0];
+		to[1] = - _to[1];
+		to[2] = - _to[2];
+		to[3] = - _to[3];
+	} else {
+		QuatCopy( _to, to );
+	}
+
+	if ( cosAngle < 0.999999f ) {
+		// spherical lerp (slerp)
+		angle = acosf( cosAngle );
+		sinAngle = sinf( angle );
+		backlerp = sinf( ( 1.0f - fraction ) * angle ) / sinAngle;
+		lerp = sinf( fraction * angle ) / sinAngle;
+	} else {
+		// linear lerp
+		backlerp = 1.0f - fraction;
+		lerp = fraction;
+	}
+
+	out[0] = from[0] * backlerp + to[0] * lerp;
+	out[1] = from[1] * backlerp + to[1] * lerp;
+	out[2] = from[2] * backlerp + to[2] * lerp;
+	out[3] = from[3] * backlerp + to[3] * lerp;
+}
+static vec_t QuatNormalize2( const quat_t v, quat_t out) {
+	float	length, ilength;
+
+	length = v[0]*v[0] + v[1]*v[1] + v[2]*v[2] + v[3]*v[3];
+
+	if (length) {
+		/* writing it this way allows gcc to recognize that rsqrt can be used */
+		ilength = 1/(float)sqrt (length);
+		/* sqrt(length) = length * (1 / sqrt(length)) */
+		length *= ilength;
+		out[0] = v[0]*ilength;
+		out[1] = v[1]*ilength;
+		out[2] = v[2]*ilength;
+		out[3] = v[3]*ilength;
+	} else {
+		out[0] = out[1] = out[2] = 0;
+		out[3] = -1;
+	}
+
+	return length;
+}
 
 /*
 =================
@@ -139,7 +179,7 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
 	unsigned short		*framedata;
 	char			*str;
 	int			i, j, k;
-	float			jointInvMats[IQM_MAX_JOINTS * 12] = {0.0f};
+	iqmTransform_t		*transform;
 	float			*mat, *matInv;
 	size_t			size, joint_names;
 	byte			*dataPtr;
@@ -559,10 +599,11 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
 	if( header->num_joints ) {
 		size += joint_names;								// joint names
 		size += header->num_joints * sizeof(int);			// joint parents
-		size += header->num_joints * 12 * sizeof( float );	// joint mats
+		size += header->num_joints * 12 * sizeof(float);	// bind joint matricies
+		size += header->num_joints * 12 * sizeof(float);	// inverse bind joint matricies
 	}
 	if( header->num_poses ) {
-		size += header->num_poses * header->num_frames * 12 * sizeof( float ); // pose mats
+		size += header->num_poses * header->num_frames * sizeof(iqmTransform_t); // pose transforms
 	}
 	if( header->ofs_bounds ) {
 		size += header->num_frames * 6 * sizeof(float);		// model bounds
@@ -633,12 +674,15 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
 		iqmData->jointParents = (int*)dataPtr;
 		dataPtr += header->num_joints * sizeof(int);		// joint parents
 
-		iqmData->jointMats = (float*)dataPtr;
-		dataPtr += header->num_joints * 12 * sizeof( float ); // joint mats
+		iqmData->bindJoints = (float*)dataPtr;
+		dataPtr += header->num_joints * 12 * sizeof(float);		// bind joint matricies
+
+		iqmData->invBindJoints = (float*)dataPtr;
+		dataPtr += header->num_joints * 12 * sizeof(float);		// inverse bind joint matricies
 	}
 	if( header->num_poses ) {
-		iqmData->poseMats = (float*)dataPtr;
-		dataPtr += header->num_poses * header->num_frames * 12 * sizeof( float ); // pose mats
+		iqmData->poses = (iqmTransform_t*)dataPtr;
+		dataPtr += header->num_poses * header->num_frames * sizeof(iqmTransform_t); // pose transforms
 	}
 	if( header->ofs_bounds ) {
 		iqmData->bounds = (float*)dataPtr;
@@ -804,22 +848,23 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
 			iqmData->jointParents[i] = joint->parent;
 		}
 
-		// calculate joint matrices and their inverses
-		// joint inverses are needed only until the pose matrices are calculated
-		mat = iqmData->jointMats;
-		matInv = jointInvMats;
+		// calculate bind joint matrices and their inverses
+		mat = iqmData->bindJoints;
+		matInv = iqmData->invBindJoints;
 		joint = (iqmJoint_t *)((byte *)header + header->ofs_joints);
 		for( i = 0; i < header->num_joints; i++, joint++ ) {
 			float baseFrame[12], invBaseFrame[12];
 
+			QuatNormalize2( joint->rotate, joint->rotate );
+
 			JointToMatrix( joint->rotate, joint->scale, joint->translate, baseFrame );
 			Matrix34Invert( baseFrame, invBaseFrame );
 
 			if ( joint->parent >= 0 )
 			{
-				Matrix34Multiply( iqmData->jointMats + 12 * joint->parent, baseFrame, mat );
+				Matrix34Multiply( iqmData->bindJoints + 12 * joint->parent, baseFrame, mat );
 				mat += 12;
-				Matrix34Multiply( invBaseFrame, jointInvMats + 12 * joint->parent, matInv );
+				Matrix34Multiply( invBaseFrame, iqmData->invBindJoints + 12 * joint->parent, matInv );
 				matInv += 12;
 			}
 			else
@@ -834,16 +879,15 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
 
 	if( header->num_poses )
 	{
-		// calculate pose matrices
+		// calculate pose transforms
+		transform = iqmData->poses;
 		framedata = (unsigned short *)((byte *)header + header->ofs_frames);
-		mat = iqmData->poseMats;
 		for( i = 0; i < header->num_frames; i++ ) {
 			pose = (iqmPose_t *)((byte *)header + header->ofs_poses);
-			for( j = 0; j < header->num_poses; j++, pose++ ) {
+			for( j = 0; j < header->num_poses; j++, pose++, transform++ ) {
 				vec3_t	translate;
-				vec4_t	rotate;
+				quat_t	rotate;
 				vec3_t	scale;
-				float	mat1[12], mat2[12];
 
 				translate[0] = pose->channeloffset[0];
 				if( pose->mask & 0x001)
@@ -878,18 +922,9 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
 				if( pose->mask & 0x200)
 					scale[2] += *framedata++ * pose->channelscale[9];
 
-				// construct transformation matrix
-				JointToMatrix( rotate, scale, translate, mat1 );
-
-				if( pose->parent >= 0 ) {
-					Matrix34Multiply( iqmData->jointMats + 12 * pose->parent,
-							  mat1, mat2 );
-				} else {
-					Com_Memcpy( mat2, mat1, sizeof(mat1) );
-				}
-
-				Matrix34Multiply( mat2, jointInvMats + 12 * j, mat );
-				mat += 12;
+				VectorCopy( translate, transform->translate );
+				QuatNormalize2( rotate, transform->rotate );
+				VectorCopy( scale, transform->scale );
 			}
 		}
 	}
@@ -1128,37 +1163,59 @@ void R_AddIQMSurfaces( trRefEntity_t *ent ) {
 
 
 static void ComputePoseMats( iqmData_t *data, int frame, int oldframe,
-			      float backlerp, float *mat ) {
-	float	*mat1, *mat2;
-	int	*joint = data->jointParents;
-	int	i;
-
+			      float backlerp, float *poseMats ) {
+	iqmTransform_t relativeJoints[IQM_MAX_JOINTS];
+	iqmTransform_t *relativeJoint;
+	const iqmTransform_t *pose;
+	const iqmTransform_t *oldpose;
+	const int *jointParent;
+	const float *invBindMat;
+	float *poseMat, lerp;
+	int i;
+
+	relativeJoint = relativeJoints;
+
+	// copy or lerp animation frame pose
 	if ( oldframe == frame ) {
-		mat1 = data->poseMats + 12 * data->num_poses * frame;
-		for( i = 0; i < data->num_poses; i++, joint++ ) {
-			if( *joint >= 0 ) {
-				Matrix34Multiply( mat + 12 * *joint,
-						  mat1 + 12*i, mat + 12*i );
-			} else {
-				Com_Memcpy( mat + 12*i, mat1 + 12*i, 12 * sizeof(float) );
-			}
+		pose = &data->poses[frame * data->num_poses];
+		for ( i = 0; i < data->num_poses; i++, pose++, relativeJoint++ ) {
+			VectorCopy( pose->translate, relativeJoint->translate );
+			QuatCopy( pose->rotate, relativeJoint->rotate );
+			VectorCopy( pose->scale, relativeJoint->scale );
 		}
-	} else  {
-		mat1 = data->poseMats + 12 * data->num_poses * frame;
-		mat2 = data->poseMats + 12 * data->num_poses * oldframe;
-		
-		for( i = 0; i < data->num_poses; i++, joint++ ) {
-			if( *joint >= 0 ) {
-				float tmpMat[12];
-				InterpolateMatrix( mat1 + 12*i, mat2 + 12*i,
-						   backlerp, tmpMat );
-				Matrix34Multiply( mat + 12 * *joint,
-						  tmpMat, mat + 12*i );
-				
-			} else {
-				InterpolateMatrix( mat1 + 12*i, mat2 + 12*i,
-						   backlerp, mat + 12*i );
-			}
+	} else {
+		lerp = 1.0f - backlerp;
+		pose = &data->poses[frame * data->num_poses];
+		oldpose = &data->poses[oldframe * data->num_poses];
+		for ( i = 0; i < data->num_poses; i++, oldpose++, pose++, relativeJoint++ ) {
+			relativeJoint->translate[0] = oldpose->translate[0] * backlerp + pose->translate[0] * lerp;
+			relativeJoint->translate[1] = oldpose->translate[1] * backlerp + pose->translate[1] * lerp;
+			relativeJoint->translate[2] = oldpose->translate[2] * backlerp + pose->translate[2] * lerp;
+
+			relativeJoint->scale[0] = oldpose->scale[0] * backlerp + pose->scale[0] * lerp;
+			relativeJoint->scale[1] = oldpose->scale[1] * backlerp + pose->scale[1] * lerp;
+			relativeJoint->scale[2] = oldpose->scale[2] * backlerp + pose->scale[2] * lerp;
+
+			QuatSlerp( oldpose->rotate, pose->rotate, lerp, relativeJoint->rotate );
+		}
+	}
+
+	// multiply by inverse of bind pose and parent 'pose mat' (bind pose transform matrix)
+	relativeJoint = relativeJoints;
+	jointParent = data->jointParents;
+	invBindMat = data->invBindJoints;
+	poseMat = poseMats;
+	for ( i = 0; i < data->num_poses; i++, relativeJoint++, jointParent++, invBindMat += 12, poseMat += 12 ) {
+		float mat1[12], mat2[12];
+
+		JointToMatrix( relativeJoint->rotate, relativeJoint->scale, relativeJoint->translate, mat1 );
+
+		if ( *jointParent >= 0 ) {
+			Matrix34Multiply( &data->bindJoints[(*jointParent)*12], mat1, mat2 );
+			Matrix34Multiply( mat2, invBindMat, mat1 );
+			Matrix34Multiply( &poseMats[(*jointParent)*12], mat1, poseMat );
+		} else {
+			Matrix34Multiply( mat1, invBindMat, poseMat );
 		}
 	}
 }
@@ -1169,7 +1226,7 @@ static void ComputeJointMats( iqmData_t *data, int frame, int oldframe,
 	int	i;
 
 	if ( data->num_poses == 0 ) {
-		Com_Memcpy( mat, data->jointMats, data->num_joints * 12 * sizeof(float) );
+		Com_Memcpy( mat, data->bindJoints, data->num_joints * 12 * sizeof(float) );
 		return;
 	}
 
@@ -1181,7 +1238,7 @@ static void ComputeJointMats( iqmData_t *data, int frame, int oldframe,
 
 		Com_Memcpy(outmat, mat1, sizeof(outmat));
 
-		Matrix34Multiply( outmat, data->jointMats + 12*i, mat1 );
+		Matrix34Multiply( outmat, data->bindJoints + 12*i, mat1 );
 	}
 }
 
@@ -1245,20 +1302,21 @@ void RB_IQMSurfaceAnim( surfaceType_t *surface ) {
 			float *vtxMat = &influenceVtxMat[12*i];
 			float *nrmMat = &influenceNrmMat[9*i];
 			int	j;
-			float	blendWeights[4] = {0};
-			int		numWeights;
-
-			for ( numWeights = 0; numWeights < 4; numWeights++ ) {
-				if ( data->blendWeightsType == IQM_FLOAT )
-					blendWeights[numWeights] = data->influenceBlendWeights.f[4*influence + numWeights];
-				else
-					blendWeights[numWeights] = (float)data->influenceBlendWeights.b[4*influence + numWeights] / 255.0f;
+			float	blendWeights[4];
 
-				if ( blendWeights[numWeights] <= 0.0f )
-					break;
+			if ( data->blendWeightsType == IQM_FLOAT ) {
+				blendWeights[0] = data->influenceBlendWeights.f[4*influence + 0];
+				blendWeights[1] = data->influenceBlendWeights.f[4*influence + 1];
+				blendWeights[2] = data->influenceBlendWeights.f[4*influence + 2];
+				blendWeights[3] = data->influenceBlendWeights.f[4*influence + 3];
+			} else {
+				blendWeights[0] = (float)data->influenceBlendWeights.b[4*influence + 0] / 255.0f;
+				blendWeights[1] = (float)data->influenceBlendWeights.b[4*influence + 1] / 255.0f;
+				blendWeights[2] = (float)data->influenceBlendWeights.b[4*influence + 2] / 255.0f;
+				blendWeights[3] = (float)data->influenceBlendWeights.b[4*influence + 3] / 255.0f;
 			}
 
-			if ( numWeights == 0 ) {
+			if ( blendWeights[0] <= 0.0f ) {
 				// no blend joint, use identity matrix.
 				vtxMat[0] = identityMatrix[0];
 				vtxMat[1] = identityMatrix[1];
@@ -1288,7 +1346,11 @@ void RB_IQMSurfaceAnim( surfaceType_t *surface ) {
 				vtxMat[10] = blendWeights[0] * poseMats[12 * data->influenceBlendIndexes[4*influence + 0] + 10];
 				vtxMat[11] = blendWeights[0] * poseMats[12 * data->influenceBlendIndexes[4*influence + 0] + 11];
 
-				for( j = 1; j < numWeights; j++ ) {
+				for( j = 1; j < 4; j++ ) {
+					if ( blendWeights[j] <= 0.0f ) {
+						break;
+					}
+
 					vtxMat[0] += blendWeights[j] * poseMats[12 * data->influenceBlendIndexes[4*influence + j] + 0];
 					vtxMat[1] += blendWeights[j] * poseMats[12 * data->influenceBlendIndexes[4*influence + j] + 1];
 					vtxMat[2] += blendWeights[j] * poseMats[12 * data->influenceBlendIndexes[4*influence + j] + 2];
diff --git a/MP/code/sdl/sdl_glimp.c b/MP/code/sdl/sdl_glimp.c
index c5dbd08..94d1d87 100644
--- a/MP/code/sdl/sdl_glimp.c
+++ b/MP/code/sdl/sdl_glimp.c
@@ -62,8 +62,6 @@ static SDL_GLContext SDL_glContext = NULL;
 
 cvar_t *r_allowSoftwareGL; // Don't abort out if a hardware visual can't be obtained
 cvar_t *r_allowResize; // make window resizable
-cvar_t *r_windowPosx;
-cvar_t *r_windowPosy;
 cvar_t *r_centerWindow;
 cvar_t *r_sdlDriver;
 
@@ -77,7 +75,7 @@ void (APIENTRYP qglMultiTexCoord2fARB) (GLenum target, GLfloat s, GLfloat t);
 void (APIENTRYP qglLockArraysEXT) (GLint first, GLsizei count);
 void (APIENTRYP qglUnlockArraysEXT) (void);
 
-#define GLE(ret, name, ...) name##proc * qgl##name;
+#define GLE(ret, name, ...) name##proc * qgl##name = NULL;
 QGL_1_1_PROCS;
 QGL_1_1_FIXED_FUNCTION_PROCS;
 QGL_DESKTOP_1_1_PROCS;
@@ -101,19 +99,6 @@ GLimp_Shutdown
 */
 void GLimp_Shutdown( void )
 {
-	int x, y;
-	const char *posx;
-	const char *posy;
-
-	SDL_GetWindowPosition( SDL_window, &x, &y );
-	ri.Printf( PRINT_DEVELOPER, "Saving window position at %d,%d before closing.\n", x, y );
-
-	posx = va( "%d", x );
-	posy = va( "%d", y );
-
-	ri.Cvar_Set( "r_windowPosx", posx );
-	ri.Cvar_Set( "r_windowPosy", posy );
-
 	ri.IN_Shutdown();
 
 	SDL_QuitSubSystem( SDL_INIT_VIDEO );
@@ -341,7 +326,7 @@ static qboolean GLimp_GetProcAddresses( qboolean fixedFunction ) {
 	version = (const char *)qglGetString( GL_VERSION );
 
 	if ( !version ) {
-		Com_Error( ERR_FATAL, "GL_VERSION is NULL\n" );
+		Com_Error( ERR_FATAL, "GL_VERSION is NULL" );
 	}
 
 	if ( Q_stricmpn( "OpenGL ES", version, 9 ) == 0 ) {
@@ -357,7 +342,7 @@ static qboolean GLimp_GetProcAddresses( qboolean fixedFunction ) {
 	}
 
 	if ( fixedFunction ) {
-		if ( QGL_VERSION_ATLEAST( 1, 2 ) ) {
+		if ( QGL_VERSION_ATLEAST( 1, 1 ) ) {
 			QGL_1_1_PROCS;
 			QGL_1_1_FIXED_FUNCTION_PROCS;
 			QGL_DESKTOP_1_1_PROCS;
@@ -382,10 +367,10 @@ static qboolean GLimp_GetProcAddresses( qboolean fixedFunction ) {
 			qglFogi = GLimp_GLES_Fogi; /*Added*/
 #else
 			// error so this doesn't segfault due to NULL desktop GL functions being used
-			Com_Error( ERR_FATAL, "Unsupported OpenGL Version: %s\n", version );
+			Com_Error( ERR_FATAL, "Unsupported OpenGL Version: %s", version );
 #endif
 		} else {
-			Com_Error( ERR_FATAL, "Unsupported OpenGL Version (%s), OpenGL 1.2 is required\n", version );
+			Com_Error( ERR_FATAL, "Unsupported OpenGL Version (%s), OpenGL 1.1 is required", version );
 		}
 	} else {
 		if ( QGL_VERSION_ATLEAST( 2, 0 ) ) {
@@ -401,9 +386,9 @@ static qboolean GLimp_GetProcAddresses( qboolean fixedFunction ) {
 			QGL_1_5_PROCS;
 			QGL_2_0_PROCS;
 			// error so this doesn't segfault due to NULL desktop GL functions being used
-			Com_Error( ERR_FATAL, "Unsupported OpenGL Version: %s\n", version );
+			Com_Error( ERR_FATAL, "Unsupported OpenGL Version: %s", version );
 		} else {
-			Com_Error( ERR_FATAL, "Unsupported OpenGL Version (%s), OpenGL 2.0 is required\n", version );
+			Com_Error( ERR_FATAL, "Unsupported OpenGL Version (%s), OpenGL 2.0 is required", version );
 		}
 	}
 
@@ -545,6 +530,13 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, qboolean noborder, qbool
 	}
 	ri.Printf( PRINT_ALL, " %d %d\n", glConfig.vidWidth, glConfig.vidHeight);
 
+	// Center window
+	if( r_centerWindow->integer && !fullscreen )
+	{
+		x = ( desktopMode.w / 2 ) - ( glConfig.vidWidth / 2 );
+		y = ( desktopMode.h / 2 ) - ( glConfig.vidHeight / 2 );
+	}
+
 	// Destroy existing state if it exists
 	if( SDL_glContext != NULL )
 	{
@@ -655,7 +647,7 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, qboolean noborder, qbool
 			perChannelColorBits = 0; /* Use minimum size for 16-bit color */
 
 		/* Need alpha or else SGIs choose 36+ bit RGB mode */
-		SDL_GL_SetAttribute( SDL_GL_ALPHA_SIZE, 1 );
+		SDL_GL_SetAttribute( SDL_GL_ALPHA_SIZE, 1);
 #endif
 
 #ifdef USE_OPENGLES
@@ -674,54 +666,27 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, qboolean noborder, qbool
 		if(r_stereoEnabled->integer)
 		{
 			glConfig.stereoEnabled = qtrue;
-			SDL_GL_SetAttribute( SDL_GL_STEREO, 1 );
+			SDL_GL_SetAttribute(SDL_GL_STEREO, 1);
 		}
 		else
 		{
 			glConfig.stereoEnabled = qfalse;
-			SDL_GL_SetAttribute( SDL_GL_STEREO, 0 );
+			SDL_GL_SetAttribute(SDL_GL_STEREO, 0);
 		}
 		
 		SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
 
+#if 0 // if multisampling is enabled on X11, this causes create window to fail.
 		// If not allowing software GL, demand accelerated
 		if( !r_allowSoftwareGL->integer )
-		{
-			int value;
-
 			SDL_GL_SetAttribute( SDL_GL_ACCELERATED_VISUAL, 1 );
+#endif
 
-			//Fall back to allow either if setting attribute failed
-			if( SDL_GL_GetAttribute( SDL_GL_ACCELERATED_VISUAL, &value ) != 1 )
-				SDL_GL_SetAttribute( SDL_GL_ACCELERATED_VISUAL, -1 );
-		}
-
-		if( r_centerWindow->integer && !fullscreen )
- 		{
-			if( ( SDL_window = SDL_CreateWindow( CLIENT_WINDOW_TITLE, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
-					glConfig.vidWidth, glConfig.vidHeight, flags ) ) == NULL )
-			{
-				ri.Printf( PRINT_DEVELOPER, "SDL_CreateWindow failed: %s\n", SDL_GetError( ) );
-				continue;
-			}
-		}
-		else if ( ( r_windowPosx->integer || r_windowPosy->integer ) && !fullscreen )
+		if( ( SDL_window = SDL_CreateWindow( CLIENT_WINDOW_TITLE, x, y,
+				glConfig.vidWidth, glConfig.vidHeight, flags ) ) == NULL )
 		{
-			if( ( SDL_window = SDL_CreateWindow( CLIENT_WINDOW_TITLE, r_windowPosx->integer, r_windowPosy->integer,
-					glConfig.vidWidth, glConfig.vidHeight, flags ) ) == NULL )
-			{
-				ri.Printf( PRINT_DEVELOPER, "SDL_CreateWindow failed: %s\n", SDL_GetError( ) );
-				continue;
-			}
- 		}
-		else
-		{
-			if( ( SDL_window = SDL_CreateWindow( CLIENT_WINDOW_TITLE, x, y,
-					glConfig.vidWidth, glConfig.vidHeight, flags ) ) == NULL )
-			{
-				ri.Printf( PRINT_DEVELOPER, "SDL_CreateWindow failed: %s\n", SDL_GetError( ) );
-				continue;
-			}
+			ri.Printf( PRINT_DEVELOPER, "SDL_CreateWindow failed: %s\n", SDL_GetError( ) );
+			continue;
 		}
 
 		if( fullscreen )
@@ -790,7 +755,7 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, qboolean noborder, qbool
 					ri.Printf( PRINT_ALL, "GLimp_GetProcAddresses() failed for OpenGL 3.2 core context\n" );
 					renderer = NULL;
 				}
- 
+
 				if (!renderer || (strstr(renderer, "Software Renderer") || strstr(renderer, "Software Rasterizer")))
 				{
 					if ( renderer )
@@ -883,6 +848,7 @@ static qboolean GLimp_StartDriverAndSetMode(int mode, qboolean fullscreen, qbool
 	if (!SDL_WasInit(SDL_INIT_VIDEO))
 	{
 		const char *driverName;
+		SDL_version linked;
 
 		if (SDL_Init(SDL_INIT_VIDEO) != 0)
 		{
@@ -890,6 +856,8 @@ static qboolean GLimp_StartDriverAndSetMode(int mode, qboolean fullscreen, qbool
 			return qfalse;
 		}
 
+		SDL_GetVersion(&linked);
+		ri.Printf( PRINT_ALL, "SDL version %d.%d.%d\n", linked.major, linked.minor, linked.patch);
 		driverName = SDL_GetCurrentVideoDriver( );
 		ri.Printf( PRINT_ALL, "SDL using driver \"%s\"\n", driverName );
 		ri.Cvar_Set( "r_sdlDriver", driverName );
@@ -978,7 +946,6 @@ static void GLimp_InitExtensions( qboolean fixedFunction )
 		}
 	}
 
-
 	// OpenGL 1 fixed function pipeline
 	if ( fixedFunction )
 	{
@@ -1115,6 +1082,17 @@ static void GLimp_InitExtensions( qboolean fixedFunction )
 	{
 		ri.Printf( PRINT_ALL, "...GL_EXT_texture_filter_anisotropic not found\n" );
 	}
+
+	haveClampToEdge = qfalse;
+	if ( QGL_VERSION_ATLEAST( 1, 2 ) || QGLES_VERSION_ATLEAST( 1, 0 ) || SDL_GL_ExtensionSupported( "GL_SGIS_texture_edge_clamp" ) )
+	{
+		ri.Printf( PRINT_ALL, "...using GL_SGIS_texture_edge_clamp\n" );
+		haveClampToEdge = qtrue;
+	}
+	else
+	{
+		ri.Printf( PRINT_ALL, "...GL_SGIS_texture_edge_clamp not found\n" );
+	}
 }
 
 #define R_MODE_FALLBACK 3 // 640 * 480
@@ -1134,8 +1112,6 @@ void GLimp_Init( qboolean fixedFunction )
 	r_allowSoftwareGL = ri.Cvar_Get( "r_allowSoftwareGL", "0", CVAR_LATCH );
 	r_sdlDriver = ri.Cvar_Get( "r_sdlDriver", "", CVAR_ROM );
 	r_allowResize = ri.Cvar_Get( "r_allowResize", "0", CVAR_ARCHIVE | CVAR_LATCH );
-	r_windowPosx = ri.Cvar_Get( "r_windowPosx", "0", CVAR_ARCHIVE );
-	r_windowPosy = ri.Cvar_Get( "r_windowPosy", "0", CVAR_ARCHIVE );
 	r_centerWindow = ri.Cvar_Get( "r_centerWindow", "0", CVAR_ARCHIVE | CVAR_LATCH );
 
 	if( ri.Cvar_VariableIntegerValue( "com_abnormalExit" ) )
@@ -1247,8 +1223,8 @@ void GLimp_EndFrame( void )
 
 	if( r_fullscreen->modified )
 	{
-		qboolean	fullscreen;
-		qboolean	needToToggle;
+		int         fullscreen;
+		qboolean    needToToggle;
 
 		// Find out the current state
 		fullscreen = !!( SDL_GetWindowFlags( SDL_window ) & SDL_WINDOW_FULLSCREEN );
@@ -1266,10 +1242,13 @@ void GLimp_EndFrame( void )
 		if( needToToggle )
 		{
 			// Need the vid_restart here since r_fullscreen is only latched
-			if( fullscreen ) {
+			if( fullscreen )
+			{
 				Com_Printf( "Switching to windowed rendering\n" );
 				ri.Cmd_ExecuteText(EXEC_APPEND, "vid_restart\n");
-			} else {
+			}
+			else
+			{
 				Com_Printf( "Switching to fullscreen rendering\n" );
 				ri.Cmd_ExecuteText(EXEC_APPEND, "vid_restart\n");
 			}
diff --git a/MP/code/sdl/sdl_input.c b/MP/code/sdl/sdl_input.c
index f6adb36..ce55c9b 100644
--- a/MP/code/sdl/sdl_input.c
+++ b/MP/code/sdl/sdl_input.c
@@ -33,6 +33,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #include "../client/client.h"
 #include "../sys/sys_local.h"
 
+#if !SDL_VERSION_ATLEAST(2, 0, 17)
+#define KMOD_SCROLL KMOD_RESERVED
+#endif
+
 static cvar_t *in_keyboardDebug     = NULL;
 
 static SDL_GameController *gamepad = NULL;
@@ -84,7 +88,7 @@ static void IN_PrintKey( const SDL_Keysym *keysym, keyNum_t key, qboolean down )
 	if( keysym->mod & KMOD_NUM )      Com_Printf( " KMOD_NUM" );
 	if( keysym->mod & KMOD_CAPS )     Com_Printf( " KMOD_CAPS" );
 	if( keysym->mod & KMOD_MODE )     Com_Printf( " KMOD_MODE" );
-	if( keysym->mod & KMOD_RESERVED ) Com_Printf( " KMOD_RESERVED" );
+	if( keysym->mod & KMOD_SCROLL )   Com_Printf( " KMOD_SCROLL" );
 
 	Com_Printf( " Q:0x%02x(%s)\n", key, Key_KeynumToString( key, qtrue ) );
 }
@@ -490,7 +494,8 @@ static void IN_InitJoystick( void )
 	}
 
 	total = SDL_NumJoysticks();
-	Com_DPrintf("%d possible joysticks\n", total);
+	if ( total )
+		Com_Printf("%d possible joysticks\n", total);
 
 	// Print list and build cvar to allow ui to select joystick.
 	for (i = 0; i < total; i++)
@@ -1123,9 +1128,7 @@ static void IN_ProcessEvents( void )
 							width = e.window.data1;
 							height = e.window.data2;
 
-							// check for fullscreen
-							// SDL_WINDOWEVENT_RESIZED occurs when requested resolution != given resolution
-							// This prevents an infinite vid_restart loop 
+							// ignore this event on fullscreen
 							if( cls.glconfig.isFullscreen )
 							{
 								break;
diff --git a/MP/code/sdl/sdl_snd.c b/MP/code/sdl/sdl_snd.c
index eb0dd58..09cc87f 100644
--- a/MP/code/sdl/sdl_snd.c
+++ b/MP/code/sdl/sdl_snd.c
@@ -187,6 +187,7 @@ qboolean SNDDMA_Init(void)
 {
 	SDL_AudioSpec desired;
 	SDL_AudioSpec obtained;
+	SDL_version linked;
 	int tmp;
 
 	if (snd_inited)
@@ -200,16 +201,17 @@ qboolean SNDDMA_Init(void)
 		s_sdlMixSamps = Cvar_Get("s_sdlMixSamps", "0", CVAR_ARCHIVE);
 	}
 
-	Com_Printf( "SDL_Init( SDL_INIT_AUDIO )... " );
+	Com_DPrintf( "SDL_Init( SDL_INIT_AUDIO )... " );
 
 	if (SDL_Init(SDL_INIT_AUDIO) != 0)
 	{
-		Com_Printf( "FAILED (%s)\n", SDL_GetError( ) );
+		Com_Printf( "SDL_Init( SDL_INIT_AUDIO ) FAILED (%s)\n", SDL_GetError( ) );
 		return qfalse;
 	}
 
-	Com_Printf( "OK\n" );
-
+	Com_DPrintf( "OK\n" );
+	SDL_GetVersion(&linked);
+	Com_Printf( "SDL version %d.%d.%d\n", linked.major, linked.minor, linked.patch);
 	Com_Printf( "SDL audio driver is \"%s\".\n", SDL_GetCurrentAudioDriver( ) );
 
 	memset(&desired, '\0', sizeof (desired));
@@ -281,12 +283,7 @@ qboolean SNDDMA_Init(void)
 #ifdef USE_SDL_AUDIO_CAPTURE
 	// !!! FIXME: some of these SDL_OpenAudioDevice() values should be cvars.
 	s_sdlCapture = Cvar_Get( "s_sdlCapture", "1", CVAR_ARCHIVE | CVAR_LATCH );
-	// !!! FIXME: pulseaudio capture records audio the entire time the program is running. https://bugzilla.libsdl.org/show_bug.cgi?id=4087
-	if (Q_stricmp(SDL_GetCurrentAudioDriver(), "pulseaudio") == 0)
-	{
-		Com_Printf("SDL audio capture support disabled for pulseaudio (https://bugzilla.libsdl.org/show_bug.cgi?id=4087)\n");
-	}
-	else if (!s_sdlCapture->integer)
+	if (!s_sdlCapture->integer)
 	{
 		Com_Printf("SDL audio capture support disabled by user ('+set s_sdlCapture 1' to enable)\n");
 	}
diff --git a/MP/code/sys/sys_main.c b/MP/code/sys/sys_main.c
index 481a123..1858906 100644
--- a/MP/code/sys/sys_main.c
+++ b/MP/code/sys/sys_main.c
@@ -579,7 +579,7 @@ Used to load a development dll instead of a virtual machine
 =================
 */
 void *Sys_LoadGameDll(const char *name,
-	intptr_t (QDECL **entryPoint)(intptr_t, ...),
+	vmMainProc *entryPoint,
 	intptr_t (*systemcalls)(intptr_t, ...))
 {
 	void *libHandle;
diff --git a/MP/code/sys/sys_unix.c b/MP/code/sys/sys_unix.c
index acd3bc2..4ab1010 100644
--- a/MP/code/sys/sys_unix.c
+++ b/MP/code/sys/sys_unix.c
@@ -964,6 +964,14 @@ qboolean Sys_DllExtension( const char *name ) {
 		return qtrue;
 	}
 
+#ifdef __APPLE__
+	// Allow system frameworks without dylib extensions
+	// i.e., /System/Library/Frameworks/OpenAL.framework/OpenAL
+	if ( strncmp( name, "/System/Library/Frameworks/", 27 ) == 0 ) {
+		return qtrue;
+	}
+#endif
+
 	// Check for format of filename.so.1.2.3
 	p = strstr( name, DLL_EXT "." );
 
diff --git a/MP/code/tools/stringify.c b/MP/code/tools/stringify.c
new file mode 100644
index 0000000..a5ce84b
--- /dev/null
+++ b/MP/code/tools/stringify.c
@@ -0,0 +1,51 @@
+#include <stdio.h>
+#include <ctype.h>
+#include <string.h>
+#include <libgen.h>
+
+int main(int argc, char **argv)
+{
+    FILE *ifp;
+    FILE *ofp;
+    char buffer[1024];
+
+    if(argc < 3)
+        return 1;
+
+    char *inFile = argv[1];
+    char *outFile = argv[2];
+
+    ifp = fopen(inFile, "r");
+    if(!ifp)
+        return 2;
+
+    ofp = fopen(outFile, "w");
+    if(!ofp)
+        return 3;
+
+    // Strip extension
+    char *base = basename(inFile);
+    *strrchr(base, '.') = '\0';
+
+    fprintf(ofp, "const char *fallbackShader_%s =\n", base);
+
+    while(fgets(buffer, sizeof(buffer), ifp))
+    {
+        // Strip trailing whitespace from line
+        char *end = buffer + strlen(buffer) - 1;
+        while(end >= buffer && isspace(*end))
+            end--;
+
+        end[1] = '\0';
+
+        // Write line enquoted, with a newline
+        fprintf(ofp, "\"%s\\n\"\n", buffer);
+    }
+
+    fprintf(ofp, ";\n");
+
+    fclose(ifp);
+    fclose(ofp);
+
+    return 0;
+}
diff --git a/MP/code/ui/ui_main.c b/MP/code/ui/ui_main.c
index 5d569ba..4359c2e 100644
--- a/MP/code/ui/ui_main.c
+++ b/MP/code/ui/ui_main.c
@@ -783,7 +783,7 @@ void Text_AutoWrap_Paint( float x, float y, int width, int height, float scale,
 	char text[1024];
 	char *ret, *end, *next;
 	char s;
-	vec4_t aux_color, next_color;
+	vec4_t aux_color, next_color = { 0 };
 
 	Q_strncpyz( text, l_text, sizeof( text ) - 1 );
 	ret = text;
@@ -4653,8 +4653,7 @@ static void UI_RunMenuScript( char **args ) {
 			trap_Cvar_Set( "cdkey2", "" );
 			trap_Cvar_Set( "cdkey3", "" );
 			trap_Cvar_Set( "cdkey4", "" );
-			trap_Cvar_Set( "cdkeychecksum", "" );
-			if ( buff[0] != 32 && strlen( buff ) == CDKEY_LEN ) {
+			if ( strlen( buff ) == CDKEY_LEN ) {
 				Q_strncpyz( out, buff, 5 );
 				trap_Cvar_Set( "cdkey1", out );
 				Q_strncpyz( out, buff + 4, 5 );
diff --git a/MP/code/ui/ui_shared.c b/MP/code/ui/ui_shared.c
index 3059107..967c169 100644
--- a/MP/code/ui/ui_shared.c
+++ b/MP/code/ui/ui_shared.c
@@ -3569,7 +3569,7 @@ void Item_TextField_Paint( itemDef_t *item ) {
 	do
 	{
 		field_offset++;
-		if ( buff + editPtr->paintOffset + field_offset == '\0' ) {
+		if ( buff + editPtr->paintOffset + field_offset == NULL ) {
 			break;                                                   // keep it safe
 		}
 		text_len = DC->textWidth( buff + editPtr->paintOffset + field_offset, item->textscale, 0 );
diff --git a/MP/make-macosx-app.sh b/MP/make-macosx-app.sh
new file mode 100755
index 0000000..091725d
--- /dev/null
+++ b/MP/make-macosx-app.sh
@@ -0,0 +1,412 @@
+#!/bin/bash
+
+# Let's make the user give us a target to work with.
+# architecture is assumed universal if not specified, and is optional.
+# if arch is defined, it we will store the .app bundle in the target arch build directory
+if [ $# == 0 ] || [ $# -gt 2 ]; then
+	echo "Usage:   $0 target <arch>"
+	echo "Example: $0 release x86"
+	echo "Valid targets are:"
+	echo " release"
+	echo " debug"
+	echo
+	echo "Optional architectures are:"
+	echo " x86"
+	echo " x86_64"
+	echo " ppc"
+	echo " arm64"
+	echo
+	exit 1
+fi
+
+# validate target name
+if [ "$1" == "release" ]; then
+	TARGET_NAME="release"
+elif [ "$1" == "debug" ]; then
+	TARGET_NAME="debug"
+else
+	echo "Invalid target: $1"
+	echo "Valid targets are:"
+	echo " release"
+	echo " debug"
+	exit 1
+fi
+
+CURRENT_ARCH=""
+
+# validate the architecture if it was specified
+if [ "$2" != "" ]; then
+	if [ "$2" == "x86" ]; then
+		CURRENT_ARCH="x86"
+	elif [ "$2" == "x86_64" ]; then
+		CURRENT_ARCH="x86_64"
+	elif [ "$2" == "ppc" ]; then
+		CURRENT_ARCH="ppc"
+	elif [ "$2" == "arm64" ]; then
+		CURRENT_ARCH="arm64"
+	else
+		echo "Invalid architecture: $2"
+		echo "Valid architectures are:"
+		echo " x86"
+		echo " x86_64"
+		echo " ppc"
+		echo " arm64"
+		echo
+		exit 1
+	fi
+fi
+
+# symlinkArch() creates a symlink with the architecture suffix.
+# meant for universal binaries, but also handles the way this script generates
+# application bundles for a single architecture as well.
+function symlinkArch()
+{
+    EXT="dylib"
+    SEP="${3}"
+    SRCFILE="${1}"
+    DSTFILE="${2}${SEP}"
+    DSTPATH="${4}"
+
+    if [ ! -e "${DSTPATH}/${SRCFILE}.${EXT}" ]; then
+        echo "**** ERROR: missing ${SRCFILE}.${EXT} from ${MACOS}"
+        exit 1
+    fi
+
+    if [ ! -d "${DSTPATH}" ]; then
+        echo "**** ERROR: path not found ${DSTPATH}"
+        exit 1
+    fi
+
+    pushd "${DSTPATH}" > /dev/null
+
+    IS32=`file "${SRCFILE}.${EXT}" | grep "i386"`
+    IS64=`file "${SRCFILE}.${EXT}" | grep "x86_64"`
+    ISPPC=`file "${SRCFILE}.${EXT}" | grep "ppc"`
+    ISARM=`file "${SRCFILE}.${EXT}" | grep "arm64"`
+
+    if [ "${IS32}" != "" ]; then
+        if [ ! -L "${DSTFILE}i386.${EXT}" ]; then
+            ln -s "${SRCFILE}.${EXT}" "${DSTFILE}i386.${EXT}"
+        fi
+    elif [ -L "${DSTFILE}i386.${EXT}" ]; then
+        rm "${DSTFILE}i386.${EXT}"
+    fi
+
+    if [ "${IS64}" != "" ]; then
+        if [ ! -L "${DSTFILE}x86_64.${EXT}" ]; then
+            ln -s "${SRCFILE}.${EXT}" "${DSTFILE}x86_64.${EXT}"
+        fi
+    elif [ -L "${DSTFILE}x86_64.${EXT}" ]; then
+        rm "${DSTFILE}x86_64.${EXT}"
+    fi
+
+    if [ "${ISPPC}" != "" ]; then
+        if [ ! -L "${DSTFILE}ppc.${EXT}" ]; then
+            ln -s "${SRCFILE}.${EXT}" "${DSTFILE}ppc.${EXT}"
+        fi
+    elif [ -L "${DSTFILE}ppc.${EXT}" ]; then
+        rm "${DSTFILE}ppc.${EXT}"
+    fi
+
+    if [ "${ISARM}" != "" ]; then
+        if [ ! -L "${DSTFILE}arm64.${EXT}" ]; then
+            ln -s "${SRCFILE}.${EXT}" "${DSTFILE}arm64.${EXT}"
+        fi
+    elif [ -L "${DSTFILE}arm64.${EXT}" ]; then
+        rm "${DSTFILE}arm64.${EXT}"
+    fi
+
+    popd > /dev/null
+}
+
+SEARCH_ARCHS="	\
+	x86	\
+	x86_64	\
+	ppc	\
+	arm64 \
+"
+
+HAS_LIPO=`command -v lipo`
+HAS_CP=`command -v cp`
+
+# if lipo is not available, we cannot make a universal binary, print a warning
+if [ ! -x "${HAS_LIPO}" ] && [ "${CURRENT_ARCH}" == "" ]; then
+	CURRENT_ARCH=`uname -m`
+	if [ "${CURRENT_ARCH}" == "i386" ]; then CURRENT_ARCH="x86"; fi
+	echo "$0 cannot make a universal binary, falling back to architecture ${CURRENT_ARCH}"
+fi
+
+# if the optional arch parameter is used, replace SEARCH_ARCHS to only work with one
+if [ "${CURRENT_ARCH}" != "" ]; then
+	SEARCH_ARCHS="${CURRENT_ARCH}"
+fi
+
+AVAILABLE_ARCHS=""
+
+IORTCW_VERSION=`grep '^VERSION=' Makefile | sed -e 's/.*=\(.*\)/\1/'`
+IORTCW_CLIENT_ARCHS=""
+IORTCW_SERVER_ARCHS=""
+IORTCW_RENDERER_GL1_ARCHS=""
+IORTCW_RENDERER_GL2_ARCHS=""
+IORTCW_CGAME_ARCHS=""
+IORTCW_GAME_ARCHS=""
+IORTCW_UI_ARCHS=""
+
+BASEDIR="main"
+
+CGAME="cgame.mp"
+GAME="qagame.mp"
+UI="ui.mp"
+
+RENDERER_OPENGL="renderer_mp_opengl1"
+RENDERER_OPENGL2="renderer_mp_rend2"
+
+DEDICATED_NAME="iowolfded"
+
+CGAME_NAME="${CGAME}.dylib"
+GAME_NAME="${GAME}.dylib"
+UI_NAME="${UI}.dylib"
+
+RENDERER_OPENGL1_NAME="renderer_mp_opengl1.dylib"
+RENDERER_OPENGL2_NAME="renderer_mp_rend2.dylib"
+
+ICNSDIR="misc"
+ICNS="iortcw.icns"
+PKGINFO="APPLIORTCW"
+
+OBJROOT="build"
+#BUILT_PRODUCTS_DIR="${OBJROOT}/${TARGET_NAME}-darwin-${CURRENT_ARCH}"
+PRODUCT_NAME="iowolfmp"
+WRAPPER_EXTENSION="app"
+WRAPPER_NAME="${PRODUCT_NAME}.${WRAPPER_EXTENSION}"
+CONTENTS_FOLDER_PATH="${WRAPPER_NAME}/Contents"
+UNLOCALIZED_RESOURCES_FOLDER_PATH="${CONTENTS_FOLDER_PATH}/Resources"
+EXECUTABLE_FOLDER_PATH="${CONTENTS_FOLDER_PATH}/MacOS"
+EXECUTABLE_NAME="${PRODUCT_NAME}"
+
+# loop through the architectures to build string lists for each universal binary
+for ARCH in $SEARCH_ARCHS; do
+	CURRENT_ARCH=${ARCH}
+
+	if [ ${CURRENT_ARCH} == "x86" ]; then FILE_ARCH="i386"; fi
+	if [ ${CURRENT_ARCH} == "x86_64" ]; then FILE_ARCH="x86_64"; fi
+	if [ ${CURRENT_ARCH} == "ppc" ]; then FILE_ARCH="ppc"; fi
+	if [ ${CURRENT_ARCH} == "arm64" ]; then FILE_ARCH="arm64"; fi
+
+	BUILT_PRODUCTS_DIR="${OBJROOT}/${TARGET_NAME}-darwin-${CURRENT_ARCH}"
+	IORTCW_CLIENT="${EXECUTABLE_NAME}.${CURRENT_ARCH}"
+	IORTCW_SERVER="${DEDICATED_NAME}.${CURRENT_ARCH}"
+	IORTCW_RENDERER_GL1="${RENDERER_OPENGL}_${FILE_ARCH}.dylib"
+	IORTCW_RENDERER_GL2="${RENDERER_OPENGL2}_${FILE_ARCH}.dylib"
+	IORTCW_CGAME="${CGAME}.${FILE_ARCH}.dylib"
+	IORTCW_GAME="${GAME}.${FILE_ARCH}.dylib"
+	IORTCW_UI="${UI}.${FILE_ARCH}.dylib"
+
+	if [ ! -d ${BUILT_PRODUCTS_DIR} ]; then
+		CURRENT_ARCH=""
+		BUILT_PRODUCTS_DIR=""
+		continue
+	fi
+
+	# executables
+	if [ -e ${BUILT_PRODUCTS_DIR}/${IORTCW_CLIENT} ]; then
+		IORTCW_CLIENT_ARCHS="${BUILT_PRODUCTS_DIR}/${IORTCW_CLIENT} ${IORTCW_CLIENT_ARCHS}"
+		VALID_ARCHS="${ARCH} ${VALID_ARCHS}"
+	else
+		continue
+	fi
+	if [ -e ${BUILT_PRODUCTS_DIR}/${IORTCW_SERVER} ]; then
+		IORTCW_SERVER_ARCHS="${BUILT_PRODUCTS_DIR}/${IORTCW_SERVER} ${IORTCW_SERVER_ARCHS}"
+	fi
+
+	# renderers
+	if [ -e ${BUILT_PRODUCTS_DIR}/${IORTCW_RENDERER_GL1} ]; then
+		IORTCW_RENDERER_GL1_ARCHS="${BUILT_PRODUCTS_DIR}/${IORTCW_RENDERER_GL1} ${IORTCW_RENDERER_GL1_ARCHS}"
+	fi
+	if [ -e ${BUILT_PRODUCTS_DIR}/${IORTCW_RENDERER_GL2} ]; then
+		IORTCW_RENDERER_GL2_ARCHS="${BUILT_PRODUCTS_DIR}/${IORTCW_RENDERER_GL2} ${IORTCW_RENDERER_GL2_ARCHS}"
+	fi
+
+	# game
+	if [ -e ${BUILT_PRODUCTS_DIR}/${BASEDIR}/${IORTCW_CGAME} ]; then
+		IORTCW_CGAME_ARCHS="${BUILT_PRODUCTS_DIR}/${BASEDIR}/${IORTCW_CGAME} ${IORTCW_CGAME_ARCHS}"
+	fi
+	if [ -e ${BUILT_PRODUCTS_DIR}/${BASEDIR}/${IORTCW_GAME} ]; then
+		IORTCW_GAME_ARCHS="${BUILT_PRODUCTS_DIR}/${BASEDIR}/${IORTCW_GAME} ${IORTCW_GAME_ARCHS}"
+	fi
+	if [ -e ${BUILT_PRODUCTS_DIR}/${BASEDIR}/${IORTCW_UI} ]; then
+		IORTCW_UI_ARCHS="${BUILT_PRODUCTS_DIR}/${BASEDIR}/${IORTCW_UI} ${IORTCW_UI_ARCHS}"
+	fi
+
+	#echo "valid arch: ${ARCH}"
+done
+
+# final preparations and checks before attempting to make the application bundle
+cd `dirname $0`
+
+if [ ! -f Makefile ]; then
+	echo "$0 must be run from the iortcw build directory"
+	exit 1
+fi
+
+if [ "${IORTCW_CLIENT_ARCHS}" == "" ]; then
+	echo "$0: no iortcw binary architectures were found for target '${TARGET_NAME}'"
+	exit 1
+fi
+
+# set the final application bundle output directory
+if [ "${2}" == "" ]; then
+	BUILT_PRODUCTS_DIR="${OBJROOT}/${TARGET_NAME}-darwin-universal"
+	if [ ! -d ${BUILT_PRODUCTS_DIR} ]; then
+		mkdir -p ${BUILT_PRODUCTS_DIR} || exit 1;
+	fi
+else
+	BUILT_PRODUCTS_DIR="${OBJROOT}/${TARGET_NAME}-darwin-${CURRENT_ARCH}"
+fi
+
+BUNDLEBINDIR="${BUILT_PRODUCTS_DIR}/${EXECUTABLE_FOLDER_PATH}"
+
+
+# here we go
+echo "Creating bundle '${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}'"
+echo "with architectures:"
+for ARCH in ${VALID_ARCHS}; do
+	echo " ${ARCH}"
+done
+echo ""
+
+# make the application bundle directories
+if [ ! -d "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_FOLDER_PATH}/$BASEDIR" ]; then
+	mkdir -p "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_FOLDER_PATH}/$BASEDIR" || exit 1;
+fi
+if [ ! -d "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" ]; then
+	mkdir -p "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" || exit 1;
+fi
+
+# copy and generate some application bundle resources
+cp code/libs/macosx/*.dylib "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_FOLDER_PATH}"
+cp ${ICNSDIR}/${ICNS} "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/$ICNS" || exit 1;
+echo -n ${PKGINFO} > "${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/PkgInfo" || exit 1;
+
+# create Info.Plist
+PLIST="<?xml version=\"1.0\" encoding=\"UTF-8\"?>
+<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
+<plist version=\"1.0\">
+<dict>
+    <key>CFBundleDevelopmentRegion</key>
+    <string>en</string>
+    <key>CFBundleExecutable</key>
+    <string>${EXECUTABLE_NAME}</string>
+    <key>CFBundleIconFile</key>
+    <string>iortcw</string>
+    <key>CFBundleIdentifier</key>
+    <string>org.iortcw.${PRODUCT_NAME}</string>
+    <key>CFBundleInfoDictionaryVersion</key>
+    <string>6.0</string>
+    <key>CFBundleName</key>
+    <string>${PRODUCT_NAME}</string>
+    <key>CFBundlePackageType</key>
+    <string>APPL</string>
+    <key>CFBundleShortVersionString</key>
+    <string>${IORTCW_VERSION}</string>
+    <key>CFBundleSignature</key>
+    <string>????</string>
+    <key>CFBundleVersion</key>
+    <string>${IORTCW_VERSION}</string>
+    <key>CGDisableCoalescedUpdates</key>
+    <true/>
+    <key>LSMinimumSystemVersion</key>
+    <string>${MACOSX_DEPLOYMENT_TARGET}</string>"
+
+if [ -n "${MACOSX_DEPLOYMENT_TARGET_PPC}" ] || [ -n "${MACOSX_DEPLOYMENT_TARGET_X86}" ] || [ -n "${MACOSX_DEPLOYMENT_TARGET_X86_64}" ] || [ -n "${MACOSX_DEPLOYMENT_TARGET_ARM64}" ]; then
+	PLIST="${PLIST}
+    <key>LSMinimumSystemVersionByArchitecture</key>
+    <dict>"
+
+	if [ -n "${MACOSX_DEPLOYMENT_TARGET_PPC}" ]; then
+	PLIST="${PLIST}
+        <key>ppc</key>
+        <string>${MACOSX_DEPLOYMENT_TARGET_PPC}</string>"
+	fi
+
+	if [ -n "${MACOSX_DEPLOYMENT_TARGET_X86}" ]; then
+	PLIST="${PLIST}
+        <key>i386</key>
+        <string>${MACOSX_DEPLOYMENT_TARGET_X86}</string>"
+	fi
+
+	if [ -n "${MACOSX_DEPLOYMENT_TARGET_X86_64}" ]; then
+	PLIST="${PLIST}
+        <key>x86_64</key>
+        <string>${MACOSX_DEPLOYMENT_TARGET_X86_64}</string>"
+	fi
+
+	if [ -n "${MACOSX_DEPLOYMENT_TARGET_ARM64}" ]; then
+	PLIST="${PLIST}
+        <key>arm64</key>
+        <string>${MACOSX_DEPLOYMENT_TARGET_ARM64}</string>"
+	fi
+
+	PLIST="${PLIST}
+    </dict>"
+fi
+
+PLIST="${PLIST}
+    <key>NSHumanReadableCopyright</key>
+    <string>Return to Castle Wolfenstein multiplayer Copyright (C) 1999-2010 id Software LLC, a ZeniMax Media company.</string>
+    <key>NSPrincipalClass</key>
+    <string>NSApplication</string>
+    <key>NSHighResolutionCapable</key>
+    <false/>
+</dict>
+</plist>
+"
+echo -e "${PLIST}" > "${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Info.plist"
+
+# action takes care of generating universal binaries if lipo is available
+# otherwise, it falls back to using a simple copy, expecting the first item in
+# the second parameter list to be the desired architecture
+function action()
+{
+	COMMAND=""
+
+	if [ -x "${HAS_LIPO}" ]; then
+		COMMAND="${HAS_LIPO} -create -o"
+		$HAS_LIPO -create -o "${1}" ${2} # make sure $2 is treated as a list of files
+	elif [ -x ${HAS_CP} ]; then
+		COMMAND="${HAS_CP}"
+		SRC="${2// */}" # in case there is a list here, use only the first item
+		$HAS_CP "${SRC}" "${1}"
+	else
+		"$0 cannot create an application bundle."
+		exit 1
+	fi
+
+	#echo "${COMMAND}" "${1}" "${2}"
+}
+
+#
+# the meat of universal binary creation
+# destination file names do not have architecture suffix.
+# action will handle merging universal binaries if supported.
+# symlink appropriate architecture names for universal (fat) binary support.
+#
+
+# executables
+action "${BUNDLEBINDIR}/${EXECUTABLE_NAME}"				"${IORTCW_CLIENT_ARCHS}"
+action "${BUNDLEBINDIR}/${DEDICATED_NAME}"				"${IORTCW_SERVER_ARCHS}"
+
+# renderers
+action "${BUNDLEBINDIR}/${RENDERER_OPENGL1_NAME}"		"${IORTCW_RENDERER_GL1_ARCHS}"
+action "${BUNDLEBINDIR}/${RENDERER_OPENGL2_NAME}"		"${IORTCW_RENDERER_GL2_ARCHS}"
+symlinkArch "${RENDERER_OPENGL}" "${RENDERER_OPENGL}" "_" "${BUNDLEBINDIR}"
+symlinkArch "${RENDERER_OPENGL2}" "${RENDERER_OPENGL2}" "_" "${BUNDLEBINDIR}"
+
+# game
+action "${BUNDLEBINDIR}/${BASEDIR}/${CGAME_NAME}"		"${IORTCW_CGAME_ARCHS}"
+action "${BUNDLEBINDIR}/${BASEDIR}/${GAME_NAME}"		"${IORTCW_GAME_ARCHS}"
+action "${BUNDLEBINDIR}/${BASEDIR}/${UI_NAME}"			"${IORTCW_UI_ARCHS}"
+symlinkArch "${CGAME}"	"${CGAME}."	""	"${BUNDLEBINDIR}/${BASEDIR}"
+symlinkArch "${GAME}"	"${GAME}."	""	"${BUNDLEBINDIR}/${BASEDIR}"
+symlinkArch "${UI}"		"${UI}."		""	"${BUNDLEBINDIR}/${BASEDIR}"
+
diff --git a/MP/make-macosx-ub.sh b/MP/make-macosx-ub.sh
index 60ea1c7..fe33fa4 100755
--- a/MP/make-macosx-ub.sh
+++ b/MP/make-macosx-ub.sh
@@ -1,79 +1,60 @@
-#!/bin/sh
+#!/bin/bash
 CC=gcc-4.0
-APPBUNDLE=iowolfmp.app
-BINARY=iowolfmp.ub
-DEDBIN=iowolfded.ub
-PKGINFO=APPLIOWOLFMP
-ICNS=misc/iortcw.icns
-DESTDIR=build/release-darwin-ub
-BASEDIR=main
-
-BIN_OBJ="
-	build/release-darwin-x86_64/iowolfmp.x86_64
-	build/release-darwin-x86/iowolfmp.x86
-	build/release-darwin-ppc/iowolfmp.ppc
-"
-BIN_DEDOBJ="
-	build/release-darwin-x86_64/iowolfded.x86_64
-	build/release-darwin-x86/iowolfded.x86
-	build/release-darwin-ppc/iowolfded.ppc
-"
-BASE_OBJ="
-	build/release-darwin-x86_64/$BASEDIR/cgame.mp.x86_64.dylib
-	build/release-darwin-x86/$BASEDIR/cgame.mp.i386.dylib
-	build/release-darwin-ppc/$BASEDIR/cgame.mp.ppc.dylib
-	build/release-darwin-x86_64/$BASEDIR/ui.mp.x86_64.dylib
-	build/release-darwin-x86/$BASEDIR/ui.mp.i386.dylib
-	build/release-darwin-ppc/$BASEDIR/ui.mp.ppc.dylib
-	build/release-darwin-x86_64/$BASEDIR/qagame.mp.x86_64.dylib
-	build/release-darwin-x86/$BASEDIR/qagame.mp.i386.dylib
-	build/release-darwin-ppc/$BASEDIR/qagame.mp.ppc.dylib
-"
-RENDER_OBJ="
-	build/release-darwin-x86_64/renderer_mp_opengl1_x86_64.dylib
-	build/release-darwin-x86/renderer_mp_opengl1_i386.dylib
-	build/release-darwin-ppc/renderer_mp_opengl1_ppc.dylib
-	build/release-darwin-x86_64/renderer_mp_rend2_x86_64.dylib
-	build/release-darwin-x86/renderer_mp_rend2_i386.dylib
-	build/release-darwin-ppc/renderer_mp_rend2_ppc.dylib
-"
 
 cd `dirname $0`
 if [ ! -f Makefile ]; then
-	echo "This script must be run from the iowolfmp build directory"
+	echo "This script must be run from the iortcw build directory"
 	exit 1
 fi
 
-Q3_VERSION=`grep '^VERSION=' Makefile | sed -e 's/.*=\(.*\)/\1/'`
-
-# we want to use the oldest available SDK for max compatiblity. However 10.4 and older
+# we want to use the oldest available SDK for max compatibility. However 10.4 and older
 # can not build 64bit binaries, making 10.5 the minimum version.   This has been tested 
 # with xcode 3.1 (xcode31_2199_developerdvd.dmg).  It contains the 10.5 SDK and a decent
-# enough gcc to actually compile iowolfmp
-# For PPC macs, G4's or better are required to run iowolfmp.
+# enough gcc to actually compile iortcw
+# For PPC macs, G4's or better are required to run iortcw.
 
 unset X86_64_SDK
 unset X86_64_CFLAGS
+unset X86_64_MACOSX_VERSION_MIN
 unset X86_SDK
 unset X86_CFLAGS
+unset X86_MACOSX_VERSION_MIN
 unset PPC_SDK
 unset PPC_CFLAGS
+unset PPC_MACOSX_VERSION_MIN
 
 if [ -d /Developer/SDKs/MacOSX10.5.sdk ]; then
+	X86_64_SDK=/Developer/SDKs/MacOSX10.5.sdk
+	X86_64_CFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk"
+	X86_64_MACOSX_VERSION_MIN="10.5"
+
+	X86_SDK=/Developer/SDKs/MacOSX10.5.sdk
+	X86_CFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk"
+	X86_MACOSX_VERSION_MIN="10.5"
+
 	PPC_SDK=/Developer/SDKs/MacOSX10.5.sdk
-	PPC_CFLAGS="-arch ppc -isysroot /Developer/SDKs/MacOSX10.5.sdk"
+	PPC_CFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk"
+	PPC_MACOSX_VERSION_MIN="10.5"
 fi
 
+# SDL 2.0.5+ (x86, x86_64) only supports MacOSX 10.6 and later
 if [ -d /Developer/SDKs/MacOSX10.6.sdk ]; then
 	X86_64_SDK=/Developer/SDKs/MacOSX10.6.sdk
-	X86_64_CFLAGS="-arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk"
+	X86_64_CFLAGS="-isysroot /Developer/SDKs/MacOSX10.6.sdk"
+	X86_64_MACOSX_VERSION_MIN="10.6"
 
 	X86_SDK=/Developer/SDKs/MacOSX10.6.sdk
-	X86_CFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.6.sdk"
+	X86_CFLAGS="-isysroot /Developer/SDKs/MacOSX10.6.sdk"
+	X86_MACOSX_VERSION_MIN="10.6"
+else
+	# Don't try to compile with 10.5 version min
+	X86_64_SDK=
+	X86_SDK=
 fi
+# end SDL 2.0.5
 
 if [ -z $X86_64_SDK ] || [ -z $X86_SDK ] || [ -z $PPC_SDK ]; then
-       echo "\
+	echo "\
 ERROR: This script is for building a Universal Binary.  You cannot build
        for a different architecture unless you have the proper Mac OS X SDKs
        installed.  If you just want to to compile for your own system run
@@ -82,7 +63,8 @@ ERROR: This script is for building a Universal Binary.  You cannot build
        In order to build a binary with maximum compatibility you must
        build on Mac OS X 10.6 and have the MacOSX10.5 and MacOSX10.6
        SDKs installed from the Xcode install disk Packages folder."
-       exit 1
+
+	exit 1
 fi
 
 echo "Building X86_64 Client/Dedicated Server against \"$X86_64_SDK\""
@@ -90,98 +72,36 @@ echo "Building X86 Client/Dedicated Server against \"$X86_SDK\""
 echo "Building PPC Client/Dedicated Server against \"$PPC_SDK\""
 echo
 
-if [ ! -d $DESTDIR ]; then
-	mkdir -p $DESTDIR
-fi
-
 # For parallel make on multicore boxes...
 NCPU=`sysctl -n hw.ncpu`
 
 # x86_64 client and server
-if [ -d build/release-release-x86_64 ]; then
-	rm -r build/release-darwin-x86_64
-fi
-(ARCH=x86_64 CC=gcc-4.0 CFLAGS=$X86_64_CFLAGS make -j$NCPU) || exit 1;
+#if [ -d build/release-release-x86_64 ]; then
+#	rm -r build/release-darwin-x86_64
+#fi
+(ARCH=x86_64 CC=gcc-4.0 CFLAGS=$X86_64_CFLAGS MACOSX_VERSION_MIN=$X86_64_MACOSX_VERSION_MIN make -j$NCPU) || exit 1;
 
 echo;echo
 
 # x86 client and server
-if [ -d build/release-darwin-x86 ]; then
-	rm -r build/release-darwin-x86
-fi
-(ARCH=x86 CC=gcc-4.0 CFLAGS=$X86_CFLAGS make -j$NCPU) || exit 1;
+#if [ -d build/release-darwin-x86 ]; then
+#	rm -r build/release-darwin-x86
+#fi
+(ARCH=x86 CC=gcc-4.0 CFLAGS=$X86_CFLAGS MACOSX_VERSION_MIN=$X86_MACOSX_VERSION_MIN make -j$NCPU) || exit 1;
 
 echo;echo
 
 # PPC client and server
-if [ -d build/release-darwin-ppc ]; then
-	rm -r build/release-darwin-ppc
-fi
-(ARCH=ppc CC=gcc-4.0 CFLAGS=$PPC_CFLAGS make -j$NCPU) || exit 1;
-
-echo;echo
+#if [ -d build/release-darwin-ppc ]; then
+#	rm -r build/release-darwin-ppc
+#fi
+(ARCH=ppc CC=gcc-4.0 CFLAGS=$PPC_CFLAGS MACOSX_VERSION_MIN=$PPC_MACOSX_VERSION_MIN make -j$NCPU) || exit 1;
 
-echo "Creating .app bundle $DESTDIR/$APPBUNDLE"
-if [ ! -d $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR ]; then
-	mkdir -p $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR || exit 1;
-fi
-if [ ! -d $DESTDIR/$APPBUNDLE/Contents/Resources ]; then
-	mkdir -p $DESTDIR/$APPBUNDLE/Contents/Resources
-fi
-cp $ICNS $DESTDIR/$APPBUNDLE/Contents/Resources/iortcw.icns || exit 1;
-echo $PKGINFO > $DESTDIR/$APPBUNDLE/Contents/PkgInfo
-echo "
-	<?xml version=\"1.0\" encoding=\"UTF-8\"?>
-	<!DOCTYPE plist
-		PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\"
-		\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
-	<plist version=\"1.0\">
-	<dict>
-		<key>LSMinimumSystemVersion</key>
-		<string>10.5.0</string>
-		<key>LSMinimumSystemVersionByArchitecture</key>
-		<dict>
-			<key>i386</key>
-			<string>10.6.0</string>
-			<key>x86_64</key>
-			<string>10.6.0</string>
-		</dict>
-		<key>CFBundleDevelopmentRegion</key>
-		<string>English</string>
-		<key>CFBundleExecutable</key>
-		<string>$BINARY</string>
-		<key>CFBundleGetInfoString</key>
-		<string>iowolfmp $Q3_VERSION</string>
-		<key>CFBundleIconFile</key>
-		<string>iortcw.icns</string>
-		<key>CFBundleIdentifier</key>
-		<string>org.iortcw</string>
-		<key>CFBundleInfoDictionaryVersion</key>
-		<string>6.0</string>
-		<key>CFBundleName</key>
-		<string>iowolfmp</string>
-		<key>CFBundlePackageType</key>
-		<string>APPL</string>
-		<key>CFBundleShortVersionString</key>
-		<string>$Q3_VERSION</string>
-		<key>CFBundleSignature</key>
-		<string>$PKGINFO</string>
-		<key>CFBundleVersion</key>
-		<string>$Q3_VERSION</string>
-		<key>NSExtensions</key>
-		<dict/>
-		<key>NSPrincipalClass</key>
-		<string>NSApplication</string>
-	</dict>
-	</plist>
-	" > $DESTDIR/$APPBUNDLE/Contents/Info.plist
-
-
-# Make UB's from previous builds of x86, x86_64 and ppc binaries
-lipo -create -o $DESTDIR/$APPBUNDLE/Contents/MacOS/$BINARY $BIN_OBJ
-lipo -create -o $DESTDIR/$APPBUNDLE/Contents/MacOS/$DEDBIN $BIN_DEDOBJ
-
-cp $RENDER_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/
-cp $BASE_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR/
-cp code/libs/macosx/*.dylib $DESTDIR/$APPBUNDLE/Contents/MacOS/
+echo
 
+# use the following shell script to build a universal application bundle
+export MACOSX_DEPLOYMENT_TARGET="10.5"
+export MACOSX_DEPLOYMENT_TARGET_PPC="$PPC_MACOSX_VERSION_MIN"
+export MACOSX_DEPLOYMENT_TARGET_X86="$X86_MACOSX_VERSION_MIN"
+export MACOSX_DEPLOYMENT_TARGET_X86_64="$X86_64_MACOSX_VERSION_MIN"
+"./make-macosx-app.sh" release
diff --git a/MP/make-macosx.sh b/MP/make-macosx.sh
new file mode 100755
index 0000000..68b1500
--- /dev/null
+++ b/MP/make-macosx.sh
@@ -0,0 +1,94 @@
+#!/bin/bash
+#
+
+# Let's make the user give us a target build system
+
+if [ $# -ne 1 ]; then
+	echo "Usage:   $0 target_architecture"
+	echo "Example: $0 x86"
+	echo "other valid options are x86_64, ppc or arm64"
+	echo
+	echo "If you don't know or care about architectures please consider using make-macosx-ub.sh instead of this script."
+	exit 1
+fi
+
+if [ "$1" == "x86" ]; then
+	BUILDARCH=x86
+elif [ "$1" == "x86_64" ]; then
+	BUILDARCH=x86_64
+elif [ "$1" == "ppc" ]; then
+	BUILDARCH=ppc
+elif [ "$1" == "arm64" ]; then
+	BUILDARCH=arm64
+else
+	echo "Invalid architecture: $1"
+	echo "Valid architectures are x86, x86_64, ppc or arm64"
+	exit 1
+fi
+
+CC=gcc-4.0
+DESTDIR=build/release-darwin-${BUILDARCH}
+
+cd `dirname $0`
+if [ ! -f Makefile ]; then
+	echo "This script must be run from the iortcw build directory"
+	exit 1
+fi
+
+# we want to use the oldest available SDK for max compatibility. However 10.4 and older
+# can not build 64bit binaries, making 10.5 the minimum version.   This has been tested
+# with xcode 3.1 (xcode31_2199_developerdvd.dmg).  It contains the 10.5 SDK and a decent
+# enough gcc to actually compile iortcw
+# For PPC macs, G4's or better are required to run iortcw.
+
+unset ARCH_SDK
+unset ARCH_CFLAGS
+unset ARCH_MACOSX_VERSION_MIN
+
+MACOS_VERSION=$(sw_vers -productVersion)
+MACOS_MAJOR_VER=$(echo $MACOS_VERSION | awk -F. '{print $1}')
+MACOS_MINOR_VER=$(echo $MACOS_VERSION | awk -F. '{print $2}')
+
+# SDL 2.0.1 (ppc) supports MacOSX 10.5
+# SDL 2.0.5+ (x86, x86_64) supports MacOSX 10.6 and later
+if [ $BUILDARCH = "ppc" ]; then
+	if [ -d /Developer/SDKs/MacOSX10.5.sdk ]; then
+		ARCH_SDK=/Developer/SDKs/MacOSX10.5.sdk
+		ARCH_CFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk"
+	fi
+	ARCH_MACOSX_VERSION_MIN="10.5"
+elif [ -d /Developer/SDKs/MacOSX10.6.sdk ]; then
+	ARCH_SDK=/Developer/SDKs/MacOSX10.6.sdk
+	ARCH_CFLAGS="-isysroot /Developer/SDKs/MacOSX10.6.sdk"
+	ARCH_MACOSX_VERSION_MIN="10.6"
+elif [ $MACOS_MAJOR_VER == 10 ] && [ $MACOS_MINOR_VER >= 9 ] || [ $MACOS_MAJOR_VER > 10 ]; then
+	ARCH_MACOSX_VERSION_MIN="10.9"
+else
+	ARCH_MACOSX_VERSION_MIN="10.7"
+fi
+
+
+echo "Building ${BUILDARCH} Client/Dedicated Server against \"$ARCH_SDK\""
+sleep 3
+
+if [ ! -d $DESTDIR ]; then
+	mkdir -p $DESTDIR
+fi
+
+# For parallel make on multicore boxes...
+NCPU=`sysctl -n hw.ncpu`
+
+
+# intel client and server
+#if [ -d build/release-darwin-${BUILDARCH} ]; then
+#	rm -r build/release-darwin-${BUILDARCH}
+#fi
+(ARCH=${BUILDARCH} CFLAGS=$ARCH_CFLAGS MACOSX_VERSION_MIN=$ARCH_MACOSX_VERSION_MIN make -j$NCPU) || exit 1;
+
+# use the following shell script to build an application bundle
+export MACOSX_DEPLOYMENT_TARGET="${ARCH_MACOSX_VERSION_MIN}"
+export MACOSX_DEPLOYMENT_TARGET_PPC=
+export MACOSX_DEPLOYMENT_TARGET_X86=
+export MACOSX_DEPLOYMENT_TARGET_X86_64=
+export MACOSX_DEPLOYMENT_TARGET_ARM64=
+"./make-macosx-app.sh" release ${BUILDARCH}
diff --git a/MP/make-macosx_xcode3.sh b/MP/make-macosx_xcode3.sh
deleted file mode 100755
index fb303e8..0000000
--- a/MP/make-macosx_xcode3.sh
+++ /dev/null
@@ -1,151 +0,0 @@
-#!/bin/sh
-#
-
-# Lets make the user give us a target build system
-
-if [ $# -ne 1 ]; then
-	echo "Usage:   $0 target_architecture"
-	echo "Example: $0 x86"
-	echo "other valid options are x86_64 or ppc"
-	echo
-	echo "If you don't know or care about architectures please consider using make-macosx-ub.sh instead of this script."
-	exit 1
-fi
-
-if [ "$1" == "x86" ]; then
-	BUILDARCH=x86
-	ARCH=i386
-elif [ "$1" == "x86_64" ]; then
-	BUILDARCH=x86_64
-	ARCH=x86_64
-elif [ "$1" == "ppc" ]; then
-	BUILDARCH=ppc
-	ARCH=ppc
-else
-	echo "Invalid architecture: $1"
-	echo "Valid architectures are x86, x86_64 or ppc"
-	exit 1
-fi
-
-CC=gcc-4.0
-APPBUNDLE=iowolfmp.app
-BINARY=iowolfmp.${ARCH}
-DEDBIN=iowolfded.${ARCH}
-PKGINFO=APPLIOWOLFMP
-ICNS=misc/iortcw.icns
-DESTDIR=build/release-darwin-${BUILDARCH}
-BASEDIR=main
-
-BIN_OBJ="
-	build/release-darwin-${BUILDARCH}/iowolfmp.${BUILDARCH}
-"
-BIN_DEDOBJ="
-	build/release-darwin-${BUILDARCH}/iowolfded.${BUILDARCH}
-"
-BASE_OBJ="
-	build/release-darwin-${BUILDARCH}/$BASEDIR/cgame.mp.${ARCH}.dylib
-	build/release-darwin-${BUILDARCH}/$BASEDIR/ui.mp.${ARCH}.dylib
-	build/release-darwin-${BUILDARCH}/$BASEDIR/qagame.mp.${ARCH}.dylib
-"
-RENDER_OBJ="
-	build/release-darwin-${BUILDARCH}/renderer_mp_opengl1_${ARCH}.dylib
-	build/release-darwin-${BUILDARCH}/renderer_mp_rend2_${ARCH}.dylib
-"
-
-cd `dirname $0`
-if [ ! -f Makefile ]; then
-	echo "This script must be run from the iowolfmp build directory"
-	exit 1
-fi
-
-Q3_VERSION=`grep '^VERSION=' Makefile | sed -e 's/.*=\(.*\)/\1/'`
-
-# We only care if we're >= 10.4, not if we're specifically Tiger.
-# "8" is the Darwin major kernel version.
-TIGERHOST=`uname -r |perl -w -p -e 's/\A(\d+)\..*\Z/$1/; $_ = (($_ >= 8) ? "1" : "0");'`
-
-# we want to use the oldest available SDK for max compatiblity. However 10.4 and older
-# can not build 64bit binaries, making 10.5 the minimum version.   This has been tested 
-# with xcode 3.1 (xcode31_2199_developerdvd.dmg).  It contains the 10.5 SDK and a decent
-# enough gcc to actually compile iowolfmp
-# For PPC macs, G4's or better are required to run iowolfmp.
-
-unset ARCH_SDK
-unset ARCH_CFLAGS
-
-if [ -d /Developer/SDKs/MacOSX10.5.sdk ]; then
-	ARCH_SDK=/Developer/SDKs/MacOSX10.5.sdk
-	ARCH_CFLAGS="-arch ${ARCH} -isysroot /Developer/SDKs/MacOSX10.5.sdk"
-fi
-
-
-echo "Building ${BUILDARCH} Client/Dedicated Server against \"$ARCH_SDK\""
-sleep 3
-
-if [ ! -d $DESTDIR ]; then
-	mkdir -p $DESTDIR
-fi
-
-# For parallel make on multicore boxes...
-NCPU=`sysctl -n hw.ncpu`
-
-
-# intel client and server
-if [ -d build/release-darwin-${BUILDARCH} ]; then
-	rm -r build/release-darwin-${BUILDARCH}
-fi
-(CC=${CC} ARCH=${BUILDARCH} CFLAGS=$ARCH_CFLAGS make -j$NCPU) || exit 1;
-
-echo "Creating .app bundle $DESTDIR/$APPBUNDLE"
-if [ ! -d $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR ]; then
-	mkdir -p $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR || exit 1;
-fi
-if [ ! -d $DESTDIR/$APPBUNDLE/Contents/Resources ]; then
-	mkdir -p $DESTDIR/$APPBUNDLE/Contents/Resources
-fi
-cp $ICNS $DESTDIR/$APPBUNDLE/Contents/Resources/iortcw.icns || exit 1;
-echo $PKGINFO > $DESTDIR/$APPBUNDLE/Contents/PkgInfo
-echo "
-	<?xml version=\"1.0\" encoding=\"UTF-8\"?>
-	<!DOCTYPE plist
-		PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\"
-		\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
-	<plist version=\"1.0\">
-	<dict>
-		<key>CFBundleDevelopmentRegion</key>
-		<string>English</string>
-		<key>CFBundleExecutable</key>
-		<string>$BINARY</string>
-		<key>CFBundleGetInfoString</key>
-		<string>iowolfmp $Q3_VERSION</string>
-		<key>CFBundleIconFile</key>
-		<string>iortcw.icns</string>
-		<key>CFBundleIdentifier</key>
-		<string>org.ioquake.iortcw</string>
-		<key>CFBundleInfoDictionaryVersion</key>
-		<string>6.0</string>
-		<key>CFBundleName</key>
-		<string>iowolfmp</string>
-		<key>CFBundlePackageType</key>
-		<string>APPL</string>
-		<key>CFBundleShortVersionString</key>
-		<string>$Q3_VERSION</string>
-		<key>CFBundleSignature</key>
-		<string>$PKGINFO</string>
-		<key>CFBundleVersion</key>
-		<string>$Q3_VERSION</string>
-		<key>NSExtensions</key>
-		<dict/>
-		<key>NSPrincipalClass</key>
-		<string>NSApplication</string>
-	</dict>
-	</plist>
-	" > $DESTDIR/$APPBUNDLE/Contents/Info.plist
-
-
-cp $BIN_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$BINARY
-cp $BIN_DEDOBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$DEDBIN
-cp $RENDER_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/
-cp $BASE_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR/
-cp code/libs/macosx/*.dylib $DESTDIR/$APPBUNDLE/Contents/MacOS/
-cp code/libs/macosx/*.dylib $DESTDIR
diff --git a/MP/make-macosx_xcode4.sh b/MP/make-macosx_xcode4.sh
deleted file mode 100755
index d04a54c..0000000
--- a/MP/make-macosx_xcode4.sh
+++ /dev/null
@@ -1,134 +0,0 @@
-#!/bin/sh
-#
-
-# Lets make the user give us a target build system
-
-if [ $# -ne 1 ]; then
-	echo "Usage:   $0 target_architecture"
-	echo "Example: $0 x86"
-	echo "The other valid option is x86_64"
-	echo
-	echo "If you don't know or care about architectures please consider using make-macosx-ub.sh instead of this script."
-	exit 1
-fi
-
-if [ "$1" == "x86" ]; then
-	BUILDARCH=x86
-	ARCH=i386
-elif [ "$1" == "x86_64" ]; then
-	BUILDARCH=x86_64
-	ARCH=x86_64
-else
-	echo "Invalid architecture: $1"
-	echo "Valid architectures are x86, x86_64"
-	exit 1
-fi
-
-CC=gcc
-APPBUNDLE=iowolfmp.app
-BINARY=iowolfmp.${ARCH}
-DEDBIN=iowolfded.${ARCH}
-PKGINFO=APPLIOWOLFMP
-ICNS=misc/iortcw.icns
-DESTDIR=build/release-darwin-${BUILDARCH}
-BASEDIR=main
-
-BIN_OBJ="
-	build/release-darwin-${BUILDARCH}/iowolfmp.${BUILDARCH}
-"
-BIN_DEDOBJ="
-	build/release-darwin-${BUILDARCH}/iowolfded.${BUILDARCH}
-"
-BASE_OBJ="
-	build/release-darwin-${BUILDARCH}/$BASEDIR/cgame.mp.${ARCH}.dylib
-	build/release-darwin-${BUILDARCH}/$BASEDIR/ui.mp.${ARCH}.dylib
-	build/release-darwin-${BUILDARCH}/$BASEDIR/qagame.mp.${ARCH}.dylib
-"
-RENDER_OBJ="
-	build/release-darwin-${BUILDARCH}/renderer_mp_opengl1_${ARCH}.dylib
-	build/release-darwin-${BUILDARCH}/renderer_mp_rend2_${ARCH}.dylib
-"
-
-cd `dirname $0`
-if [ ! -f Makefile ]; then
-	echo "This script must be run from the iowolfmp build directory"
-	exit 1
-fi
-
-Q3_VERSION=`grep '^VERSION=' Makefile | sed -e 's/.*=\(.*\)/\1/'`
-
-# We only care if we're >= 10.4, not if we're specifically Tiger.
-# "8" is the Darwin major kernel version.
-TIGERHOST=`uname -r |perl -w -p -e 's/\A(\d+)\..*\Z/$1/; $_ = (($_ >= 8) ? "1" : "0");'`
-
-unset ARCH_CFLAGS
-
-ARCH_CFLAGS="-arch ${ARCH}"
-
-if [ ! -d $DESTDIR ]; then
-	mkdir -p $DESTDIR
-fi
-
-# For parallel make on multicore boxes...
-NCPU=`sysctl -n hw.ncpu`
-
-
-# intel client and server
-if [ -d build/release-darwin-${BUILDARCH} ]; then
-	rm -r build/release-darwin-${BUILDARCH}
-fi
-(CC=${CC} ARCH=${BUILDARCH} CFLAGS=$ARCH_CFLAGS make -j$NCPU) || exit 1;
-
-echo "Creating .app bundle $DESTDIR/$APPBUNDLE"
-if [ ! -d $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR ]; then
-	mkdir -p $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR || exit 1;
-fi
-if [ ! -d $DESTDIR/$APPBUNDLE/Contents/Resources ]; then
-	mkdir -p $DESTDIR/$APPBUNDLE/Contents/Resources
-fi
-cp $ICNS $DESTDIR/$APPBUNDLE/Contents/Resources/iortcw.icns || exit 1;
-echo $PKGINFO > $DESTDIR/$APPBUNDLE/Contents/PkgInfo
-echo "
-	<?xml version=\"1.0\" encoding=\"UTF-8\"?>
-	<!DOCTYPE plist
-		PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\"
-		\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
-	<plist version=\"1.0\">
-	<dict>
-		<key>CFBundleDevelopmentRegion</key>
-		<string>English</string>
-		<key>CFBundleExecutable</key>
-		<string>$BINARY</string>
-		<key>CFBundleGetInfoString</key>
-		<string>iowolfmp $Q3_VERSION</string>
-		<key>CFBundleIconFile</key>
-		<string>iortcw.icns</string>
-		<key>CFBundleIdentifier</key>
-		<string>org.ioquake.iortcw</string>
-		<key>CFBundleInfoDictionaryVersion</key>
-		<string>6.0</string>
-		<key>CFBundleName</key>
-		<string>iowolfmp</string>
-		<key>CFBundlePackageType</key>
-		<string>APPL</string>
-		<key>CFBundleShortVersionString</key>
-		<string>$Q3_VERSION</string>
-		<key>CFBundleSignature</key>
-		<string>$PKGINFO</string>
-		<key>CFBundleVersion</key>
-		<string>$Q3_VERSION</string>
-		<key>NSExtensions</key>
-		<dict/>
-		<key>NSPrincipalClass</key>
-		<string>NSApplication</string>
-	</dict>
-	</plist>
-	" > $DESTDIR/$APPBUNDLE/Contents/Info.plist
-
-
-cp $BIN_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$BINARY
-cp $BIN_DEDOBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$DEDBIN
-cp $RENDER_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/
-cp $BASE_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR/
-cp code/libs/macosx/*.dylib $DESTDIR/$APPBUNDLE/Contents/MacOS/
-cp code/libs/macosx/*.dylib $DESTDIR
diff --git a/MP/make-macosx_xcode5.sh b/MP/make-macosx_xcode5.sh
deleted file mode 100755
index 1964557..0000000
--- a/MP/make-macosx_xcode5.sh
+++ /dev/null
@@ -1,134 +0,0 @@
-#!/bin/sh
-#
-
-# Lets make the user give us a target build system
-
-if [ $# -ne 1 ]; then
-	echo "Usage:   $0 target_architecture"
-	echo "Example: $0 x86"
-	echo "The other valid option is x86_64"
-	echo
-	echo "If you don't know or care about architectures please consider using make-macosx-ub.sh instead of this script."
-	exit 1
-fi
-
-if [ "$1" == "x86" ]; then
-	BUILDARCH=x86
-	ARCH=i386
-elif [ "$1" == "x86_64" ]; then
-	BUILDARCH=x86_64
-	ARCH=x86_64
-else
-	echo "Invalid architecture: $1"
-	echo "Valid architectures are x86, x86_64"
-	exit 1
-fi
-
-CC=clang
-APPBUNDLE=iowolfmp.app
-BINARY=iowolfmp.${ARCH}
-DEDBIN=iowolfded.${ARCH}
-PKGINFO=APPLIOWOLFMP
-ICNS=misc/iortcw.icns
-DESTDIR=build/release-darwin-${BUILDARCH}
-BASEDIR=main
-
-BIN_OBJ="
-	build/release-darwin-${BUILDARCH}/iowolfmp.${BUILDARCH}
-"
-BIN_DEDOBJ="
-	build/release-darwin-${BUILDARCH}/iowolfded.${BUILDARCH}
-"
-BASE_OBJ="
-	build/release-darwin-${BUILDARCH}/$BASEDIR/cgame.mp.${ARCH}.dylib
-	build/release-darwin-${BUILDARCH}/$BASEDIR/ui.mp.${ARCH}.dylib
-	build/release-darwin-${BUILDARCH}/$BASEDIR/qagame.mp.${ARCH}.dylib
-"
-RENDER_OBJ="
-	build/release-darwin-${BUILDARCH}/renderer_mp_opengl1_${ARCH}.dylib
-	build/release-darwin-${BUILDARCH}/renderer_mp_rend2_${ARCH}.dylib
-"
-
-cd `dirname $0`
-if [ ! -f Makefile ]; then
-	echo "This script must be run from the iowolfmp build directory"
-	exit 1
-fi
-
-Q3_VERSION=`grep '^VERSION=' Makefile | sed -e 's/.*=\(.*\)/\1/'`
-
-# We only care if we're >= 10.4, not if we're specifically Tiger.
-# "8" is the Darwin major kernel version.
-TIGERHOST=`uname -r |perl -w -p -e 's/\A(\d+)\..*\Z/$1/; $_ = (($_ >= 8) ? "1" : "0");'`
-
-unset ARCH_CFLAGS
-
-ARCH_CFLAGS="-arch ${ARCH}"
-
-if [ ! -d $DESTDIR ]; then
-	mkdir -p $DESTDIR
-fi
-
-# For parallel make on multicore boxes...
-NCPU=`sysctl -n hw.ncpu`
-
-
-# intel client and server
-if [ -d build/release-darwin-${BUILDARCH} ]; then
-	rm -r build/release-darwin-${BUILDARCH}
-fi
-(CC=${CC} ARCH=${BUILDARCH} CFLAGS=$ARCH_CFLAGS make -j$NCPU) || exit 1;
-
-echo "Creating .app bundle $DESTDIR/$APPBUNDLE"
-if [ ! -d $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR ]; then
-	mkdir -p $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR || exit 1;
-fi
-if [ ! -d $DESTDIR/$APPBUNDLE/Contents/Resources ]; then
-	mkdir -p $DESTDIR/$APPBUNDLE/Contents/Resources
-fi
-cp $ICNS $DESTDIR/$APPBUNDLE/Contents/Resources/iortcw.icns || exit 1;
-echo $PKGINFO > $DESTDIR/$APPBUNDLE/Contents/PkgInfo
-echo "
-	<?xml version=\"1.0\" encoding=\"UTF-8\"?>
-	<!DOCTYPE plist
-		PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\"
-		\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
-	<plist version=\"1.0\">
-	<dict>
-		<key>CFBundleDevelopmentRegion</key>
-		<string>English</string>
-		<key>CFBundleExecutable</key>
-		<string>$BINARY</string>
-		<key>CFBundleGetInfoString</key>
-		<string>iowolfmp $Q3_VERSION</string>
-		<key>CFBundleIconFile</key>
-		<string>iortcw.icns</string>
-		<key>CFBundleIdentifier</key>
-		<string>org.ioquake.iortcw</string>
-		<key>CFBundleInfoDictionaryVersion</key>
-		<string>6.0</string>
-		<key>CFBundleName</key>
-		<string>iowolfmp</string>
-		<key>CFBundlePackageType</key>
-		<string>APPL</string>
-		<key>CFBundleShortVersionString</key>
-		<string>$Q3_VERSION</string>
-		<key>CFBundleSignature</key>
-		<string>$PKGINFO</string>
-		<key>CFBundleVersion</key>
-		<string>$Q3_VERSION</string>
-		<key>NSExtensions</key>
-		<dict/>
-		<key>NSPrincipalClass</key>
-		<string>NSApplication</string>
-	</dict>
-	</plist>
-	" > $DESTDIR/$APPBUNDLE/Contents/Info.plist
-
-
-cp $BIN_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$BINARY
-cp $BIN_DEDOBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$DEDBIN
-cp $RENDER_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/
-cp $BASE_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR/
-cp code/libs/macosx/*.dylib $DESTDIR/$APPBUNDLE/Contents/MacOS/
-cp code/libs/macosx/*.dylib $DESTDIR
diff --git a/MP/media/scripts/terrain.mtr b/MP/media/scripts/terrain.mtr
new file mode 100644
index 0000000..b13af42
--- /dev/null
+++ b/MP/media/scripts/terrain.mtr
@@ -0,0 +1,4324 @@
+///////////////// terrain ////////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra1_0
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock9c.tga
+		rgbGen vertexLit
+		tcmod scale 0.125 0.125
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra1_1
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock12c.tga
+		rgbGen vertexLit
+		tcmod scale 0.125 0.125 
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra1_2
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock10c.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+
+}
+textures/terrain/mxterra1_0to1
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock9c.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.125 0.125 
+	}
+	{
+		map textures/stone/mxrock12c.tga
+		tcmod scale 0.125 0.125 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra1_0to2
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock9c.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.125 0.125
+	}
+	{
+		map textures/stone/mxrock10c.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra1_1to2
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock12c.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.125 0.125
+	}
+	{
+		map textures/stone/mxrock10c.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+///////////////// baseout ////////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra2_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1
+	}
+}
+
+textures/terrain/mxterra2_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1 
+	}
+}
+
+textures/terrain/mxterra2_2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2b.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra2_3
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra2_4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra2_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock1b.tga
+		tcmod scale 0.1 0.1
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra2_0to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock2b.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra2_0to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra2_0to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+textures/terrain/mxterra2_1to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock2b.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra2_1to3
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra2_1to4
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra2_2to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra2_2to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+textures/terrain/mxterra2_3to4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3g.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+///////////////// forest ////////////////////////
+/////////////////////////////////////////////////
+
+textures/terrain/mxterra3_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra3_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra3_2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2b.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra3_3
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra3_4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra3_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock1b.tga
+		tcmod scale 0.1 0.1
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra3_0to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock2b.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra3_0to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra3_0to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+
+textures/terrain/mxterra3_1to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock2b.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra3_1to3
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra3_1to4
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra3_2to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra3_2to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra3_3to4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3g.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+
+///////////////// sfm ////////////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra4_0
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxdebri0.tga
+		rgbGen vertexLit
+		tcmod scale 0.25 0.25
+	}
+}
+
+textures/terrain/mxterra4_1
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxdebri1.tga
+		rgbGen vertexLit
+		tcmod scale 0.25 0.25
+	}
+}
+
+textures/terrain/mxterra4_2
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxdebri2.tga
+		rgbGen vertexLit
+		tcmod scale 0.05 0.05 
+	}
+}
+
+textures/terrain/mxterra4_3
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxdebri3.tga
+		rgbGen vertexLit
+		tcmod scale 0.05 0.05 
+	}
+}
+
+textures/terrain/mxterra4_4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxdebri4.tga
+		rgbGen vertexLit
+		tcmod scale 0.05 0.05 
+	}
+}
+
+textures/terrain/mxterra4_0to1
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxdebri0.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.25 0.25
+	}
+	{
+		map textures/stone/mxdebri1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.25 0.25
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra4_0to2
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxdebri0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.25 0.25
+	}
+	{
+		map textures/stone/mxdebri2.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra4_0to3
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxdebri0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.25 0.25
+	}
+	{
+		map textures/stone/mxdebri3.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra4_0to4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxdebri0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.25 0.25
+	}
+	{
+		map textures/stone/mxdebri4.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+textures/terrain/mxterra4_1to2
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxdebri1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.25 0.25
+	}
+	{
+		map textures/stone/mxdebri2.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra4_1to3
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxdebri1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.25 0.25
+	}
+	{
+		map textures/stone/mxdebri3.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra4_1to4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxdebri1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.25 0.25
+	}
+	{
+		map textures/stone/mxdebri4.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra4_2to3
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxdebri2.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxdebri3.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra4_2to4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxdebri2.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxdebri4.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+textures/terrain/mxterra4_3to4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxdebri3.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxdebri4.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+///////////////// snow ///////////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra5_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow0.tga
+		rgbGen vertexLit
+		tcmod scale 0.05 0.05
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra5_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow1.tga
+		rgbGen vertexLit
+		tcmod scale 0.025 0.025
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra5_2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow2.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra5_3
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow3.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra5_4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra5_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow0.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxsnow1.tga
+		tcmod scale 0.025 0.025
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra5_0to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05
+	}
+	{
+		map textures/stone/mxsnow2.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra5_0to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05
+	}
+	{
+		map textures/stone/mxsnow3.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra5_0to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05
+	}
+	{
+		map textures/stone/mxsnow4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+
+}
+
+textures/terrain/mxterra5_1to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxsnow2.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra5_1to3
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxsnow3.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra5_1to4
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxsnow4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra5_2to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow2.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxsnow3.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra5_2to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow2.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxsnow4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+
+textures/terrain/mxterra5_3to4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow3.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxsnow4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+
+///////////////// beach //////////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra6_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsand0.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra6_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsand1.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra6_2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsand2.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+
+}
+
+textures/terrain/mxterra6_3
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsand3.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+
+}
+
+textures/terrain/mxterra6_4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsand4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+
+}
+
+textures/terrain/mxterra6_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsand0.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxsand1.tga
+		tcmod scale 0.1 0.1
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+
+}
+
+textures/terrain/mxterra6_0to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsand0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxsand2.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+
+}
+
+textures/terrain/mxterra6_0to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsand0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxsand3.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+
+}
+
+textures/terrain/mxterra6_0to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsand0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxsand4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra6_1to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsand1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxsand2.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra6_1to3
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsand1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxsand3.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra6_1to4
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsand1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxsand4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra6_2to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsand2.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxsand3.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra6_2to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsand2.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxsand4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+
+textures/terrain/mxterra6_3to4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsand3.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxsand4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+
+///////////////// tram /////////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra7_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxxsnow0.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1
+	}	
+}
+
+textures/terrain/mxterra7_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxxsnow1.tga
+		rgbGen vertexLit
+		tcmod scale .025 .025 
+	}
+}
+
+textures/terrain/mxterra7_2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxxsnow2.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra7_3
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxxsnow3.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra7_4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxxsnow4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra7_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxxsnow0.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxxsnow1.tga
+		tcmod scale .05 .05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra7_0to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxxsnow0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxxsnow2.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra7_0to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxxsnow0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxxsnow3.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra7_0to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxxsnow0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxxsnow4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra7_1to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxxsnow1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale .025 .025  
+	}
+	{
+		map textures/stone/mxxsnow2.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra7_1to3
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxxsnow1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale .025 .025   
+	}
+	{
+		map textures/stone/mxxsnow3.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra7_1to4
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxxsnow1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale .025 .025 
+	}
+	{
+		map textures/stone/mxxsnow4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra7_2to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxxsnow2.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxxsnow3.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra7_2to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxxsnow2.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxxsnow4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra7_3to4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxxsnow3.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxxsnow4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+///////////////// assault /////////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra8_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1
+	}
+}
+
+textures/terrain/mxterra8_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1 
+	}
+}
+
+textures/terrain/mxterra8_2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra8_3
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3_a.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra8_4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1aa.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra8_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock1.tga
+		tcmod scale 0.1 0.1
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra8_0to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock2.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra8_0to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock3_a.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra8_0to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock1aa.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra8_1to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock2.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra8_1to3
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock3_a.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra8_1to4
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock1aa.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra8_2to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock3_a.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra8_2to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock1aa.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra8_3to4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3_a.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock1aa.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+///////////////// village1 ///////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra9_0
+{
+	surfaceparm snowsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/snow/s_dirt_m03i_2.tga
+		rgbGen vertexLit
+		tcmod scale 0.3 0.3
+	}
+}
+
+textures/terrain/mxterra9_1
+{
+	surfaceparm snowsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/snow/s_floor_l_01.tga
+		rgbGen vertexLit
+		tcmod scale 0.3 0.3 
+	}
+}
+
+textures/terrain/mxterra9_2
+{
+	surfaceparm snowsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/snow/s_grass_ml03b.tga
+		tcmod scale 0.3 0.3
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra9_0to1
+{
+	surfaceparm snowsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/snow/s_dirt_m03i_2.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.3 0.3 
+	}
+	{
+		map textures/snow/s_floor_l_01.tga
+		tcmod scale 0.3 0.3
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra9_0to2
+{
+	surfaceparm snowsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/snow/s_dirt_m03i_2.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.3 0.3
+	}
+	{
+		map textures/snow/s_grass_ml03b.tga
+		tcmod scale 0.3 0.3 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra9_1to2
+{
+	surfaceparm snowsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/snow/s_floor_l_01.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.3 0.3 
+	}
+	{
+		map textures/snow/s_grass_ml03b.tga
+		tcmod scale 0.3 0.3 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+///////////////// training ///////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra10_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0t.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1
+	}
+
+}
+
+textures/terrain/mxterra10_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1 
+	}
+
+}
+
+textures/terrain/mxterra10_2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2t.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+	
+
+}
+
+textures/terrain/mxterra10_3
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+
+
+}
+
+textures/terrain/mxterra10_4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock4c.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+	}
+
+
+}
+
+textures/terrain/mxterra10_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0t.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock1b.tga
+		tcmod scale 0.1 0.1
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+
+}
+
+textures/terrain/mxterra10_0to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0t.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock2t.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+
+}
+
+textures/terrain/mxterra10_0to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0t.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	
+
+}
+
+textures/terrain/mxterra10_0to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0t.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock4c.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+
+}
+
+textures/terrain/mxterra10_1to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock2t.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+}
+
+textures/terrain/mxterra10_1to3
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+}
+
+textures/terrain/mxterra10_1to4
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock4c.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+}
+
+textures/terrain/mxterra10_2to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2t.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+}
+
+textures/terrain/mxterra10_2to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2t.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock4c.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+}
+
+textures/terrain/mxterra10_3to4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3g.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock4c.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+}
+
+
+///////////////// dam terrain ////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra11_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1
+	}
+}
+
+textures/terrain/mxterra11_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1 
+	}
+}
+
+textures/terrain/mxterra11_2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2b.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra11_3
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3aa.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra11_4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra11_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock1b.tga
+		tcmod scale 0.1 0.1
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra11_0to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock2b.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra11_0to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock3aa.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra11_0to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+textures/terrain/mxterra11_1to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock2b.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra11_1to3
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock3aa.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra11_1to4
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra11_2to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock3aa.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra11_2to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra11_3to4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3aa.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+///////////////// dam skybox /////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra12_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		tcmod scale 1 1
+	}
+}
+
+textures/terrain/mxterra12_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		tcmod scale .75 .75
+	}
+}
+
+textures/terrain/mxterra12_2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2b.tga
+		tcmod scale .75 .75
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra12_3
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale .75 .75
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra12_4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale .75 .75
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra12_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale .75 .75
+	}
+	{
+		map textures/stone/mxrock1b.tga
+		tcmod scale 1 1
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra12_0to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 1 1
+	}
+	{
+		map textures/stone/mxrock2b.tga
+		tcmod scale .75 .75
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra12_0to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 1 1
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale .75 .75
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra12_0to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 1 1
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 1 1
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra12_1to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale .75 .75
+	}
+	{
+		map textures/stone/mxrock2b.tga
+		tcmod scale .75 .75
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra12_1to3
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale .75 .75
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale .75 .75
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra12_1to4
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale .75 .75
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale .75 .75
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra12_2to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale .75 .75
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale .75 .75
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra12_2to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale .75 .75
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale .75 .75
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra12_3to4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3g.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale .75 .75
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale .75 .75
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+///////////////// escape /////////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra13_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/rock/roc_m01p.tga
+		rgbGen vertexLit
+		tcmod scale .05 .05
+	}
+}
+
+textures/terrain/mxterra13_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/rock/roc_m01p.tga
+		rgbGen vertexLit
+		tcmod scale .075 .075
+	}
+
+
+}
+
+textures/terrain/mxterra13_2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/snow/s_grass_ml03a_s.tga
+		tcmod scale .075 .075
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra13_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures//rock/roc_m01aa.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale .075 .075
+	}
+	{
+		map textures/rock/roc_m01p.tga
+		tcmod scale 1 1
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra13_0to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/rock/roc_m01p.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale .05 .05
+	}
+	{
+		map textures/snow/s_grass_ml03a_s.tga
+		tcmod scale .075 .075
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra13_1to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/rock/roc_m01p.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale .075 .075
+	}
+	{
+		map textures/snow/s_grass_ml03a_s.tga
+		tcmod scale .075 .075
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+///////////////// dark forest ////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra14_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1
+	}
+}
+
+textures/terrain/mxterra14_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1 
+	}	
+}
+
+textures/terrain/mxterra14_2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2b.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra14_3
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra14_4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra14_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock1b.tga
+		tcmod scale 0.1 0.1
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra14_0to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock2b.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra14_0to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra14_0to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra14_1to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock2b.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra14_1to3
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra14_1to4
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra14_2to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra14_2to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra14_3to4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3g.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+///////////////// norway /////////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra15_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow0.tga
+		rgbGen vertexLit
+		tcmod scale 0.05 0.05
+	}
+}
+
+textures/terrain/mxterra15_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow1.tga
+		rgbGen vertexLit
+		tcmod scale 0.025 0.025
+	}
+}
+
+textures/terrain/mxterra15_2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow2.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra15_3
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow3.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra15_4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra15_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow0.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxsnow1.tga
+		tcmod scale 0.025 0.025
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra15_0to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05
+	}
+	{
+		map textures/stone/mxsnow2.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra15_0to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05
+	}
+	{
+		map textures/stone/mxsnow3.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra15_0to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05
+	}
+	{
+		map textures/stone/mxsnow4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+textures/terrain/mxterra15_1to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxsnow2.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra15_1to3
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxsnow3.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra15_1to4
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxsnow4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra15_2to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow2.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxsnow3.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra15_2to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow2.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxsnow4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+textures/terrain/mxterra15_3to4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow3.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxsnow4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+
+
+
+
+
+/////////////////end ///////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra16_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+//		map textures/stone/dirt_m03.tga
+		map textures/stone/ground_c09a.tga
+//		map textures/stone/mxrock0t.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1
+	}
+
+}
+
+textures/terrain/mxterra16_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1 
+	}
+
+}
+
+textures/terrain/mxterra16_2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+//	      map textures/stone/ground_c09a.tga
+		map textures/stone/mxrock4ca.tga
+//		map textures/stone/dirt_m03.tga
+		tcmod scale 0.05 0.05
+		rgbGen vertexLit
+	}
+	
+
+}
+// assault_rock/ground_c09a
+// terrain/dirt_m03
+textures/terrain/mxterra16_3
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+
+
+}
+
+textures/terrain/mxterra16_4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/dirt_m03.tga
+//		map textures/stone/mxrock4ca.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+	}
+
+
+}
+
+textures/terrain/mxterra16_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/ground_c09a.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock1b.tga
+		tcmod scale 0.1 0.1
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+
+}
+
+textures/terrain/mxterra16_0to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/ground_c09a.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock4ca.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+
+}
+
+textures/terrain/mxterra16_0to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/ground_c09a.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	
+
+}
+
+textures/terrain/mxterra16_0to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/ground_c09a.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/dirt_m03.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+
+}
+
+textures/terrain/mxterra16_1to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock4ca.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+}
+
+textures/terrain/mxterra16_1to3
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+}
+
+textures/terrain/mxterra16_1to4
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/dirt_m03.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+}
+
+textures/terrain/mxterra16_2to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock4ca.tga
+
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+}
+
+textures/terrain/mxterra16_2to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock4ca.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/dirt_m03.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+}
+
+textures/terrain/mxterra16_3to4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3g.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/dirt_m03.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+}
+
+
+
+///////////////// Boss2 /////////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra17_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow0.tga
+		rgbGen vertexLit
+		tcmod scale 0.05 0.05
+	}
+}
+
+textures/terrain/mxterra17_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow3.tga
+		rgbGen vertexLit
+		tcmod scale 0.025 0.025
+	}
+}
+
+textures/terrain/mxterra17_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow0.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxsnow3.tga
+		tcmod scale 0.025 0.025
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+/////////////////end ///////////////////
+//////////////////////////////////////////////
+
+
+
+
diff --git a/README.md b/README.md
index e2a60c0..dfb237b 100644
--- a/README.md
+++ b/README.md
@@ -31,6 +31,15 @@ The map editor and associated compiling tools are not included. We suggest you u
 
 The original id software readme that accompanied the RTCW source release is named README.txt and is contained within the source tree of both MP and SP games.
 
+### Quick Start Guide
+
+  1. If you have not already done so, install Return to Castle Wolfenstein and remember the target installation directory.
+  2. Browse to the iortcw project release folder: https://github.com/iortcw/iortcw/releases. 
+  3. Download the latest release file for your operating system, as well as patch-data-141.zip.  As of this writing, the latest version of the iortcw release file is v1.51c.
+  4. Extract the latest release zip into a location where you would like to have your installation going forward (For example: c:\Games\iortcw\ in Windows or /home/joe/Games/iortcw/ in Linux).
+  5. Go to the location of your original existing installation, open the “Main” folder, and copy the following files over to your iortcw's  “Main” folder for the single player campaign: **pak0.pk3, sp_pak1.pk3, sp_pak2.pk3, and sp_pak3.pk3**. For multiplayer, copy the following files to your iortcw's “Main” folder: **mp_bin.pk3, mp_pak0.pk3, mp_pak1.pk3, mp_pak2.pk3, mp_pak3.pk3, mp_pak4.pk3, mp_pak5.pk3, mp_pakmaps0.pk3, mp_pakmaps1.pk3, mp_pakmaps2.pk3, mp_pakmaps3.pk3, mp_pakmaps4.pk3, mp_pakmaps5.pk3, and mp_pakmaps6.pk3**.  
+  6. Extract the contents of patch-data-141.zip (or a newer version in the meantime) into your iortcw folder and merge patch-data-141's content into your iortcw folder.  For German, Spanish, French or Italian language support in-game, also extract the contents of one of the respective "patch-data-SP-language" zip files into your iortcw's "Main" folder.
+  7. Go to your iortcw installation folder and start either the “iowolfsp*” file for single player or “iowolfmp*” for multiplayer.  If your system uses a 64-bit processor, run the single player or multiplayer file that ends with **x64**. 
 
 ### Compilation and installation
 
@@ -370,12 +379,13 @@ If you wish to compile external mods as shared libraries on a 64bit platform, an
 
 Add the following code snippet to q_shared.h:
 
-    #ifdef Q3_VM
-    typedef int intptr_t;
-    #else
-    #include <stdint.h>
-    #endif
-
+```c
+#ifdef Q3_VM
+typedef int intptr_t;
+#else
+#include <stdint.h>
+#endif
+```
 
 * Creating standalone games
 
diff --git a/SP/.gitignore b/SP/.gitignore
index 39355ba..4e5fede 100644
--- a/SP/.gitignore
+++ b/SP/.gitignore
@@ -37,3 +37,5 @@ profile
 # Microsoft Visual Studio
 ####################
 *.sdf
+*.opensdf
+*.suo
diff --git a/SP/Makefile b/SP/Makefile
index 667aeeb..42c0624 100644
--- a/SP/Makefile
+++ b/SP/Makefile
@@ -3,10 +3,8 @@
 #
 # GNU Make required
 #
-
 COMPILE_PLATFORM=$(shell uname | sed -e 's/_.*//' | tr '[:upper:]' '[:lower:]' | sed -e 's/\//_/g')
-COMPILE_ARCH=$(shell uname -m | sed -e 's/i.86/x86/' | sed -e 's/^arm.*/arm/')
-ARM_VER_CHECK=$(shell uname -m)
+COMPILE_ARCH=$(shell uname -m | sed -e 's/i.86/x86/')
 
 ifeq ($(COMPILE_PLATFORM),sunos)
   # Solaris uname and GNU uname differ
@@ -89,10 +87,6 @@ ifeq ($(COMPILE_ARCH),axp)
   COMPILE_ARCH=alpha
 endif
 
-ifeq ($(COMPILE_ARCH),sparc64)
-  COMPILE_ARCH=sparc
-endif
-
 ifndef ARCH
 ARCH=$(COMPILE_ARCH)
 endif
@@ -123,7 +117,7 @@ endif
 export CROSS_COMPILING
 
 ifndef VERSION
-VERSION=1.51c-SP
+VERSION=1.51d-SP
 endif
 
 ifndef CLIENTBIN
@@ -259,7 +253,7 @@ USE_YACC=0
 endif
 
 ifndef DEBUG_CFLAGS
-DEBUG_CFLAGS=-g -O0
+DEBUG_CFLAGS=-ggdb -O0
 endif
 
 ifndef USE_BLOOM
@@ -300,6 +294,7 @@ OPUSFILEDIR=$(MOUNT_DIR)/opusfile-0.9
 ZDIR=$(MOUNT_DIR)/zlib-1.2.11
 FTDIR=$(MOUNT_DIR)/freetype-2.9
 SPLDIR=$(MOUNT_DIR)/splines
+TOOLSDIR=$(MOUNT_DIR)/tools
 Q3ASMDIR=$(MOUNT_DIR)/tools/asm
 LBURGDIR=$(MOUNT_DIR)/tools/lcc/lburg
 Q3CPPDIR=$(MOUNT_DIR)/tools/lcc/cpp
@@ -348,11 +343,21 @@ ifneq ($(BUILD_CLIENT),0)
   endif
 endif
 
+# Add git version info
+USE_GIT=
+ifeq ($(wildcard ../.git),../.git)
+  GIT_REV=$(shell git show -s --pretty=format:%h-%ad --date=short)
+  ifneq ($(GIT_REV),)
+    VERSION:=$(VERSION)_GIT_$(GIT_REV)
+    USE_GIT=1
+  endif
+endif
+
+
 #############################################################################
 # SETUP AND BUILD -- LINUX
 #############################################################################
 
-## Defaults
 INSTALL=install
 MKDIR=mkdir -p
 EXTRA_FILES=
@@ -363,41 +368,43 @@ ifneq (,$(findstring "$(COMPILE_PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu
 endif
 
 ifneq (,$(findstring "$(PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu" "gnu"))
-
   BASE_CFLAGS = -Wall -fno-strict-aliasing \
     -pipe -DUSE_ICON -DARCH_STRING=\\\"$(FILE_ARCH)\\\"
   CLIENT_CFLAGS += $(SDL_CFLAGS)
 
-  OPTIMIZEVM = -O3
-  OPTIMIZE = $(OPTIMIZEVM) -ffast-math
-
   ifeq ($(ARCH),x86_64)
     OPTIMIZEVM = -O3
     OPTIMIZE = $(OPTIMIZEVM) -ffast-math
-  endif
+  else
   ifeq ($(ARCH),x86)
     OPTIMIZEVM = -O3 -march=i586
     OPTIMIZE = $(OPTIMIZEVM) -ffast-math
-  endif
+  else
   ifeq ($(ARCH),ppc)
+    OPTIMIZEVM = -O3
+    OPTIMIZE = $(OPTIMIZEVM) -ffast-math
     ALTIVEC_CFLAGS = -maltivec
   endif
   ifeq ($(ARCH),ppc64)
+    OPTIMIZEVM = -O3
+    OPTIMIZE = $(OPTIMIZEVM) -ffast-math
     ALTIVEC_CFLAGS = -maltivec
   endif
   ifeq ($(ARCH),sparc)
-    OPTIMIZE += -mtune=ultrasparc3 -mv8plus
-    OPTIMIZEVM += -mtune=ultrasparc3 -mv8plus
+    OPTIMIZEVM += -mcpu=v9 -mtune=v9 -mv8plus
+    OPTIMIZE = $(OPTIMIZEVM) -ffast-math
   endif
   ifeq ($(ARCH),sparc64)
-    OPTIMIZE += -mtune=ultrasparc3 -mv8plus
-    OPTIMIZEVM += -mtune=ultrasparc3 -mv8plus
+    OPTIMIZEVM += -mcpu=v9 -mtune=v9 -mv8plus
+    OPTIMIZE = $(OPTIMIZEVM) -ffast-math
   endif
   ifeq ($(ARCH),alpha)
     # According to http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=410555
     # -ffast-math will cause the client to die with SIGFPE on Alpha
     OPTIMIZE = $(OPTIMIZEVM)
   endif
+  endif
+  endif
 
   SHLIBEXT=so
   SHLIBCFLAGS=-fPIC -fvisibility=hidden
@@ -414,11 +421,11 @@ ifneq (,$(findstring "$(PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu" "gnu")
     ifeq ($(CROSS_COMPILING),1)
       ifeq ($(ARCH),x86)
       SDL_LIBS = $(LIBSDIR)/linux32/libSDL2main.a \
-                 $(LIBSDIR)/linux32/libSDL2-2.0.so.0.9.0
+                 $(LIBSDIR)/linux32/libSDL2-2.0.so.0.18.0
       endif
       ifeq ($(ARCH),x86_64)
       SDL_LIBS = $(LIBSDIR)/linux64/libSDL2main.a \
-                 $(LIBSDIR)/linux64/libSDL2-2.0.so.0.9.0
+                 $(LIBSDIR)/linux64/libSDL2-2.0.so.0.18.0
       endif
     endif
   endif
@@ -463,31 +470,55 @@ ifeq ($(PLATFORM),darwin)
   LIBS = -framework Cocoa
   CLIENT_LIBS=
   RENDERER_LIBS=
-  OPTIMIZEVM= -O3
+  OPTIMIZEVM = -O3
+
+  # Default minimum Mac OS X version
+  ifeq ($(MACOSX_VERSION_MIN),)
+    MACOSX_VERSION_MIN=10.5
+    ifeq ($(ARCH),arm64)
+      MACOSX_VERSION_MIN=11.0
+    endif
+  endif
+
+  MACOSX_MAJOR=$(shell echo $(MACOSX_VERSION_MIN) | cut -d. -f1)
+  MACOSX_MINOR=$(shell echo $(MACOSX_VERSION_MIN) | cut -d. -f2)
+  ifeq ($(shell test $(MACOSX_MINOR) -gt 9; echo $$?),0)
+    # Multiply and then remove decimal. 10.10 -> 101000.0 -> 101000
+    MAC_OS_X_VERSION_MIN_REQUIRED=$(shell echo "$(MACOSX_MAJOR) * 10000 + $(MACOSX_MINOR) * 100" | bc | cut -d. -f1)
+  else
+    # Multiply by 100 and then remove decimal. 10.7 -> 1070.0 -> 1070
+    MAC_OS_X_VERSION_MIN_REQUIRED=$(shell echo "$(MACOSX_VERSION_MIN) * 100" | bc | cut -d. -f1)
+  endif
+
+  LDFLAGS += -mmacosx-version-min=$(MACOSX_VERSION_MIN)
+  BASE_CFLAGS += -mmacosx-version-min=$(MACOSX_VERSION_MIN) \
+                 -DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED)
 
-  BASE_CFLAGS = -Wall
+  MACOSX_ARCH=$(ARCH)
+  ifeq ($(ARCH),x86)
+    MACOSX_ARCH=i386
+  endif
 
   ifeq ($(ARCH),ppc)
-    BASE_CFLAGS += -arch ppc -mmacosx-version-min=10.5 \
-      -DMAC_OS_X_VERSION_MIN_REQUIRED=1050 -DMAC_OS_X_VERSION_MAX_ALLOWED=1060
+    BASE_CFLAGS += -arch ppc
     ALTIVEC_CFLAGS = -faltivec
   endif
   ifeq ($(ARCH),ppc64)
-    BASE_CFLAGS += -arch ppc64 -mmacosx-version-min=10.5 \
-      -DMAC_OS_X_VERSION_MIN_REQUIRED=1050 -DMAC_OS_X_VERSION_MAX_ALLOWED=1060
+    BASE_CFLAGS += -arch ppc64
     ALTIVEC_CFLAGS = -faltivec
   endif
   ifeq ($(ARCH),x86)
     OPTIMIZEVM += -march=prescott -mfpmath=sse
     # x86 vm will crash without -mstackrealign since MMX instructions will be
     # used no matter what and they corrupt the frame pointer in VM calls
-    BASE_CFLAGS += -arch i386 -mstackrealign -mmacosx-version-min=10.6 \
-      -DMAC_OS_X_VERSION_MIN_REQUIRED=1060
+    BASE_CFLAGS += -arch i386 -m32 -mstackrealign
   endif
   ifeq ($(ARCH),x86_64)
     OPTIMIZEVM += -mfpmath=sse
-    BASE_CFLAGS += -arch x86_64 -mmacosx-version-min=10.6 \
-      -DMAC_OS_X_VERSION_MIN_REQUIRED=1060
+    BASE_CFLAGS += -arch x86_64
+  endif
+  ifeq ($(ARCH),arm64)
+    BASE_CFLAGS += -arch arm64
   endif
 
   # When compiling on OSX for OSX, we're not cross compiling as far as the
@@ -498,26 +529,47 @@ ifeq ($(PLATFORM),darwin)
   endif
 
   ifeq ($(CROSS_COMPILING),1)
-    ifeq ($(ARCH),ppc)
-      CC=powerpc-apple-darwin10-gcc
-      RANLIB=powerpc-apple-darwin10-ranlib
-    else
-      ifeq ($(ARCH),x86)
-        CC=i686-apple-darwin10-gcc
-        RANLIB=i686-apple-darwin10-ranlib
-      else
-        $(error Architecture $(ARCH) is not supported when cross compiling)
+    # If CC is already set to something generic, we probably want to use
+    # something more specific
+    ifneq ($(findstring $(strip $(CC)),cc gcc),)
+      CC=
+    endif
+
+    ifndef CC
+      ifndef DARWIN
+        # macOS 10.5 SDK
+          DARWIN=9
+        ifeq ($(ARCH),arm64)
+          # macOS 11.0 SDK
+          DARWIN=20.1
+        endif
+      endif
+
+      CC=$(MACOSX_ARCH)-apple-darwin$(DARWIN)-cc
+      RANLIB=$(MACOSX_ARCH)-apple-darwin$(DARWIN)-ranlib
+      LIPO=$(MACOSX_ARCH)-apple-darwin$(DARWIN)-lipo
+
+      ifeq ($(call bin_path, $(CC)),)
+        $(error Unable to find osxcross $(CC))
       endif
     endif
   endif
 
+  ifndef LIPO
+    LIPO=lipo
+  endif
+
   BASE_CFLAGS += -fno-strict-aliasing -fno-common -pipe
 
   ifeq ($(USE_OPENAL),1)
+    ifneq ($(USE_LOCAL_HEADERS),1)
+      CLIENT_CFLAGS += -I/System/Library/Frameworks/OpenAL.framework/Headers
+    endif
     ifneq ($(USE_OPENAL_DLOPEN),1)
       ifneq ($(USE_INTERNAL_LIBS),1)
         CLIENT_CFLAGS += $(OPENAL_CFLAGS)
         CLIENT_LIBS += $(THREAD_LIBS) $(OPENAL_LIBS)
+        CLIENT_EXTRA_FILES += $(LIBSDIR)/macosx/libopenal.dylib
       else
         CLIENT_LIBS += -framework OpenAL
       endif
@@ -533,30 +585,28 @@ ifeq ($(PLATFORM),darwin)
 
   BASE_CFLAGS += -D_THREAD_SAFE=1
 
+  CLIENT_LIBS += -framework IOKit
+  RENDERER_LIBS += -framework OpenGL
+
   ifeq ($(USE_LOCAL_HEADERS),1)
+    # libSDL2-2.0.0.dylib for PPC is SDL 2.0.1 + changes to compile
     ifneq ($(findstring $(ARCH),ppc ppc64),)
-      CLIENT_CFLAGS += -I$(SDLHDIR)/include-2.0.1
+      BASE_CFLAGS += -I$(SDLHDIR)/include-2.0.1
     else
-      CLIENT_CFLAGS += -I$(SDLHDIR)/include
+      BASE_CFLAGS += -I$(SDLHDIR)/include
     endif
-  else
-    CLIENT_CFLAGS += $(SDL_CFLAGS)
-  endif
 
-  # We copy sdlmain before ranlib'ing it so that subversion doesn't think
-  #  the file has been modified by each build.
-  ifeq ($(USE_INTERNAL_LIBS),1)
+    # We copy sdlmain before ranlib'ing it so that subversion doesn't think
+    #  the file has been modified by each build.
     LIBSDLMAIN=$(B)/libSDL2main.a
     LIBSDLMAINSRC=$(LIBSDIR)/macosx/libSDL2main.a
-    CLIENT_LIBS += -framework IOKit $(LIBSDIR)/macosx/libSDL2-2.0.0.dylib
-    RENDERER_LIBS += -framework OpenGL $(LIBSDIR)/macosx/libSDL2-2.0.0.dylib
+    CLIENT_LIBS += $(LIBSDIR)/macosx/libSDL2-2.0.0.dylib
+    RENDERER_LIBS += $(LIBSDIR)/macosx/libSDL2-2.0.0.dylib
+    CLIENT_EXTRA_FILES += $(LIBSDIR)/macosx/libSDL2-2.0.0.dylib
   else
-    CLIENT_LIBS += -framework IOKit $(SDL_LIBS)
-    RENDERER_LIBS += -framework OpenGL $(SDL_LIBS)
-  endif
-
-  ifeq ($(USE_INTERNAL_LIBS),1)
-    CLIENT_EXTRA_FILES += $(LIBSDIR)/macosx/libSDL2-2.0.0.dylib $(LIBSDIR)/macosx/libopenal.dylib
+    BASE_CFLAGS += -I/Library/Frameworks/SDL2.framework/Headers
+    CLIENT_LIBS += -framework SDL2
+    RENDERER_LIBS += -framework SDL2
   endif
 
   OPTIMIZE = $(OPTIMIZEVM) -ffast-math
@@ -624,7 +674,7 @@ ifdef MINGW
   # using generic windres if specific one is not present
   ifndef WINDRES
     WINDRES=windres
-   endif
+  endif
 
   ifeq ($(CC),)
     $(error Cannot find a suitable cross compiler for $(PLATFORM))
@@ -659,6 +709,11 @@ ifdef MINGW
   SHLIBCFLAGS=
   SHLIBLDFLAGS=-shared $(LDFLAGS)
 
+  # clang 3.5 doesn't support this
+  ifneq ("$(CC)", $(findstring "$(CC)", "clang" "clang++"))
+    LDFLAGS += -mwindows -static -static-libgcc -static-libstdc++
+  endif
+
   BINEXT=.exe
 
   ifeq ($(CROSS_COMPILING),0)
@@ -667,14 +722,22 @@ ifdef MINGW
 
   ifeq ($(COMPILE_PLATFORM),cygwin)
     TOOLS_BINEXT=.exe
-    TOOLS_CC=$(CC)
+    
+    # Under cygwin the default of using gcc for TOOLS_CC won't work, so
+    # we need to figure out the appropriate compiler to use, based on the
+    # host architecture that we're running under (as tools run on the host)
+    ifeq ($(COMPILE_ARCH),x86_64)
+      TOOLS_MINGW_PREFIXES=x86_64-w64-mingw32 amd64-mingw32msvc
+    endif
+    ifeq ($(COMPILE_ARCH),x86)
+      TOOLS_MINGW_PREFIXES=i686-w64-mingw32 i586-mingw32msvc i686-pc-mingw32
+    endif
+
+    TOOLS_CC=$(firstword $(strip $(foreach TOOLS_MINGW_PREFIX, $(TOOLS_MINGW_PREFIXES), \
+      $(call bin_path, $(TOOLS_MINGW_PREFIX)-gcc))))
   endif
 
   LIBS= -lws2_32 -lwinmm -lpsapi
-  # clang 3.5 doesn't support this
-  ifneq ("$(CC)", $(findstring "$(CC)", "clang" "clang++"))
-    CLIENT_LDFLAGS += -mwindows -static -static-libgcc -static-libstdc++
-  endif
   CLIENT_LIBS = -lgdi32 -lole32
   RENDERER_LIBS = -lgdi32 -lole32
 
@@ -700,28 +763,25 @@ ifdef MINGW
     endif
   endif
 
+
   # libmingw32 must be linked before libSDLmain
   CLIENT_LIBS += -lmingw32
   RENDERER_LIBS += -lmingw32
 
   ifeq ($(USE_LOCAL_HEADERS),1)
     CLIENT_CFLAGS += -I$(SDLHDIR)/include
-  endif
-
-  ifeq ($(USE_INTERNAL_LIBS),1)
     ifeq ($(ARCH),x86)
     CLIENT_LIBS += $(LIBSDIR)/win32/libSDL2main.a \
-                   $(LIBSDIR)/win32/libSDL2.dll.a
+                      $(LIBSDIR)/win32/libSDL2.dll.a
     RENDERER_LIBS += $(LIBSDIR)/win32/libSDL2main.a \
-                     $(LIBSDIR)/win32/libSDL2.dll.a
+                      $(LIBSDIR)/win32/libSDL2.dll.a
     SDLDLL=SDL2.dll
     CLIENT_EXTRA_FILES += $(LIBSDIR)/win32/SDL2.dll $(LIBSDIR)/win32/OpenAL32.dll
-    endif
-    ifeq ($(ARCH),x86_64)
+    else
     CLIENT_LIBS += $(LIBSDIR)/win64/libSDL264main.a \
-                   $(LIBSDIR)/win64/libSDL264.dll.a
+                      $(LIBSDIR)/win64/libSDL264.dll.a
     RENDERER_LIBS += $(LIBSDIR)/win64/libSDL264main.a \
-                     $(LIBSDIR)/win64/libSDL264.dll.a
+                      $(LIBSDIR)/win64/libSDL264.dll.a
     SDLDLL=SDL264.dll
     CLIENT_EXTRA_FILES += $(LIBSDIR)/win64/SDL264.dll $(LIBSDIR)/win64/OpenAL64.dll
     endif
@@ -735,52 +795,112 @@ ifdef MINGW
 else # ifdef MINGW
 
 #############################################################################
-# SETUP AND BUILD -- *BSD (is dying)
+# SETUP AND BUILD -- FREEBSD
 #############################################################################
 
-ifneq (,$(findstring "$(PLATFORM)", "freebsd" "openbsd" "netbsd"))
+ifeq ($(PLATFORM),freebsd)
 
-  BASE_CFLAGS = -Wall -fno-strict-aliasing \
-    -pipe -DUSE_ICON -DMAP_ANONYMOUS=MAP_ANON
+  # flags
+  BASE_CFLAGS = \
+    -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \
+    -DUSE_ICON -DMAP_ANONYMOUS=MAP_ANON
   CLIENT_CFLAGS += $(SDL_CFLAGS)
 
-  OPTIMIZEVM = -O3
+  OPTIMIZEVM =
   OPTIMIZE = $(OPTIMIZEVM) -ffast-math
 
+  SHLIBEXT=so
+  SHLIBCFLAGS=-fPIC
+  SHLIBLDFLAGS=-shared $(LDFLAGS)
+
+  THREAD_LIBS=-lpthread
+  # don't need -ldl (FreeBSD)
+  LIBS=-lm
+
+  CLIENT_LIBS =
+
+  CLIENT_LIBS += $(SDL_LIBS)
+  RENDERER_LIBS = $(SDL_LIBS)
+
+  # optional features/libraries
+  ifeq ($(USE_OPENAL),1)
+    ifeq ($(USE_OPENAL_DLOPEN),1)
+      CLIENT_LIBS += $(THREAD_LIBS) $(OPENAL_LIBS)
+    endif
+  endif
+
+  ifeq ($(USE_CURL),1)
+    CLIENT_CFLAGS += $(CURL_CFLAGS)
+    ifeq ($(USE_CURL_DLOPEN),1)
+      CLIENT_LIBS += $(CURL_LIBS)
+    endif
+  endif
+
+  # cross-compiling tweaks
+  ifeq ($(ARCH),x86)
+    ifeq ($(CROSS_COMPILING),1)
+      BASE_CFLAGS += -m32
+    endif
+  endif
+  ifeq ($(ARCH),x86_64)
+    ifeq ($(CROSS_COMPILING),1)
+      BASE_CFLAGS += -m64
+    endif
+  endif
+else # ifeq freebsd
+
+#############################################################################
+# SETUP AND BUILD -- OPENBSD
+#############################################################################
+
+ifeq ($(PLATFORM),openbsd)
+
+  BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \
+    -pipe -DUSE_ICON -DMAP_ANONYMOUS=MAP_ANON
+  CLIENT_CFLAGS += $(SDL_CFLAGS)
+
   ifeq ($(ARCH),x86_64)
     OPTIMIZEVM = -O3
     OPTIMIZE = $(OPTIMIZEVM) -ffast-math
-    FILE_ARCH = amd64
-  endif
+  else
   ifeq ($(ARCH),x86)
     OPTIMIZEVM = -O3 -march=i586
     OPTIMIZE = $(OPTIMIZEVM) -ffast-math
-  endif
+  else
   ifeq ($(ARCH),ppc)
+    OPTIMIZEVM = -O3
+    OPTIMIZE = $(OPTIMIZEVM) -ffast-math
     ALTIVEC_CFLAGS = -maltivec
   endif
   ifeq ($(ARCH),ppc64)
+    OPTIMIZEVM = -O3
+    OPTIMIZE = $(OPTIMIZEVM) -ffast-math
     ALTIVEC_CFLAGS = -maltivec
   endif
   ifeq ($(ARCH),sparc)
-    OPTIMIZE += -mtune=ultrasparc3 -mv8plus
-    OPTIMIZEVM += -mtune=ultrasparc3 -mv8plus
+    OPTIMIZEVM += -mcpu=v9 -mtune=v9 -mv8plus
+    OPTIMIZE = $(OPTIMIZEVM) -ffast-math
   endif
   ifeq ($(ARCH),sparc64)
-    OPTIMIZE += -mtune=ultrasparc3 -mv8plus
-    OPTIMIZEVM += -mtune=ultrasparc3 -mv8plus
+    OPTIMIZEVM += -mcpu=v9 -mtune=v9 -mv8plus
+    OPTIMIZE = $(OPTIMIZEVM) -ffast-math
   endif
   ifeq ($(ARCH),alpha)
     # According to http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=410555
     # -ffast-math will cause the client to die with SIGFPE on Alpha
     OPTIMIZE = $(OPTIMIZEVM)
   endif
+  endif
+  endif
 
   ifeq ($(USE_CURL),1)
     CLIENT_CFLAGS += $(CURL_CFLAGS)
     USE_CURL_DLOPEN=0
   endif
 
+  # no shm_open on OpenBSD
+  USE_MUMBLE=0
+
   SHLIBEXT=so
   SHLIBCFLAGS=-fPIC
   SHLIBLDFLAGS=-shared $(LDFLAGS)
@@ -804,7 +924,28 @@ ifneq (,$(findstring "$(PLATFORM)", "freebsd" "openbsd" "netbsd"))
       CLIENT_LIBS += $(CURL_LIBS)
     endif
   endif
-else # ifeq *BSD
+else # ifeq openbsd
+
+#############################################################################
+# SETUP AND BUILD -- NETBSD
+#############################################################################
+
+ifeq ($(PLATFORM),netbsd)
+
+  LIBS=-lm
+  SHLIBEXT=so
+  SHLIBCFLAGS=-fPIC
+  SHLIBLDFLAGS=-shared $(LDFLAGS)
+  THREAD_LIBS=-lpthread
+
+  BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes
+
+  ifeq ($(ARCH),x86)
+    HAVE_VM_COMPILED=true
+  endif
+
+  BUILD_CLIENT = 0
+else # ifeq netbsd
 
 #############################################################################
 # SETUP AND BUILD -- IRIX
@@ -847,7 +988,9 @@ ifeq ($(PLATFORM),sunos)
 
   ifneq ($(ARCH),x86)
     ifneq ($(ARCH),sparc)
-      $(error arch $(ARCH) is currently not supported)
+      ifneq ($(ARCH),sparc64)
+        $(error arch $(ARCH) is currently not supported)
+      endif
     endif
   endif
 
@@ -855,19 +998,23 @@ ifeq ($(PLATFORM),sunos)
     -pipe -DUSE_ICON
   CLIENT_CFLAGS += $(SDL_CFLAGS)
 
-  OPTIMIZEVM = -O3
-
   ifeq ($(ARCH),sparc)
-    OPTIMIZEVM += -O3 -mtune=ultrasparc3 -mv8plus -mno-faster-structs
+    OPTIMIZEVM += -mcpu=v9 -mtune=v9 -mv8plus
+    OPTIMIZE = $(OPTIMIZEVM) -ffast-math
+  endif
+  ifeq ($(ARCH),sparc64)
+    OPTIMIZEVM += -mcpu=v9 -mtune=v9 -mv8plus
+    OPTIMIZE = $(OPTIMIZEVM) -ffast-math
   endif
   ifeq ($(ARCH),x86)
-    OPTIMIZEVM += -march=i586
+    OPTIMIZEVM += -march=i586 -fomit-frame-pointer \
+      -falign-functions=2 -fstrength-reduce
+    OPTIMIZE = $(OPTIMIZEVM) -ffast-math
+    BASE_CFLAGS += -m32
     CLIENT_CFLAGS += -I/usr/X11/include/NVIDIA
     CLIENT_LDFLAGS += -L/usr/X11/lib/NVIDIA -R/usr/X11/lib/NVIDIA
   endif
 
-  OPTIMIZE = $(OPTIMIZEVM) -ffast-math
-
   SHLIBEXT=so
   SHLIBCFLAGS=-fPIC
   SHLIBLDFLAGS=-shared $(LDFLAGS)
@@ -885,7 +1032,7 @@ else # ifeq sunos
 #############################################################################
 # SETUP AND BUILD -- GENERIC
 #############################################################################
-  BASE_CFLAGS =
+  BASE_CFLAGS=
   OPTIMIZE = -O3
 
   SHLIBEXT=so
@@ -895,7 +1042,9 @@ else # ifeq sunos
 endif #Linux
 endif #darwin
 endif #MINGW
-endif #*BSD
+endif #FreeBSD
+endif #OpenBSD
+endif #NetBSD
 endif #IRIX
 endif #SunOS
 
@@ -934,11 +1083,7 @@ ifndef HAVE_VM_COMPILED
   HAVE_VM_COMPILED=false
 endif
 
-ifneq ($(findstring $(ARCH),x86 x86_64 ppc ppc64 sparc sparc64),)
-  HAVE_VM_COMPILED=true
-endif
-
-ifeq ($(ARM_VER_CHECK),armv7l)
+ifneq ($(filter $(ARCH),armv7l x86 x86_64 ppc sparc),)
   HAVE_VM_COMPILED=true
 endif
 
@@ -1031,7 +1176,7 @@ endif
 
 ifeq ($(NEED_OPUS),1)
   ifeq ($(USE_INTERNAL_OPUS),1)
-      OPUS_CFLAGS = -DOPUS_BUILD -DHAVE_LRINTF -DFLOAT_APPROX -DUSE_ALLOCA \
+    OPUS_CFLAGS = -DOPUS_BUILD -DHAVE_LRINTF -DFLOATING_POINT -DFLOAT_APPROX -DUSE_ALLOCA \
       -I$(OPUSDIR)/include -I$(OPUSDIR)/celt -I$(OPUSDIR)/silk \
       -I$(OPUSDIR)/silk/float -I$(OPUSFILEDIR)/include
   else
@@ -1093,7 +1238,7 @@ ifeq ($(USE_INTERNAL_JPEG),1)
   BASE_CFLAGS += -DUSE_INTERNAL_JPEG
   BASE_CFLAGS += -I$(JPDIR)
 else
-  # IJG libjpeg doesn't have $(PKG_CONFIG), but libjpeg-turbo uses libjpeg.pc;
+  # IJG libjpeg doesn't have pkg-config, but libjpeg-turbo uses libjpeg.pc;
   # we fall back to hard-coded answers if libjpeg.pc is unavailable
   JPEG_CFLAGS ?= $(shell $(PKG_CONFIG) --silence-errors --cflags libjpeg || true)
   JPEG_LIBS ?= $(shell $(PKG_CONFIG) --silence-errors --libs libjpeg || echo -ljpeg)
@@ -1193,9 +1338,7 @@ endef
 define DO_REF_STR
 $(echo_cmd) "REF_STR $<"
 $(Q)rm -f $@
-$(Q)echo "const char *fallbackShader_$(notdir $(basename $<)) =" >> $@
-$(Q)cat $< | sed -e 's/^/\"/;s/$$/\\n\"/' | tr -d '\r' >> $@
-$(Q)echo ";" >> $@
+$(Q)$(STRINGIFY) $< $@
 endef
 
 define DO_BOT_CC
@@ -1325,7 +1468,7 @@ targets: makedirs
 	@echo "  PKG_CONFIG: $(PKG_CONFIG)"
 	@echo "  CC: $(CC)"
 	@echo "  CXX: $(CXX)"
-ifdef MINGW
+ifeq ($(PLATFORM),mingw32)
 	@echo "  WINDRES: $(WINDRES)"
 endif
 	@echo ""
@@ -1338,10 +1481,20 @@ endif
 	@echo "  SERVER_CFLAGS:"
 	$(call print_wrapped, $(SERVER_CFLAGS))
 	@echo ""
+	@echo "  TOOLS_CFLAGS:"
+	$(call print_wrapped, $(TOOLS_CFLAGS))
+	@echo ""
 	@echo "  LDFLAGS:"
-ifneq ($(LDFLAGS),)
 	$(call print_wrapped, $(LDFLAGS))
-endif
+	@echo ""
+	@echo "  CLIENT_LDFLAGS:"
+	$(call print_wrapped, $(CLIENT_LDFLAGS))
+	@echo ""
+	@echo "  SERVER_LDFLAGS:"
+	$(call print_wrapped, $(SERVER_LDFLAGS))
+	@echo ""
+	@echo "  TOOLS_LDFLAGS:"
+	$(call print_wrapped, $(TOOLS_LDFLAGS))
 	@echo ""
 	@echo "  LIBS:"
 	$(call print_wrapped, $(LIBS))
@@ -1349,6 +1502,15 @@ endif
 	@echo "  CLIENT_LIBS:"
 	$(call print_wrapped, $(CLIENT_LIBS))
 	@echo ""
+	@echo "  RENDERER_LIBS:"
+	$(call print_wrapped, $(RENDERER_LIBS))
+	@echo ""
+	@echo "  TOOLS_LIBS:"
+	$(call print_wrapped, $(TOOLS_LIBS))
+	@echo ""
+	@echo "  SERVER_LIBS:"
+	$(call print_wrapped, $(SERVER_LIBS))
+	@echo ""
 	@echo "  Output:"
 	$(call print_list, $(NAKED_TARGETS))
 	@echo ""
@@ -1367,8 +1529,17 @@ else
 endif
 
 $(B).zip: $(TARGETS)
+ifeq ($(PLATFORM),darwin)
+  ifdef ARCHIVE
+	@("./make-macosx-app.sh" release $(ARCH); if [ "$$?" -eq 0 ] && [ -d "$(B)/iowolfsp.app" ]; then rm -f $@; cd $(B) && zip --symlinks -r9 ../../$@ `find "iowolfsp.app" -print | sed -e "s!$(B)/!!g"`; else rm -f $@; cd $(B) && zip -r9 ../../$@ $(NAKED_TARGETS); fi)
+  endif
+endif
+ifneq ($(PLATFORM),darwin)
+  ifdef ARCHIVE
 	@rm -f $@
 	@(cd $(B) && zip -r9 ../../$@ $(NAKED_TARGETS))
+  endif
+endif
 
 makedirs:
 	@$(MKDIR) $(B)/splines
@@ -1436,6 +1607,7 @@ Q3RCC       = $(B)/tools/q3rcc$(TOOLS_BINEXT)
 Q3CPP       = $(B)/tools/q3cpp$(TOOLS_BINEXT)
 Q3LCC       = $(B)/tools/q3lcc$(TOOLS_BINEXT)
 Q3ASM       = $(B)/tools/q3asm$(TOOLS_BINEXT)
+STRINGIFY   = $(B)/tools/stringify$(TOOLS_BINEXT)
 
 LBURGOBJ= \
   $(B)/tools/lburg/lburg.o \
@@ -1529,6 +1701,10 @@ $(Q3LCC): $(Q3LCCOBJ) $(Q3RCC) $(Q3CPP)
 	$(echo_cmd) "LD $@"
 	$(Q)$(TOOLS_CC) $(TOOLS_CFLAGS) $(TOOLS_LDFLAGS) -o $@ $(Q3LCCOBJ) $(TOOLS_LIBS)
 
+$(STRINGIFY): $(TOOLSDIR)/stringify.c
+	$(echo_cmd) "TOOLS_CC $@"
+	$(Q)$(TOOLS_CC) $(TOOLS_CFLAGS) $(TOOLS_LDFLAGS) -o $@ $(TOOLSDIR)/stringify.c $(TOOLS_LIBS)
+
 define DO_Q3LCC
 $(echo_cmd) "Q3LCC $<"
 $(Q)$(Q3LCC) $(BASEGAME_CFLAGS) -o $@ $<
@@ -2121,15 +2297,16 @@ endif
 
 ifeq ($(HAVE_VM_COMPILED),true)
   ifneq ($(findstring $(ARCH),x86 x86_64),)
-    Q3OBJ += $(B)/client/vm_x86.o
+    Q3OBJ += \
+      $(B)/client/vm_x86.o
   endif
-  ifneq ($(findstring $(ARCH),ppc ppc64),)
+  ifneq ($(findstring $(ARCH),ppc),)
     Q3OBJ += $(B)/client/vm_powerpc.o $(B)/client/vm_powerpc_asm.o
   endif
-  ifneq ($(findstring $(ARCH),sparc sparc64),)
+  ifneq ($(findstring $(ARCH),sparc),)
     Q3OBJ += $(B)/client/vm_sparc.o
   endif
-  ifeq ($(ARM_VER_CHECK),armv7l)
+  ifeq ($(ARCH),armv7l)
     Q3OBJ += $(B)/client/vm_armv7l.o
   endif
 endif
@@ -2186,7 +2363,11 @@ endif
 ifneq ($(strip $(LIBSDLMAIN)),)
 ifneq ($(strip $(LIBSDLMAINSRC)),)
 $(LIBSDLMAIN) : $(LIBSDLMAINSRC)
+ifeq ($(PLATFORM),darwin)
+	$(LIPO) -extract $(MACOSX_ARCH) $< -o $@
+else
 	cp $< $@
+endif
 	$(RANLIB) $@
 endif
 endif
@@ -2292,15 +2473,16 @@ endif
 
 ifeq ($(HAVE_VM_COMPILED),true)
   ifneq ($(findstring $(ARCH),x86 x86_64),)
-    Q3DOBJ += $(B)/ded/vm_x86.o
+    Q3DOBJ += \
+      $(B)/ded/vm_x86.o
   endif
-  ifneq ($(findstring $(ARCH),ppc ppc64),)
+  ifneq ($(findstring $(ARCH),ppc),)
     Q3DOBJ += $(B)/ded/vm_powerpc.o $(B)/ded/vm_powerpc_asm.o
   endif
-  ifneq ($(findstring $(ARCH),sparc sparc64),)
+  ifneq ($(findstring $(ARCH),sparc),)
     Q3DOBJ += $(B)/ded/vm_sparc.o
   endif
-  ifeq ($(ARM_VER_CHECK),armv7l)
+  ifeq ($(ARCH),armv7l)
     Q3DOBJ += $(B)/ded/vm_armv7l.o
   endif
 endif
@@ -2371,11 +2553,11 @@ Q3CGVMOBJ = $(Q3CGOBJ_:%.o=%.asm)
 ifdef MINGW
 $(B)/$(BASEGAME)/cgame_sp_$(SHLIBNAME): $(Q3CGOBJ)
 	$(echo_cmd) "LD $@"
-	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3CGOBJ)
+	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3CGOBJ) $(LIBS)
 else
 $(B)/$(BASEGAME)/cgame.sp.$(SHLIBNAME): $(Q3CGOBJ)
 	$(echo_cmd) "LD $@"
-	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3CGOBJ)
+	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3CGOBJ) $(LIBS)
 endif
 $(B)/$(BASEGAME)/vm/cgame.sp.qvm: $(Q3CGVMOBJ) $(CGDIR)/cg_syscalls.asm $(Q3ASM)
 	$(echo_cmd) "Q3ASM $@"
@@ -2446,11 +2628,11 @@ Q3GVMOBJ = $(Q3GOBJ_:%.o=%.asm)
 ifdef MINGW
 $(B)/$(BASEGAME)/qagame_sp_$(SHLIBNAME): $(Q3GOBJ)
 	$(echo_cmd) "LD $@"
-	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3GOBJ)
+	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3GOBJ) $(LIBS)
 else
 $(B)/$(BASEGAME)/qagame.sp.$(SHLIBNAME): $(Q3GOBJ)
 	$(echo_cmd) "LD $@"
-	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3GOBJ)
+	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3GOBJ) $(LIBS)
 endif
 $(B)/$(BASEGAME)/vm/qagame.sp.qvm: $(Q3GVMOBJ) $(GDIR)/g_syscalls.asm $(Q3ASM)
 	$(echo_cmd) "Q3ASM $@"
@@ -2480,11 +2662,11 @@ Q3UIVMOBJ = $(Q3UIOBJ_:%.o=%.asm)
 ifdef MINGW
 $(B)/$(BASEGAME)/ui_sp_$(SHLIBNAME): $(Q3UIOBJ)
 	$(echo_cmd) "LD $@"
-	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3UIOBJ)
+	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3UIOBJ) $(LIBS)
 else
 $(B)/$(BASEGAME)/ui.sp.$(SHLIBNAME): $(Q3UIOBJ)
 	$(echo_cmd) "LD $@"
-	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3UIOBJ)
+	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3UIOBJ) $(LIBS)
 endif
 $(B)/$(BASEGAME)/vm/ui.sp.qvm: $(Q3UIVMOBJ) $(UIDIR)/ui_syscalls.asm $(Q3ASM)
 	$(echo_cmd) "Q3ASM $@"
@@ -2571,7 +2753,7 @@ $(B)/renderer/%.o: $(RDIR)/%.c
 $(B)/renderer/tr_altivec.o: $(RDIR)/tr_altivec.c
 	$(DO_REF_CC_ALTIVEC)
 
-$(B)/rend2/glsl/%.c: $(R2DIR)/glsl/%.glsl
+$(B)/rend2/glsl/%.c: $(R2DIR)/glsl/%.glsl $(STRINGIFY)
 	$(DO_REF_STR)
 
 $(B)/rend2/glsl/%.o: $(B)/rend2/glsl/%.c
@@ -2683,6 +2865,14 @@ $(B)/ded/win_resource.o: $(SYSDIR)/win_resource.rc $(SYSDIR)/win_manifest.xml
 $(B)/ded/%.o: $(NDIR)/%.c
 	$(DO_DED_CC)
 
+# Extra dependencies to ensure the git version is incorporated
+ifeq ($(USE_GIT),1)
+  $(B)/client/cl_console.o : ../.git
+  $(B)/client/common.o : ../.git
+  $(B)/ded/common.o : ../.git
+endif
+
+
 #############################################################################
 ## GAME MODULE RULES
 #############################################################################
@@ -2734,6 +2924,7 @@ OBJ = $(Q3OBJ) $(Q3ROBJ) $(Q3R2OBJ) $(Q3DOBJ) $(JPGOBJ) $(FTOBJ) \
 TOOLSOBJ = $(LBURGOBJ) $(Q3CPPOBJ) $(Q3RCCOBJ) $(Q3LCCOBJ) $(Q3ASMOBJ)
 STRINGOBJ = $(Q3R2STRINGOBJ)
 
+
 copyfiles: release
 	@if [ ! -d $(COPYDIR)/$(BASEGAME) ]; then echo "You need to set COPYDIR to where your RTCW data is!"; fi
 ifneq ($(BUILD_GAME_SO),0)
@@ -2800,7 +2991,7 @@ toolsclean2:
 	@echo "TOOLS_CLEAN $(B)"
 	@rm -f $(TOOLSOBJ)
 	@rm -f $(TOOLSOBJ_D_FILES)
-	@rm -f $(LBURG) $(DAGCHECK_C) $(Q3RCC) $(Q3CPP) $(Q3LCC) $(Q3ASM)
+	@rm -f $(LBURG) $(DAGCHECK_C) $(Q3RCC) $(Q3CPP) $(Q3LCC) $(Q3ASM) $(STRINGIFY)
 
 distclean: clean toolsclean
 	@rm -rf $(BUILD_DIR)
diff --git a/SP/code/asm/vm_x86_64.asm b/SP/code/asm/vm_x86_64.asm
index 87e04f4..f84eb8f 100644
--- a/SP/code/asm/vm_x86_64.asm
+++ b/SP/code/asm/vm_x86_64.asm
@@ -28,13 +28,35 @@
 ; Call to compiled code after setting up the register environment for the VM
 ; prototype:
 ; uint8_t qvmcall64(int *programStack, int *opStack, intptr_t *instructionPointers, byte *dataBase);
+;
+; This call-stub has its own custom calling convention due to pushing all non-volatile registers
+; to the stack. The game uses set/longjmp which on Windows uses "RtlUnwindEx" to unwind the callstack.
+; This function cannot be unwound by default due to the custom calling convention.
+; To allow unwinding, we need to add custom SEH unwind data to the function.
 
-qvmcall64 PROC
-  push rsi							; push non-volatile registers to stack
+qvmcall64 PROC FRAME
+  push r12							; push all non-volatile registers to stack
+  .pushreg r12
+  push r13
+  .pushreg r13
+  push r14
+  .pushreg r14
+  push r15
+  .pushreg r15
   push rdi
+  .pushreg rdi
+  push rsi
+  .pushreg rsi
   push rbx
+  .pushreg rbx
+  push rbp
+  .pushreg rbp
+  
   ; need to save pointer in rcx so we can write back the programData value to caller
   push rcx
+  .pushreg rcx
+  
+  .endprolog						; custom unwind data ends here
 
   ; registers r8 and r9 have correct value already thanx to __fastcall
   xor rbx, rbx						; opStackOfs starts out being 0
@@ -48,9 +70,14 @@ qvmcall64 PROC
   mov dword ptr [rcx], esi			; write back the programStack value
   mov al, bl						; return opStack offset
 
+  pop rbp							; restore all non-volatile registers after the call
   pop rbx
-  pop rdi
   pop rsi
+  pop rdi
+  pop r15
+  pop r14
+  pop r13
+  pop r12
   
   ret
 qvmcall64 ENDP
diff --git a/SP/code/botlib/be_ai_goal.c b/SP/code/botlib/be_ai_goal.c
index 7628d32..0ffc44a 100644
--- a/SP/code/botlib/be_ai_goal.c
+++ b/SP/code/botlib/be_ai_goal.c
@@ -641,8 +641,7 @@ void BotGoalName( int number, char *name, int size ) {
 	for ( li = levelitems; li; li = li->next )
 	{
 		if ( li->number == number ) {
-			strncpy( name, itemconfig->iteminfo[li->iteminfo].name, size - 1 );
-			name[size - 1] = '\0';
+			Q_strncpyz( name, itemconfig->iteminfo[li->iteminfo].name, size );
 			return;
 		} //end for
 	} //end for
diff --git a/SP/code/cgame/cg_effects.c b/SP/code/cgame/cg_effects.c
index 3246ebc..addbeec 100644
--- a/SP/code/cgame/cg_effects.c
+++ b/SP/code/cgame/cg_effects.c
@@ -519,6 +519,8 @@ void CG_LoseHat( centity_t *cent, vec3_t dir ) {
 		return;
 	}
 
+	CG_GetOriginForTag( cent, &cent->pe.headRefEnt, "tag_mouth", 0, origin, NULL );
+
 	velocity[0] = dir[0] * ( 0.75 + random() ) * GIB_VELOCITY;
 	velocity[1] = dir[1] * ( 0.75 + random() ) * GIB_VELOCITY;
 	velocity[2] = GIB_JUMP - 50 + dir[2] * ( 0.5 + random() ) * GIB_VELOCITY;
diff --git a/SP/code/cgame/cg_ents.c b/SP/code/cgame/cg_ents.c
index 3c9d581..b7a13ac 100644
--- a/SP/code/cgame/cg_ents.c
+++ b/SP/code/cgame/cg_ents.c
@@ -115,25 +115,84 @@ CG_LoseArmor
 ==============
 */
 void CG_LoseArmor( centity_t *cent, int index ) {
+	char *protoTags[] = {   "tag_chest",
+							"tag_calfleft",
+							"tag_armleft",
+							"tag_back",
+							"tag_legleft",
+							"tag_calfright",
+							"tag_armright",
+							"tag_back",
+							"tag_legright"};
+
+	char *ssTags[] = {      "tag_chest",
+							"tag_calfleft",
+							"tag_armleft",
+							"tag_back",
+							"tag_legleft",
+							"tag_calfright",
+							"tag_armright",
+							"tag_back",
+							"tag_legright",
+
+							"tag_footleft",
+							"tag_footright",
+							"tag_sholeft",
+							"tag_shoright",
+							"tag_torso",
+							"tag_calfleft",
+							"tag_calfright"};
+
+	char *heinrichTags[] = {"tag_chest",
+							"tag_calfleft",
+							"tag_armleft",
+							"tag_back",
+							"tag_legleft",
+							"tag_calfright",
+							"tag_armright",
+							"tag_back",
+							"tag_legright",
+
+							"tag_footleft",
+							"tag_footright",
+							"tag_sholeft",
+							"tag_shoright",
+							"tag_torso",
+							"tag_legleft",
+							"tag_legright",
+
+							"tag_sholeft",
+							"tag_shoright",
+							"tag_legleft",
+							"tag_legright",
+							"tag_calfleft",
+							"tag_calfright"};
+
+	//clientInfo_t *ci;
 	// TTimo: bunch of inits
 	int totalparts = 0, dynamicparts = 0, protoParts = 9, superParts = 16, heinrichParts = 22;
+	char        **tags = NULL;
 	qhandle_t   *models = NULL;
 	qhandle_t sound = 0;    //----(SA)	added
 	int dmgbits = 16;         // 32/2;
 	int clientNum;
-	vec3_t origin = { 0 }, velocity, dir;
+	//int tagIndex;
+	vec3_t origin, velocity, dir;
 
 
 	if ( cent->currentState.aiChar == AICHAR_PROTOSOLDIER ) {
+		tags = &protoTags[0];
 		models = &cgs.media.protoArmor[0];
 		dynamicparts = totalparts = protoParts;
 		sound = cgs.media.protoArmorBreak;
 	} else if ( cent->currentState.aiChar == AICHAR_SUPERSOLDIER ) {
+		tags = &ssTags[0];
 		models = &cgs.media.superArmor[0];
 		dynamicparts = 14;  // the other two stay permanent
 		totalparts = superParts;
 		sound = cgs.media.superArmorBreak;
 	} else if ( cent->currentState.aiChar == AICHAR_HEINRICH ) {
+		tags = &heinrichTags[0];
 		models = &cgs.media.heinrichArmor[0];
 		dynamicparts = 20;  // will get kicked down to 16
 		totalparts = heinrichParts;
@@ -154,6 +213,7 @@ void CG_LoseArmor( centity_t *cent, int index ) {
 	if ( clientNum < 0 || clientNum >= MAX_CLIENTS ) {
 		CG_Error( "Bad clientNum on player entity" );
 	}
+	//ci = &cgs.clientinfo[ clientNum ];
 
 	// check if the model for the damaged part to fling is there
 	if ( cent->currentState.dmgFlags & ( 1 << ( index + dynamicparts ) ) ) {
@@ -164,6 +224,8 @@ void CG_LoseArmor( centity_t *cent, int index ) {
 		return;
 	}
 
+	CG_GetOriginForTag( cent, &cent->pe.torsoRefEnt, tags[index], 0, origin, NULL );
+
 	// calculate direction vector based on player center->tag position
 	VectorSubtract( origin, cent->currentState.origin, dir );
 	VectorNormalize( dir );
@@ -174,9 +236,13 @@ void CG_LoseArmor( centity_t *cent, int index ) {
 	}
 //----(SA)	end
 
+//#define FLY_VELOCITY 75
+//#define FLY_JUMP 200
 #define FLY_VELOCITY 200
 #define FLY_JUMP 300
 
+//	velocity[0] = dir[0]*(0.75+random())*FLY_VELOCITY;
+//	velocity[1] = dir[1]*(0.75+random())*FLY_VELOCITY;
 	velocity[0] = dir[0] * FLY_VELOCITY;
 	velocity[1] = dir[1] * FLY_VELOCITY;
 	velocity[2] = FLY_JUMP - 50 + dir[2] * ( 0.5 + random() ) * FLY_VELOCITY;
@@ -201,6 +267,7 @@ void CG_LoseArmor( centity_t *cent, int index ) {
 			re->hModel = models[index + dynamicparts];
 		}
 
+
 		re->fadeStartTime       = le->endTime - 1000;
 		re->fadeEndTime         = le->endTime;
 
@@ -250,6 +317,7 @@ void CG_LoseArmor( centity_t *cent, int index ) {
 	}
 }
 
+
 /*
 ==============
 CG_AttachedPartChange
diff --git a/SP/code/cgame/cg_weapons.c b/SP/code/cgame/cg_weapons.c
index 0e10f0b..6d3d500 100644
--- a/SP/code/cgame/cg_weapons.c
+++ b/SP/code/cgame/cg_weapons.c
@@ -2559,6 +2559,26 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent
 	// Ridah
 	firing = ( ( cent->currentState.eFlags & EF_FIRING ) != 0 );
 
+	// Prevent firing flamethrower and tesla in noclip or when leaning or when underwater
+	if ( ps && firing && (weaponNum == WP_TESLA || weaponNum == WP_FLAMETHROWER) )
+	{
+		vec3_t point;
+		int cont = 0;
+		VectorCopy (ps->origin, point);	// crashes here
+		point[2] += ps->viewheight;
+		cont = trap_CM_PointContents( point, 0 );
+	
+		// player is in noclip mode - no fire
+		if ( ps->pm_type == PM_NOCLIP )
+			firing = qfalse;
+		// player is leaning - no fire
+		if ( ps->leanf != 0 )
+			firing = qfalse;
+		// player is underwater - no fire
+		if ( cont & CONTENTS_WATER )
+			firing = qfalse;
+	}
+
 	CG_PositionEntityOnTag( &gun, parent, "tag_weapon", 0, NULL );
 
 	playerScaled = (qboolean)( cgs.clientinfo[ cent->currentState.clientNum ].playermodelScale[0] != 0 );
@@ -2699,7 +2719,7 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent
 
 
 	// make sure we aren't looking at cg.predictedPlayerEntity for LG
-	nonPredictedCent = &cg_entities[cent->currentState.clientNum];
+	nonPredictedCent = &cg_entities[cent->currentState.number];
 
 	// if the index of the nonPredictedCent is not the same as the clientNum
 	// then this is a fake player (like on the single player podiums), so
diff --git a/SP/code/client/cl_main.c b/SP/code/client/cl_main.c
index b47cd7c..94d4ff9 100644
--- a/SP/code/client/cl_main.c
+++ b/SP/code/client/cl_main.c
@@ -3247,8 +3247,10 @@ static __attribute__ ((format (printf, 2, 3))) void QDECL CL_RefPrintf( int prin
 		Com_Printf( "%s", msg );
 	} else if ( print_level == PRINT_WARNING ) {
 		Com_Printf( S_COLOR_YELLOW "%s", msg );		// yellow
+	} else if ( print_level == PRINT_ERROR ) {
+		Com_Printf (S_COLOR_RED "%s", msg);		// red
 	} else if ( print_level == PRINT_DEVELOPER ) {
-		Com_DPrintf( S_COLOR_RED "%s", msg );		// red
+		Com_DPrintf( S_COLOR_RED "%s", msg );		// red - developer only
 	}
 }
 
diff --git a/SP/code/client/snd_mix.c b/SP/code/client/snd_mix.c
index 2fafd09..7dbcfda 100644
--- a/SP/code/client/snd_mix.c
+++ b/SP/code/client/snd_mix.c
@@ -175,7 +175,7 @@ void S_TransferPaintBuffer(int endtime)
 	{	// general case
 		p = (int *) paintbuffer;
 		count = (endtime - s_paintedtime) * dma.channels;
-		out_idx = (s_paintedtime * dma.channels) % dma.samples;
+		out_idx = ((unsigned int)s_paintedtime * dma.channels) % dma.samples;
 		step = 3 - MIN(dma.channels, 2);
 
 		if ((dma.isfloat) && (dma.samplebits == 32))
diff --git a/SP/code/game/ai_cast_funcs.c b/SP/code/game/ai_cast_funcs.c
index 221c06b..5a6103d 100644
--- a/SP/code/game/ai_cast_funcs.c
+++ b/SP/code/game/ai_cast_funcs.c
@@ -4112,7 +4112,7 @@ char *AIFunc_BattleMG42( cast_state_t *cs ) {
 	//
 	// TODO: play a special "holding mg42" torso animation
 	//
-	//VectorCopy( angles, cs->ideal_viewangles );
+	VectorCopy( angles, cs->ideal_viewangles );
 	if ( cs->triggerReleaseTime < level.time ) {
 		trap_EA_Attack( bs->client );
 		cs->bFlags |= BFL_ATTACKED;
diff --git a/SP/code/game/ai_dmq3.c b/SP/code/game/ai_dmq3.c
index 507f267..368c3b1 100644
--- a/SP/code/game/ai_dmq3.c
+++ b/SP/code/game/ai_dmq3.c
@@ -1983,7 +1983,7 @@ void BotMapScripts( bot_state_t *bs ) {
 						if ( BotSameTeam( bs, i ) ) {
 							shootbutton = qfalse;
 							break;
-						} else if (bs->enemy == i) {
+						} else if (gametype < GT_CTF || bs->enemy == i) {
 							shootbutton = qtrue;
 						}
 					}
diff --git a/SP/code/game/g_cmds.c b/SP/code/game/g_cmds.c
index a289790..5048abc 100644
--- a/SP/code/game/g_cmds.c
+++ b/SP/code/game/g_cmds.c
@@ -1494,6 +1494,22 @@ void Cmd_Activate_f( gentity_t *ent ) {
 
 	traceEnt = &g_entities[ tr.entityNum ];
 
+	if ( traceEnt->classname && Q_stricmp( traceEnt->classname, "trigger_hurt" ) == 0 ) {
+		// ignore trigger_hurt so it's possible to pickup chalice (-1472 -3472 284) at the end of map crypt2
+		trap_Trace( &tr, tr.endpos, NULL, NULL, end, tr.entityNum, ( CONTENTS_SOLID | CONTENTS_BODY | CONTENTS_CORPSE | CONTENTS_TRIGGER ) );
+
+		// muzzle and trigger_hurt are in player bbox?
+		if ( tr.entityNum == ent->s.number ) {
+			return;
+		}
+	}
+
+	if ( tr.surfaceFlags & SURF_NOIMPACT ) {
+		return;
+	}
+
+	traceEnt = &g_entities[ tr.entityNum ];
+
 	// G_Printf( "%s activate %s\n", ent->classname, traceEnt->classname);
 
 	// Ridah, check for using a friendly AI
diff --git a/SP/code/game/g_main.c b/SP/code/game/g_main.c
index a785072..0bc3cd2 100644
--- a/SP/code/game/g_main.c
+++ b/SP/code/game/g_main.c
@@ -476,6 +476,19 @@ void G_CheckForCursorHints( gentity_t *ent ) {
 	trace_contents = ( CONTENTS_TRIGGER | CONTENTS_SOLID | CONTENTS_PLAYERCLIP | CONTENTS_BODY | CONTENTS_CORPSE );   // SP fine checking corpses
 	trap_Trace( tr, offset, NULL, NULL, end, ps->clientNum, trace_contents );
 
+	traceEnt = &g_entities[tr->entityNum];
+
+	if ( traceEnt->classname && Q_stricmp( traceEnt->classname, "trigger_hurt" ) == 0 ) {
+		// ignore trigger_hurt so it's possible to pickup chalice (-1472 -3472 284) at the end of map crypt2
+		trap_Trace( tr, tr->endpos, NULL, NULL, end, tr->entityNum, trace_contents );
+
+		// muzzle and trigger_hurt are in player bbox?
+		if ( tr->entityNum == ps->clientNum ) {
+			tr->entityNum = ENTITYNUM_NONE;
+			tr->fraction = 1;
+		}
+	}
+
 	// reset all
 	hintType    = ps->serverCursorHint      = HINT_NONE;
 	hintVal     = ps->serverCursorHintVal   = 0;
@@ -669,6 +682,7 @@ void G_CheckForCursorHints( gentity_t *ent ) {
 			} else if ( checkEnt->s.eType == ET_ALARMBOX )      {
 				if ( checkEnt->health > 0 ) {
 //					hintDist	= CH_BREAKABLE_DIST;
+					hintDist	= CH_ACTIVATE_DIST;
 					hintType    = HINT_ACTIVATE;
 				}
 			} else if ( checkEnt->s.eType == ET_ITEM )      {
diff --git a/SP/code/qcommon/common.c b/SP/code/qcommon/common.c
index 75a1dfe..a1e7dc0 100644
--- a/SP/code/qcommon/common.c
+++ b/SP/code/qcommon/common.c
@@ -2049,7 +2049,7 @@ void Com_ReadCDKey( const char *filename ) {
 
 	FS_SV_FOpenFileRead( fbuffer, &f );
 	if ( !f ) {
-		Q_strncpyz( cl_cdkey, "                ", 17 );
+		Com_Memset( cl_cdkey, '\0', 17 );
 		return;
 	}
 
@@ -2061,7 +2061,7 @@ void Com_ReadCDKey( const char *filename ) {
 	if ( CL_CDKeyValidate( buffer, NULL ) ) {
 		Q_strncpyz( cl_cdkey, buffer, 17 );
 	} else {
-		Q_strncpyz( cl_cdkey, "                ", 17 );
+		Com_Memset( cl_cdkey, '\0', 17 );
 	}
 }
 
@@ -2079,7 +2079,7 @@ void Com_AppendCDKey( const char *filename ) {
 
 	FS_SV_FOpenFileRead( fbuffer, &f );
 	if ( !f ) {
-		Q_strncpyz( &cl_cdkey[16], "                ", 17 );
+		Com_Memset( &cl_cdkey[16], '\0', 17 );
 		return;
 	}
 
@@ -2091,7 +2091,7 @@ void Com_AppendCDKey( const char *filename ) {
 	if ( CL_CDKeyValidate( buffer, NULL ) ) {
 		strcat( &cl_cdkey[16], buffer );
 	} else {
-		Q_strncpyz( &cl_cdkey[16], "                ", 17 );
+		Com_Memset( &cl_cdkey[16], '\0', 17 );
 	}
 }
 
diff --git a/SP/code/qcommon/files.c b/SP/code/qcommon/files.c
index caf9f41..bca9523 100644
--- a/SP/code/qcommon/files.c
+++ b/SP/code/qcommon/files.c
@@ -3199,11 +3199,12 @@ void FS_AddGameDirectory( const char *path, const char *dir ) {
 	int i;
 	searchpath_t    *search;
 	pack_t          *pak;
-	char			curpath[MAX_OSPATH + 1], *pakfile;
+	char		curpath[MAX_OSPATH + 1], *pakfile;
 	int numfiles;
 	char            **pakfiles;
 	char            *sorted[MAX_PAKFILES];
 
+	// find all pak files in this directory
 	Q_strncpyz(curpath, FS_BuildOSPath(path, dir, ""), sizeof(curpath));
 	curpath[strlen(curpath) - 1] = '\0';	// strip the trailing slash
 
@@ -3241,31 +3242,28 @@ void FS_AddGameDirectory( const char *path, const char *dir ) {
 		numfiles = MAX_PAKFILES;
 	}
 	for ( i = 0 ; i < numfiles ; i++ ) {
-		sorted[i] = pakfiles[i];
-
-// JPW NERVE sp_* to _p_* so "sp_pak*" gets alphabetically sorted before "pak*"
-//----(SA)	SP mod
-
-		// (SA) sort order to be further clarified later (10/8/01)
-		if ( !Q_strncmp( sorted[i],"sp_",3 ) ) { //	sort sp first
-			memcpy( sorted[i],"zz",2 );
+		if ( pakfiles ) {
+			sorted[i] = pakfiles[i];
+
+			// JPW NERVE sp_* to _p_* so "sp_pak*" gets alphabetically sorted before "pak*"
+			//----(SA)	SP mod
+			// (SA) sort order to be further clarified later (10/8/01)
+			if ( !Q_strncmp( sorted[i],"sp_",3 ) ) { //	sort sp first
+				memcpy( sorted[i],"zz",2 );
+			}
 		}
-
 	}
 
 	qsort( sorted, numfiles, sizeof(char *), paksort );
 
 	for ( i = 0 ; i < numfiles ; i++ ) {
-
 		if ( Q_strncmp( sorted[i],"mp_",3 ) ) { // (SA) SP mod -- exclude mp_*
-
-// JPW NERVE KLUDGE: fix filenames broken in mp/sp/pak sort above
-//----(SA)	mod for SP
+			// JPW NERVE KLUDGE: fix filenames broken in mp/sp/pak sort above
+			//----(SA)	mod for SP
 			if ( !Q_strncmp( sorted[i],"zz_",3 ) ) {
 				memcpy( sorted[i],"sp",2 );
 			}
-
-// jpw
+			// jpw
 			pakfile = FS_BuildOSPath( path, dir, sorted[i] );
 			if ( ( pak = FS_LoadZipFile( pakfile, sorted[i] ) ) == 0 ) {
 				continue;
diff --git a/SP/code/qcommon/q_platform.h b/SP/code/qcommon/q_platform.h
index f832c2b..ad197b0 100644
--- a/SP/code/qcommon/q_platform.h
+++ b/SP/code/qcommon/q_platform.h
@@ -156,6 +156,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #define idx64 1
 #define ARCH_STRING "x86_64"
 #define Q3_LITTLE_ENDIAN
+#elif defined __aarch64__
+#define ARCH_STRING "arm64"
+#define Q3_LITTLE_ENDIAN
 #endif
 
 #define DLL_EXT ".dylib"
@@ -229,6 +232,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #define ARCH_STRING "amd64"
 #elif defined __axp__
 #define ARCH_STRING "alpha"
+#elif defined __powerpc64__
+#define ARCH_STRING "powerpc64"
+#elif defined __powerpc__
+#define ARCH_STRING "powerpc"
+#elif defined __riscv
+#define ARCH_STRING "riscv64"
 #endif
 
 #if BYTE_ORDER == BIG_ENDIAN
diff --git a/SP/code/qcommon/q_shared.h b/SP/code/qcommon/q_shared.h
index 869a992..c2888d3 100644
--- a/SP/code/qcommon/q_shared.h
+++ b/SP/code/qcommon/q_shared.h
@@ -85,7 +85,7 @@ If you have questions concerning this license or the applicable additional terms
 #define LEGACY_HEARTBEAT_FOR_MASTER	"Wolfenstein-1"
 
 #ifndef PRODUCT_VERSION
-  #define PRODUCT_VERSION "1.51c-SP"
+  #define PRODUCT_VERSION "1.51d-SP"
 #endif
 
 #ifndef PRODUCT_DATE
@@ -419,6 +419,8 @@ typedef vec_t vec3_t[3];
 typedef vec_t vec4_t[4];
 typedef vec_t vec5_t[5];
 
+typedef vec_t quat_t[4];
+
 typedef int fixed4_t;
 typedef int fixed8_t;
 typedef int fixed16_t;
@@ -654,6 +656,8 @@ typedef struct {
 
 #define Byte4Copy(a,b)			((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2],(b)[3]=(a)[3])
 
+#define QuatCopy(a,b)			((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2],(b)[3]=(a)[3])
+
 #define Vector4MA( v, s, b, o )       ( ( o )[0] = ( v )[0] + ( b )[0] * ( s ),( o )[1] = ( v )[1] + ( b )[1] * ( s ),( o )[2] = ( v )[2] + ( b )[2] * ( s ),( o )[3] = ( v )[3] + ( b )[3] * ( s ) )
 #define Vector4Average( v, b, s, o )  ( ( o )[0] = ( ( v )[0] * ( 1 - ( s ) ) ) + ( ( b )[0] * ( s ) ),( o )[1] = ( ( v )[1] * ( 1 - ( s ) ) ) + ( ( b )[1] * ( s ) ),( o )[2] = ( ( v )[2] * ( 1 - ( s ) ) ) + ( ( b )[2] * ( s ) ),( o )[3] = ( ( v )[3] * ( 1 - ( s ) ) ) + ( ( b )[3] * ( s ) ) )
 
diff --git a/SP/code/qcommon/qcommon.h b/SP/code/qcommon/qcommon.h
index 013c646..451530d 100644
--- a/SP/code/qcommon/qcommon.h
+++ b/SP/code/qcommon/qcommon.h
@@ -383,6 +383,8 @@ typedef enum {
 	TRAP_TESTPRINTFLOAT
 } sharedTraps_t;
 
+typedef intptr_t (QDECL *vmMainProc)(intptr_t callNum, intptr_t arg0, intptr_t arg1, intptr_t arg2, intptr_t arg3, intptr_t arg4, intptr_t arg5, intptr_t arg6, intptr_t arg7, intptr_t arg8, intptr_t arg9, intptr_t arg10, intptr_t arg11);
+
 void    VM_Init( void );
 vm_t	*VM_Create( const char *module, intptr_t (*systemCalls)(intptr_t *),
 					vmInterpret_t interpret );
@@ -1121,7 +1123,7 @@ void Sys_LeaveCriticalSection( void *ptr );
 
 // general development dll loading for virtual machine testing
 char* Sys_GetDLLName( const char *name );
-void	* QDECL Sys_LoadGameDll( const char *name, intptr_t (QDECL **entryPoint)(intptr_t, ...),
+void	* QDECL Sys_LoadGameDll( const char *name, vmMainProc *entryPoint,
 				  intptr_t (QDECL *systemcalls)(intptr_t, ...) );
 void    Sys_UnloadDll( void *dllHandle );
 
diff --git a/SP/code/qcommon/vm_local.h b/SP/code/qcommon/vm_local.h
index 4e9dab9..8a8d91d 100644
--- a/SP/code/qcommon/vm_local.h
+++ b/SP/code/qcommon/vm_local.h
@@ -154,7 +154,7 @@ struct vm_s {
 
 	// for dynamic linked modules
 	void		*dllHandle;
-	intptr_t			(QDECL *entryPoint)( intptr_t callNum, ... );
+	vmMainProc	entryPoint;
 	void (*destroy)(vm_t* self);
 
 	// for interpreted modules
diff --git a/SP/code/rend2/glsl/lightall_fp.glsl b/SP/code/rend2/glsl/lightall_fp.glsl
index 443aff1..28b59eb 100644
--- a/SP/code/rend2/glsl/lightall_fp.glsl
+++ b/SP/code/rend2/glsl/lightall_fp.glsl
@@ -89,6 +89,9 @@ float RayIntersectDisplaceMap(vec2 dp, vec2 ds, sampler2D normalMap)
 	// current size of search window
 	float size = 1.0 / float(linearSearchSteps);
 
+	// adjust position if offset above surface
+	dp -= ds * r_parallaxMapOffset;
+
 	// current depth position
 	float depth = 0.0;
 
@@ -141,7 +144,7 @@ float RayIntersectDisplaceMap(vec2 dp, vec2 ds, sampler2D normalMap)
 	}
 #endif
 
-	return bestDepth;
+	return bestDepth - r_parallaxMapOffset;
 }
 
 float LightRay(vec2 dp, vec2 ds, sampler2D normalMap)
@@ -201,7 +204,7 @@ vec3 CalcSpecular(vec3 specular, float NH, float EH, float roughness)
 	float rr = roughness*roughness;
 	float rrrr = rr*rr;
 	float d = (NH * NH) * (rrrr - 1.0) + 1.0;
-	float v = (EH * EH) * (roughness + 0.5);
+	float v = (EH * EH) * (roughness + 0.5) + EPSILON;
 	return specular * (rrrr / (4.0 * d * d * v));
 }
 
@@ -222,7 +225,7 @@ float CalcLightAttenuation(float point, float normDist)
 	return attenuation;
 }
 
-#if defined(USE_BOX_CUBEMAP_PARALLAX) && __VERSION__ >= 130
+#if defined(USE_BOX_CUBEMAP_PARALLAX)
 vec4 hitCube(vec3 ray, vec3 pos, vec3 invSize, float lod, samplerCube tex)
 {
 	// find any hits on cubemap faces facing the camera
@@ -261,7 +264,8 @@ void main()
 	float NL, NH, NE, EH, attenuation;
 
 #if defined(USE_LIGHT) && !defined(USE_FAST_LIGHT)
-	mat3 tangentToWorld = mat3(var_Tangent.xyz, var_Bitangent.xyz, var_Normal.xyz);
+	vec3 surfNormal = (!gl_FrontFacing ? var_Normal : -var_Normal).xyz;
+	mat3 tangentToWorld = mat3(var_Tangent.xyz, var_Bitangent.xyz, surfNormal);
 	viewDir = vec3(var_Normal.w, var_Tangent.w, var_Bitangent.w);
 	E = normalize(viewDir);
 #endif
@@ -332,7 +336,7 @@ void main()
 	N.z = sqrt(clamp((0.25 - N.x * N.x) - N.y * N.y, 0.0, 1.0));
 	N = tangentToWorld * N;
   #else
-	N = var_Normal.xyz;
+	N = surfNormal;
   #endif
 
 	N = normalize(N);
@@ -358,7 +362,7 @@ void main()
 
   #if !defined(USE_LIGHT_VECTOR)
 	ambientColor = lightColor;
-	float surfNL = clamp(dot(var_Normal.xyz, L), 0.0, 1.0);
+	float surfNL = clamp(dot(surfNormal, L), 0.0, 1.0);
 
 	// reserve 25% ambient to avoid black areas on normalmaps
 	lightColor *= 0.75;
diff --git a/SP/code/rend2/tr_glsl.c b/SP/code/rend2/tr_glsl.c
index c65cc9f..6e05934 100644
--- a/SP/code/rend2/tr_glsl.c
+++ b/SP/code/rend2/tr_glsl.c
@@ -1143,6 +1143,8 @@ void GLSL_InitGPUShaders(void)
 
 					if (r_parallaxMapShadows->integer)
 						Q_strcat(extradefines, 1024, "#define USE_PARALLAXMAP_SHADOWS\n");
+
+					Q_strcat(extradefines, 1024, va("#define r_parallaxMapOffset %f\n", r_parallaxMapOffset->value));
 				}
 			}
 
diff --git a/SP/code/rend2/tr_image.c b/SP/code/rend2/tr_image.c
index db11dc5..3f6319f 100644
--- a/SP/code/rend2/tr_image.c
+++ b/SP/code/rend2/tr_image.c
@@ -1776,7 +1776,9 @@ static GLenum RawImage_GetFormat(const byte *data, int numPixels, GLenum picForm
 	}
 	else if(lightMap)
 	{
-		if(r_greyscale->integer)
+		// GL_LUMINANCE is not valid for OpenGL 3.2 Core context and
+		// everything becomes solid black
+		if(0 && r_greyscale->integer)
 			internalFormat = GL_LUMINANCE;
 		else
 			internalFormat = GL_RGBA;
@@ -1791,7 +1793,7 @@ static GLenum RawImage_GetFormat(const byte *data, int numPixels, GLenum picForm
 		// select proper internal format
 		if ( samples == 3 )
 		{
-			if(r_greyscale->integer)
+			if(0 && r_greyscale->integer)
 			{
 				if(r_texturebits->integer == 16 || r_texturebits->integer == 32)
 					internalFormat = GL_LUMINANCE8;
@@ -1828,7 +1830,7 @@ static GLenum RawImage_GetFormat(const byte *data, int numPixels, GLenum picForm
 		}
 		else if ( samples == 4 )
 		{
-			if(r_greyscale->integer)
+			if(0 && r_greyscale->integer)
 			{
 				if(r_texturebits->integer == 16 || r_texturebits->integer == 32)
 					internalFormat = GL_LUMINANCE8_ALPHA8;
@@ -2285,7 +2287,9 @@ image_t *R_CreateImageExt2( const char *name, byte *pic, int width, int height,
 		case GL_DEPTH_COMPONENT32_ARB:
 			// Fix for sampling depth buffer on old nVidia cards.
 			// from http://www.idevgames.com/forums/thread-4141-post-34844.html#pid34844
-			qglTextureParameterfEXT(image->texnum, textureTarget, GL_DEPTH_TEXTURE_MODE, GL_LUMINANCE);
+			if ( !QGL_VERSION_ATLEAST( 3, 0 ) ) {
+				qglTextureParameterfEXT(image->texnum, textureTarget, GL_DEPTH_TEXTURE_MODE, GL_LUMINANCE);
+			}
 			qglTextureParameterfEXT(image->texnum, textureTarget, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
 			qglTextureParameterfEXT(image->texnum, textureTarget, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
 			break;
diff --git a/SP/code/rend2/tr_init.c b/SP/code/rend2/tr_init.c
index 5aa5f82..23332c3 100644
--- a/SP/code/rend2/tr_init.c
+++ b/SP/code/rend2/tr_init.c
@@ -37,6 +37,7 @@ glRefConfig_t glRefConfig;
 qboolean    textureFilterAnisotropic = qfalse;
 int         maxAnisotropy = 0;
 float       displayAspect = 0.0f;
+qboolean    haveClampToEdge = qfalse;
 
 glstate_t glState;
 
@@ -155,6 +156,7 @@ cvar_t  *r_normalMapping;
 cvar_t  *r_specularMapping;
 cvar_t  *r_deluxeMapping;
 cvar_t  *r_parallaxMapping;
+cvar_t  *r_parallaxMapOffset;
 cvar_t  *r_parallaxMapShadows;
 cvar_t  *r_cubeMapping;
 cvar_t  *r_cubemapSize;
@@ -366,6 +368,12 @@ static void InitOpenGL( void ) {
 		}
 	}
 
+	// check for GLSL function textureCubeLod()
+	if ( r_cubeMapping->integer && !QGL_VERSION_ATLEAST( 3, 0 ) ) {
+		ri.Printf( PRINT_WARNING, "WARNING: Disabled r_cubeMapping because it requires OpenGL 3.0\n" );
+		ri.Cvar_Set( "r_cubeMapping", "0" );
+	}
+
 	// set default state
 	GL_SetDefaultState();
 }
@@ -1129,31 +1137,16 @@ Workaround for ri.Printf's 1024 characters buffer limit.
 */
 void R_PrintLongString(const char *string) {
 	char buffer[1024];
-	const char *p = string;
-	int remainingLength = strlen(string);
+	const char *p;
+	int size = strlen(string);
 
-	while (remainingLength > 0)
+	p = string;
+	while(size > 0)
 	{
-		// Take as much characters as possible from the string without splitting words between buffers
-		// This avoids the client console splitting a word up when one half fits on the current line,
-		// but the second half would have to be written on a new line
-		int charsToTake = sizeof(buffer) - 1;
-		if (remainingLength > charsToTake) {
-			while (p[charsToTake - 1] > ' ' && p[charsToTake] > ' ') {
-				charsToTake--;
-				if (charsToTake == 0) {
-					charsToTake = sizeof(buffer) - 1;
-					break;
-				}
-			}
-		} else if (remainingLength < charsToTake) {
-			charsToTake = remainingLength;
-		}
-
-		Q_strncpyz( buffer, p, charsToTake + 1 );
+		Q_strncpyz(buffer, p, sizeof (buffer) );
 		ri.Printf( PRINT_ALL, "%s", buffer );
-		remainingLength -= charsToTake;
-		p += charsToTake;
+		p += 1023;
+		size -= 1023;
 	}
 }
 
@@ -1178,6 +1171,7 @@ void GfxInfo_f( void ) {
 	ri.Printf( PRINT_ALL, "GL_RENDERER: %s\n", glConfig.renderer_string );
 	ri.Printf( PRINT_ALL, "GL_VERSION: %s\n", glConfig.version_string );
 	ri.Printf( PRINT_ALL, "GL_EXTENSIONS: " );
+	// glConfig.extensions_string is a limited length so get the full list directly
 	if ( qglGetStringi )
 	{
 		GLint numExtensions;
@@ -1191,7 +1185,7 @@ void GfxInfo_f( void ) {
 	}
 	else
 	{
-		R_PrintLongString( glConfig.extensions_string );
+		R_PrintLongString( (char *) qglGetString( GL_EXTENSIONS ) );
 	}
 	ri.Printf( PRINT_ALL, "\n" );
 	ri.Printf( PRINT_ALL, "GL_MAX_TEXTURE_SIZE: %d\n", glConfig.maxTextureSize );
@@ -1406,6 +1400,7 @@ void R_Register( void ) {
 	r_specularMapping = ri.Cvar_Get( "r_specularMapping", "1", CVAR_ARCHIVE | CVAR_LATCH );
 	r_deluxeMapping = ri.Cvar_Get( "r_deluxeMapping", "1", CVAR_ARCHIVE | CVAR_LATCH );
 	r_parallaxMapping = ri.Cvar_Get( "r_parallaxMapping", "0", CVAR_ARCHIVE | CVAR_LATCH );
+	r_parallaxMapOffset = ri.Cvar_Get( "r_parallaxMapOffset", "0", CVAR_ARCHIVE | CVAR_LATCH );
 	r_parallaxMapShadows = ri.Cvar_Get( "r_parallaxMapShadows", "0", CVAR_ARCHIVE | CVAR_LATCH );
 	r_cubeMapping = ri.Cvar_Get( "r_cubeMapping", "0", CVAR_ARCHIVE | CVAR_LATCH );
 	r_cubemapSize = ri.Cvar_Get( "r_cubemapSize", "128", CVAR_ARCHIVE | CVAR_LATCH );
@@ -1471,7 +1466,7 @@ void R_Register( void ) {
 	r_dlightScale = ri.Cvar_Get( "r_dlightScale", "1.0", CVAR_ARCHIVE );   //----(SA)	added
 	r_dlightBacks = ri.Cvar_Get( "r_dlightBacks", "1", CVAR_ARCHIVE );
 	r_finish = ri.Cvar_Get( "r_finish", "0", CVAR_ARCHIVE );
-	r_textureMode = ri.Cvar_Get( "r_textureMode", "GL_LINEAR_MIPMAP_NEAREST", CVAR_ARCHIVE );
+	r_textureMode = ri.Cvar_Get( "r_textureMode", "GL_LINEAR_MIPMAP_LINEAR", CVAR_ARCHIVE );
 
 	r_swapInterval = ri.Cvar_Get( "r_swapInterval", "0",
 					CVAR_ARCHIVE | CVAR_LATCH );
@@ -1698,6 +1693,8 @@ void R_Init( void ) {
 		ri.Printf( PRINT_ALL, "glGetError() = 0x%x\n", err );
 	}
 
+	// print info
+	GfxInfo_f();
 	ri.Printf( PRINT_ALL, "----- finished R_Init -----\n" );
 }
 
@@ -1748,6 +1745,7 @@ void RE_Shutdown( qboolean destroyWindow ) {
 		textureFilterAnisotropic = qfalse;
 		maxAnisotropy = 0;
 		displayAspect = 0.0f;
+		haveClampToEdge = qfalse;
 
 		Com_Memset( &glState, 0, sizeof( glState ) );
 	}
diff --git a/SP/code/rend2/tr_local.h b/SP/code/rend2/tr_local.h
index 5d03137..50b5046 100644
--- a/SP/code/rend2/tr_local.h
+++ b/SP/code/rend2/tr_local.h
@@ -1071,6 +1071,12 @@ typedef struct srfBspSurface_s
 	float			*heightLodError;
 } srfBspSurface_t;
 
+typedef struct {
+	vec3_t translate;
+	quat_t rotate;
+	vec3_t scale;
+} iqmTransform_t;
+
 // inter-quake-model
 typedef struct {
 	int		num_vertexes;
@@ -1104,8 +1110,9 @@ typedef struct {
 
 	char		*jointNames;
 	int		*jointParents;
-	float		*jointMats;
-	float		*poseMats;
+	float		*bindJoints; // [num_joints * 12]
+	float		*invBindJoints; // [num_joints * 12]
+	iqmTransform_t	*poses; // [num_frames * num_poses]
 	float		*bounds;
 
 	int		numVaoSurfaces;
@@ -1818,6 +1825,7 @@ extern qboolean  textureFilterAnisotropic;
 extern int       maxAnisotropy;
 extern glRefConfig_t glRefConfig;
 extern float     displayAspect;
+extern qboolean  haveClampToEdge;
 
 //
 // cvars
@@ -1983,6 +1991,7 @@ extern  cvar_t  *r_normalMapping;
 extern  cvar_t  *r_specularMapping;
 extern  cvar_t  *r_deluxeMapping;
 extern  cvar_t  *r_parallaxMapping;
+extern  cvar_t  *r_parallaxMapOffset;
 extern  cvar_t  *r_parallaxMapShadows;
 extern  cvar_t  *r_cubeMapping;
 extern  cvar_t  *r_cubemapSize;
diff --git a/SP/code/rend2/tr_model_iqm.c b/SP/code/rend2/tr_model_iqm.c
index 288e040..79865d2 100644
--- a/SP/code/rend2/tr_model_iqm.c
+++ b/SP/code/rend2/tr_model_iqm.c
@@ -2,6 +2,7 @@
 ===========================================================================
 Copyright (C) 2011 Thilo Schulz <thilo@tjps.eu>
 Copyright (C) 2011 Matthias Bentrup <matthias.bentrup@googlemail.com>
+Copyright (C) 2011-2019 Zack Middleton <zturtleman@gmail.com>
 
 This file is part of Quake III Arena source code.
 
@@ -44,7 +45,7 @@ static qboolean IQM_CheckRange( iqmHeader_t *header, int offset,
 }
 // "multiply" 3x4 matrices, these are assumed to be the top 3 rows
 // of a 4x4 matrix with the last row = (0 0 0 1)
-static void Matrix34Multiply( float *a, float *b, float *out ) {
+static void Matrix34Multiply( const float *a, const float *b, float *out ) {
 	out[ 0] = a[0] * b[0] + a[1] * b[4] + a[ 2] * b[ 8];
 	out[ 1] = a[0] * b[1] + a[1] * b[5] + a[ 2] * b[ 9];
 	out[ 2] = a[0] * b[2] + a[1] * b[6] + a[ 2] * b[10];
@@ -58,23 +59,7 @@ static void Matrix34Multiply( float *a, float *b, float *out ) {
 	out[10] = a[8] * b[2] + a[9] * b[6] + a[10] * b[10];
 	out[11] = a[8] * b[3] + a[9] * b[7] + a[10] * b[11] + a[11];
 }
-static void InterpolateMatrix( float *a, float *b, float lerp, float *mat ) {
-	float unLerp = 1.0f - lerp;
-
-	mat[ 0] = a[ 0] * unLerp + b[ 0] * lerp;
-	mat[ 1] = a[ 1] * unLerp + b[ 1] * lerp;
-	mat[ 2] = a[ 2] * unLerp + b[ 2] * lerp;
-	mat[ 3] = a[ 3] * unLerp + b[ 3] * lerp;
-	mat[ 4] = a[ 4] * unLerp + b[ 4] * lerp;
-	mat[ 5] = a[ 5] * unLerp + b[ 5] * lerp;
-	mat[ 6] = a[ 6] * unLerp + b[ 6] * lerp;
-	mat[ 7] = a[ 7] * unLerp + b[ 7] * lerp;
-	mat[ 8] = a[ 8] * unLerp + b[ 8] * lerp;
-	mat[ 9] = a[ 9] * unLerp + b[ 9] * lerp;
-	mat[10] = a[10] * unLerp + b[10] * lerp;
-	mat[11] = a[11] * unLerp + b[11] * lerp;
-}
-static void JointToMatrix( vec4_t rot, vec3_t scale, vec3_t trans,
+static void JointToMatrix( const quat_t rot, const vec3_t scale, const vec3_t trans,
 			   float *mat ) {
 	float xx = 2.0f * rot[0] * rot[0];
 	float yy = 2.0f * rot[1] * rot[1];
@@ -99,8 +84,7 @@ static void JointToMatrix( vec4_t rot, vec3_t scale, vec3_t trans,
 	mat[10] = scale[2] * (1.0f - (xx + yy));
 	mat[11] = trans[2];
 }
-static void Matrix34Invert( float *inMat, float *outMat )
-{
+static void Matrix34Invert( const float *inMat, float *outMat ) {
 	vec3_t trans;
 	float invSqrLen, *v;
 
@@ -120,6 +104,62 @@ static void Matrix34Invert( float *inMat, float *outMat )
 	outMat[ 7] = -DotProduct(outMat + 4, trans);
 	outMat[11] = -DotProduct(outMat + 8, trans);
 }
+static void QuatSlerp(const quat_t from, const quat_t _to, float fraction, quat_t out) {
+	float angle, cosAngle, sinAngle, backlerp, lerp;
+	quat_t to;
+
+	// cos() of angle
+	cosAngle = from[0] * _to[0] + from[1] * _to[1] + from[2] * _to[2] + from[3] * _to[3];
+
+	// negative handling is needed for taking shortest path (required for model joints)
+	if ( cosAngle < 0.0f ) {
+		cosAngle = -cosAngle;
+		to[0] = - _to[0];
+		to[1] = - _to[1];
+		to[2] = - _to[2];
+		to[3] = - _to[3];
+	} else {
+		QuatCopy( _to, to );
+	}
+
+	if ( cosAngle < 0.999999f ) {
+		// spherical lerp (slerp)
+		angle = acosf( cosAngle );
+		sinAngle = sinf( angle );
+		backlerp = sinf( ( 1.0f - fraction ) * angle ) / sinAngle;
+		lerp = sinf( fraction * angle ) / sinAngle;
+	} else {
+		// linear lerp
+		backlerp = 1.0f - fraction;
+		lerp = fraction;
+	}
+
+	out[0] = from[0] * backlerp + to[0] * lerp;
+	out[1] = from[1] * backlerp + to[1] * lerp;
+	out[2] = from[2] * backlerp + to[2] * lerp;
+	out[3] = from[3] * backlerp + to[3] * lerp;
+}
+static vec_t QuatNormalize2( const quat_t v, quat_t out) {
+	float	length, ilength;
+
+	length = v[0]*v[0] + v[1]*v[1] + v[2]*v[2] + v[3]*v[3];
+
+	if (length) {
+		/* writing it this way allows gcc to recognize that rsqrt can be used */
+		ilength = 1/(float)sqrt (length);
+		/* sqrt(length) = length * (1 / sqrt(length)) */
+		length *= ilength;
+		out[0] = v[0]*ilength;
+		out[1] = v[1]*ilength;
+		out[2] = v[2]*ilength;
+		out[3] = v[3]*ilength;
+	} else {
+		out[0] = out[1] = out[2] = 0;
+		out[3] = -1;
+	}
+
+	return length;
+}
 
 /*
 =================
@@ -139,7 +179,7 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
 	unsigned short		*framedata;
 	char			*str;
 	int			i, j, k;
-	float			jointInvMats[IQM_MAX_JOINTS * 12] = {0.0f};
+	iqmTransform_t		*transform;
 	float			*mat, *matInv;
 	size_t			size, joint_names;
 	byte			*dataPtr;
@@ -562,10 +602,11 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
 	if( header->num_joints ) {
 		size += joint_names;								// joint names
 		size += header->num_joints * sizeof(int);			// joint parents
-		size += header->num_joints * 12 * sizeof( float );	// joint mats
+		size += header->num_joints * 12 * sizeof(float);	// bind joint matricies
+		size += header->num_joints * 12 * sizeof(float);	// inverse bind joint matricies
 	}
 	if( header->num_poses ) {
-		size += header->num_poses * header->num_frames * 12 * sizeof( float ); // pose mats
+		size += header->num_poses * header->num_frames * sizeof(iqmTransform_t); // pose transforms
 	}
 	if( header->ofs_bounds ) {
 		size += header->num_frames * 6 * sizeof(float);		// model bounds
@@ -636,12 +677,15 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
 		iqmData->jointParents = (int*)dataPtr;
 		dataPtr += header->num_joints * sizeof(int);		// joint parents
 
-		iqmData->jointMats = (float*)dataPtr;
-		dataPtr += header->num_joints * 12 * sizeof( float ); // joint mats
+		iqmData->bindJoints = (float*)dataPtr;
+		dataPtr += header->num_joints * 12 * sizeof(float);		// bind joint matricies
+
+		iqmData->invBindJoints = (float*)dataPtr;
+		dataPtr += header->num_joints * 12 * sizeof(float);		// inverse bind joint matricies
 	}
 	if( header->num_poses ) {
-		iqmData->poseMats = (float*)dataPtr;
-		dataPtr += header->num_poses * header->num_frames * 12 * sizeof( float ); // pose mats
+		iqmData->poses = (iqmTransform_t*)dataPtr;
+		dataPtr += header->num_poses * header->num_frames * sizeof(iqmTransform_t); // pose transforms
 	}
 	if( header->ofs_bounds ) {
 		iqmData->bounds = (float*)dataPtr;
@@ -807,22 +851,23 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
 			iqmData->jointParents[i] = joint->parent;
 		}
 
-		// calculate joint matrices and their inverses
-		// joint inverses are needed only until the pose matrices are calculated
-		mat = iqmData->jointMats;
-		matInv = jointInvMats;
+		// calculate bind joint matrices and their inverses
+		mat = iqmData->bindJoints;
+		matInv = iqmData->invBindJoints;
 		joint = (iqmJoint_t *)((byte *)header + header->ofs_joints);
 		for( i = 0; i < header->num_joints; i++, joint++ ) {
 			float baseFrame[12], invBaseFrame[12];
 
+			QuatNormalize2( joint->rotate, joint->rotate );
+
 			JointToMatrix( joint->rotate, joint->scale, joint->translate, baseFrame );
 			Matrix34Invert( baseFrame, invBaseFrame );
 
 			if ( joint->parent >= 0 )
 			{
-				Matrix34Multiply( iqmData->jointMats + 12 * joint->parent, baseFrame, mat );
+				Matrix34Multiply( iqmData->bindJoints + 12 * joint->parent, baseFrame, mat );
 				mat += 12;
-				Matrix34Multiply( invBaseFrame, jointInvMats + 12 * joint->parent, matInv );
+				Matrix34Multiply( invBaseFrame, iqmData->invBindJoints + 12 * joint->parent, matInv );
 				matInv += 12;
 			}
 			else
@@ -837,16 +882,15 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
 
 	if( header->num_poses )
 	{
-		// calculate pose matrices
+		// calculate pose transforms
+		transform = iqmData->poses;
 		framedata = (unsigned short *)((byte *)header + header->ofs_frames);
-		mat = iqmData->poseMats;
 		for( i = 0; i < header->num_frames; i++ ) {
 			pose = (iqmPose_t *)((byte *)header + header->ofs_poses);
-			for( j = 0; j < header->num_poses; j++, pose++ ) {
+			for( j = 0; j < header->num_poses; j++, pose++, transform++ ) {
 				vec3_t	translate;
-				vec4_t	rotate;
+				quat_t	rotate;
 				vec3_t	scale;
-				float	mat1[12], mat2[12];
 
 				translate[0] = pose->channeloffset[0];
 				if( pose->mask & 0x001)
@@ -881,18 +925,9 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
 				if( pose->mask & 0x200)
 					scale[2] += *framedata++ * pose->channelscale[9];
 
-				// construct transformation matrix
-				JointToMatrix( rotate, scale, translate, mat1 );
-
-				if( pose->parent >= 0 ) {
-					Matrix34Multiply( iqmData->jointMats + 12 * pose->parent,
-							  mat1, mat2 );
-				} else {
-					Com_Memcpy( mat2, mat1, sizeof(mat1) );
-				}
-
-				Matrix34Multiply( mat2, jointInvMats + 12 * j, mat );
-				mat += 12;
+				VectorCopy( translate, transform->translate );
+				QuatNormalize2( rotate, transform->rotate );
+				VectorCopy( scale, transform->scale );
 			}
 		}
 	}
@@ -1306,37 +1341,59 @@ void R_AddIQMSurfaces( trRefEntity_t *ent ) {
 
 
 static void ComputePoseMats( iqmData_t *data, int frame, int oldframe,
-			      float backlerp, float *mat ) {
-	float	*mat1, *mat2;
-	int	*joint = data->jointParents;
-	int	i;
-
+			      float backlerp, float *poseMats ) {
+	iqmTransform_t relativeJoints[IQM_MAX_JOINTS];
+	iqmTransform_t *relativeJoint;
+	const iqmTransform_t *pose;
+	const iqmTransform_t *oldpose;
+	const int *jointParent;
+	const float *invBindMat;
+	float *poseMat, lerp;
+	int i;
+
+	relativeJoint = relativeJoints;
+
+	// copy or lerp animation frame pose
 	if ( oldframe == frame ) {
-		mat1 = data->poseMats + 12 * data->num_poses * frame;
-		for( i = 0; i < data->num_poses; i++, joint++ ) {
-			if( *joint >= 0 ) {
-				Matrix34Multiply( mat + 12 * *joint,
-						  mat1 + 12*i, mat + 12*i );
-			} else {
-				Com_Memcpy( mat + 12*i, mat1 + 12*i, 12 * sizeof(float) );
-			}
+		pose = &data->poses[frame * data->num_poses];
+		for ( i = 0; i < data->num_poses; i++, pose++, relativeJoint++ ) {
+			VectorCopy( pose->translate, relativeJoint->translate );
+			QuatCopy( pose->rotate, relativeJoint->rotate );
+			VectorCopy( pose->scale, relativeJoint->scale );
 		}
-	} else  {
-		mat1 = data->poseMats + 12 * data->num_poses * frame;
-		mat2 = data->poseMats + 12 * data->num_poses * oldframe;
-		
-		for( i = 0; i < data->num_poses; i++, joint++ ) {
-			if( *joint >= 0 ) {
-				float tmpMat[12];
-				InterpolateMatrix( mat1 + 12*i, mat2 + 12*i,
-						   backlerp, tmpMat );
-				Matrix34Multiply( mat + 12 * *joint,
-						  tmpMat, mat + 12*i );
-				
-			} else {
-				InterpolateMatrix( mat1 + 12*i, mat2 + 12*i,
-						   backlerp, mat + 12*i );
-			}
+	} else {
+		lerp = 1.0f - backlerp;
+		pose = &data->poses[frame * data->num_poses];
+		oldpose = &data->poses[oldframe * data->num_poses];
+		for ( i = 0; i < data->num_poses; i++, oldpose++, pose++, relativeJoint++ ) {
+			relativeJoint->translate[0] = oldpose->translate[0] * backlerp + pose->translate[0] * lerp;
+			relativeJoint->translate[1] = oldpose->translate[1] * backlerp + pose->translate[1] * lerp;
+			relativeJoint->translate[2] = oldpose->translate[2] * backlerp + pose->translate[2] * lerp;
+
+			relativeJoint->scale[0] = oldpose->scale[0] * backlerp + pose->scale[0] * lerp;
+			relativeJoint->scale[1] = oldpose->scale[1] * backlerp + pose->scale[1] * lerp;
+			relativeJoint->scale[2] = oldpose->scale[2] * backlerp + pose->scale[2] * lerp;
+
+			QuatSlerp( oldpose->rotate, pose->rotate, lerp, relativeJoint->rotate );
+		}
+	}
+
+	// multiply by inverse of bind pose and parent 'pose mat' (bind pose transform matrix)
+	relativeJoint = relativeJoints;
+	jointParent = data->jointParents;
+	invBindMat = data->invBindJoints;
+	poseMat = poseMats;
+	for ( i = 0; i < data->num_poses; i++, relativeJoint++, jointParent++, invBindMat += 12, poseMat += 12 ) {
+		float mat1[12], mat2[12];
+
+		JointToMatrix( relativeJoint->rotate, relativeJoint->scale, relativeJoint->translate, mat1 );
+
+		if ( *jointParent >= 0 ) {
+			Matrix34Multiply( &data->bindJoints[(*jointParent)*12], mat1, mat2 );
+			Matrix34Multiply( mat2, invBindMat, mat1 );
+			Matrix34Multiply( &poseMats[(*jointParent)*12], mat1, poseMat );
+		} else {
+			Matrix34Multiply( mat1, invBindMat, poseMat );
 		}
 	}
 }
@@ -1347,7 +1404,7 @@ static void ComputeJointMats( iqmData_t *data, int frame, int oldframe,
 	int	i;
 
 	if ( data->num_poses == 0 ) {
-		Com_Memcpy( mat, data->jointMats, data->num_joints * 12 * sizeof(float) );
+		Com_Memcpy( mat, data->bindJoints, data->num_joints * 12 * sizeof(float) );
 		return;
 	}
 
@@ -1359,7 +1416,7 @@ static void ComputeJointMats( iqmData_t *data, int frame, int oldframe,
 
 		Com_Memcpy(outmat, mat1, sizeof(outmat));
 
-		Matrix34Multiply( outmat, data->jointMats + 12*i, mat1 );
+		Matrix34Multiply( outmat, data->bindJoints + 12*i, mat1 );
 	}
 }
 
@@ -1427,20 +1484,21 @@ void RB_IQMSurfaceAnim( surfaceType_t *surface ) {
 			float *vtxMat = &influenceVtxMat[12*i];
 			float *nrmMat = &influenceNrmMat[9*i];
 			int	j;
-			float	blendWeights[4] = {0};
-			int		numWeights;
-
-			for ( numWeights = 0; numWeights < 4; numWeights++ ) {
-				if ( data->blendWeightsType == IQM_FLOAT )
-					blendWeights[numWeights] = data->influenceBlendWeights.f[4*influence + numWeights];
-				else
-					blendWeights[numWeights] = (float)data->influenceBlendWeights.b[4*influence + numWeights] / 255.0f;
+			float	blendWeights[4];
 
-				if ( blendWeights[numWeights] <= 0.0f )
-					break;
+			if ( data->blendWeightsType == IQM_FLOAT ) {
+				blendWeights[0] = data->influenceBlendWeights.f[4*influence + 0];
+				blendWeights[1] = data->influenceBlendWeights.f[4*influence + 1];
+				blendWeights[2] = data->influenceBlendWeights.f[4*influence + 2];
+				blendWeights[3] = data->influenceBlendWeights.f[4*influence + 3];
+			} else {
+				blendWeights[0] = (float)data->influenceBlendWeights.b[4*influence + 0] / 255.0f;
+				blendWeights[1] = (float)data->influenceBlendWeights.b[4*influence + 1] / 255.0f;
+				blendWeights[2] = (float)data->influenceBlendWeights.b[4*influence + 2] / 255.0f;
+				blendWeights[3] = (float)data->influenceBlendWeights.b[4*influence + 3] / 255.0f;
 			}
 
-			if ( numWeights == 0 ) {
+			if ( blendWeights[0] <= 0.0f ) {
 				// no blend joint, use identity matrix.
 				vtxMat[0] = identityMatrix[0];
 				vtxMat[1] = identityMatrix[1];
@@ -1470,7 +1528,11 @@ void RB_IQMSurfaceAnim( surfaceType_t *surface ) {
 				vtxMat[10] = blendWeights[0] * poseMats[12 * data->influenceBlendIndexes[4*influence + 0] + 10];
 				vtxMat[11] = blendWeights[0] * poseMats[12 * data->influenceBlendIndexes[4*influence + 0] + 11];
 
-				for( j = 1; j < numWeights; j++ ) {
+				for( j = 1; j < 4; j++ ) {
+					if ( blendWeights[j] <= 0.0f ) {
+						break;
+					}
+
 					vtxMat[0] += blendWeights[j] * poseMats[12 * data->influenceBlendIndexes[4*influence + j] + 0];
 					vtxMat[1] += blendWeights[j] * poseMats[12 * data->influenceBlendIndexes[4*influence + j] + 1];
 					vtxMat[2] += blendWeights[j] * poseMats[12 * data->influenceBlendIndexes[4*influence + j] + 2];
diff --git a/SP/code/renderer/tr_backend.c b/SP/code/renderer/tr_backend.c
index aaec984..8cabb8d 100644
--- a/SP/code/renderer/tr_backend.c
+++ b/SP/code/renderer/tr_backend.c
@@ -1232,8 +1232,8 @@ void RE_UploadCinematic( int w, int h, int cols, int rows, const byte *data, int
 #endif
 		qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
 		qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
-		qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
-		qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
+		qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, haveClampToEdge ? GL_CLAMP_TO_EDGE : GL_CLAMP );
+		qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, haveClampToEdge ? GL_CLAMP_TO_EDGE : GL_CLAMP );
 	} else {
 		if ( dirty ) {
 			// otherwise, just subimage upload it so that drivers can tell we are going to be changing
diff --git a/SP/code/renderer/tr_image.c b/SP/code/renderer/tr_image.c
index b89112f..a651a5d 100644
--- a/SP/code/renderer/tr_image.c
+++ b/SP/code/renderer/tr_image.c
@@ -1201,7 +1201,7 @@ image_t *R_CreateImageExt( const char *name, byte *pic, int width, int height, i
 	image->width = width;
 	image->height = height;
 	if (flags & IMGFLAG_CLAMPTOEDGE)
-		glWrapClampMode = GL_CLAMP_TO_EDGE;
+		glWrapClampMode = haveClampToEdge ? GL_CLAMP_TO_EDGE : GL_CLAMP;
 	else
 		glWrapClampMode = GL_REPEAT;
 
diff --git a/SP/code/renderer/tr_init.c b/SP/code/renderer/tr_init.c
index 026aa71..9a6db68 100644
--- a/SP/code/renderer/tr_init.c
+++ b/SP/code/renderer/tr_init.c
@@ -34,6 +34,7 @@ glconfig_t  glConfig;
 qboolean    textureFilterAnisotropic = qfalse;
 int         maxAnisotropy = 0;
 float       displayAspect = 0.0f;
+qboolean    haveClampToEdge = qfalse;
 
 glstate_t glState;
 
@@ -1033,31 +1034,16 @@ Workaround for ri.Printf's 1024 characters buffer limit.
 */
 void R_PrintLongString(const char *string) {
 	char buffer[1024];
-	const char *p = string;
-	int remainingLength = strlen(string);
+	const char *p;
+	int size = strlen(string);
 
-	while (remainingLength > 0)
+	p = string;
+	while(size > 0)
 	{
-		// Take as much characters as possible from the string without splitting words between buffers
-		// This avoids the client console splitting a word up when one half fits on the current line,
-		// but the second half would have to be written on a new line
-		int charsToTake = sizeof(buffer) - 1;
-		if (remainingLength > charsToTake) {
-			while (p[charsToTake - 1] > ' ' && p[charsToTake] > ' ') {
-				charsToTake--;
-				if (charsToTake == 0) {
-					charsToTake = sizeof(buffer) - 1;
-					break;
-				}
-			}
-		} else if (remainingLength < charsToTake) {
-			charsToTake = remainingLength;
-		}
-
-		Q_strncpyz( buffer, p, charsToTake + 1 );
+		Q_strncpyz(buffer, p, sizeof (buffer) );
 		ri.Printf( PRINT_ALL, "%s", buffer );
-		remainingLength -= charsToTake;
-		p += charsToTake;
+		p += 1023;
+		size -= 1023;
 	}
 }
 
@@ -1082,6 +1068,7 @@ void GfxInfo_f( void ) {
 	ri.Printf( PRINT_ALL, "GL_RENDERER: %s\n", glConfig.renderer_string );
 	ri.Printf( PRINT_ALL, "GL_VERSION: %s\n", glConfig.version_string );
 	ri.Printf( PRINT_ALL, "GL_EXTENSIONS: " );
+	// glConfig.extensions_string is a limited length so get the full list directly
 #ifndef USE_OPENGLES
 	if ( qglGetStringi )
 	{
@@ -1097,7 +1084,7 @@ void GfxInfo_f( void ) {
 	else
 #endif
 	{
-		R_PrintLongString( glConfig.extensions_string );
+		R_PrintLongString( (char *) qglGetString( GL_EXTENSIONS ) );
 	}
 	ri.Printf( PRINT_ALL, "\n" );
 	ri.Printf( PRINT_ALL, "GL_MAX_TEXTURE_SIZE: %d\n", glConfig.maxTextureSize );
@@ -1299,7 +1286,7 @@ void R_Register( void ) {
 	r_dlightScale = ri.Cvar_Get( "r_dlightScale", "1.0", CVAR_ARCHIVE );   //----(SA)	added
 	r_dlightBacks = ri.Cvar_Get( "r_dlightBacks", "1", CVAR_ARCHIVE );
 	r_finish = ri.Cvar_Get( "r_finish", "0", CVAR_ARCHIVE );
-	r_textureMode = ri.Cvar_Get( "r_textureMode", "GL_LINEAR_MIPMAP_NEAREST", CVAR_ARCHIVE );
+	r_textureMode = ri.Cvar_Get( "r_textureMode", "GL_LINEAR_MIPMAP_LINEAR", CVAR_ARCHIVE );
 
 	r_swapInterval = ri.Cvar_Get( "r_swapInterval", "0",
 					CVAR_ARCHIVE | CVAR_LATCH );
@@ -1507,6 +1494,8 @@ void R_Init( void ) {
 		ri.Printf( PRINT_ALL, "glGetError() = 0x%x\n", err );
 	}
 
+	// print info
+	GfxInfo_f();
 	ri.Printf( PRINT_ALL, "----- finished R_Init -----\n" );
 }
 
@@ -1549,6 +1538,7 @@ void RE_Shutdown( qboolean destroyWindow ) {
 		textureFilterAnisotropic = qfalse;
 		maxAnisotropy = 0;
 		displayAspect = 0.0f;
+		haveClampToEdge = qfalse;
 
 		Com_Memset( &glState, 0, sizeof( glState ) );
 	}
diff --git a/SP/code/renderer/tr_local.h b/SP/code/renderer/tr_local.h
index d66507b..f1ce04e 100644
--- a/SP/code/renderer/tr_local.h
+++ b/SP/code/renderer/tr_local.h
@@ -702,6 +702,12 @@ typedef struct {
 	drawVert_t      *verts;
 } srfTriangles_t;
 
+typedef struct {
+	vec3_t translate;
+	quat_t rotate;
+	vec3_t scale;
+} iqmTransform_t;
+
 // inter-quake-model
 typedef struct {
 	int		num_vertexes;
@@ -735,8 +741,9 @@ typedef struct {
 
 	char		*jointNames;
 	int		*jointParents;
-	float		*jointMats;
-	float		*poseMats;
+	float		*bindJoints; // [num_joints * 12]
+	float		*invBindJoints; // [num_joints * 12]
+	iqmTransform_t	*poses; // [num_frames * num_poses]
 	float		*bounds;
 } iqmData_t;
 
@@ -1135,6 +1142,7 @@ extern glstate_t glState;           // outside of TR since it shouldn't be clear
 extern qboolean  textureFilterAnisotropic;
 extern int       maxAnisotropy;
 extern float     displayAspect;
+extern qboolean  haveClampToEdge;
 
 //
 // cvars
diff --git a/SP/code/renderer/tr_model_iqm.c b/SP/code/renderer/tr_model_iqm.c
index 90471f7..e197086 100644
--- a/SP/code/renderer/tr_model_iqm.c
+++ b/SP/code/renderer/tr_model_iqm.c
@@ -2,6 +2,7 @@
 ===========================================================================
 Copyright (C) 2011 Thilo Schulz <thilo@tjps.eu>
 Copyright (C) 2011 Matthias Bentrup <matthias.bentrup@googlemail.com>
+Copyright (C) 2011-2019 Zack Middleton <zturtleman@gmail.com>
 
 This file is part of Quake III Arena source code.
 
@@ -44,7 +45,7 @@ static qboolean IQM_CheckRange( iqmHeader_t *header, int offset,
 }
 // "multiply" 3x4 matrices, these are assumed to be the top 3 rows
 // of a 4x4 matrix with the last row = (0 0 0 1)
-static void Matrix34Multiply( float *a, float *b, float *out ) {
+static void Matrix34Multiply( const float *a, const float *b, float *out ) {
 	out[ 0] = a[0] * b[0] + a[1] * b[4] + a[ 2] * b[ 8];
 	out[ 1] = a[0] * b[1] + a[1] * b[5] + a[ 2] * b[ 9];
 	out[ 2] = a[0] * b[2] + a[1] * b[6] + a[ 2] * b[10];
@@ -58,23 +59,7 @@ static void Matrix34Multiply( float *a, float *b, float *out ) {
 	out[10] = a[8] * b[2] + a[9] * b[6] + a[10] * b[10];
 	out[11] = a[8] * b[3] + a[9] * b[7] + a[10] * b[11] + a[11];
 }
-static void InterpolateMatrix( float *a, float *b, float lerp, float *mat ) {
-	float unLerp = 1.0f - lerp;
-
-	mat[ 0] = a[ 0] * unLerp + b[ 0] * lerp;
-	mat[ 1] = a[ 1] * unLerp + b[ 1] * lerp;
-	mat[ 2] = a[ 2] * unLerp + b[ 2] * lerp;
-	mat[ 3] = a[ 3] * unLerp + b[ 3] * lerp;
-	mat[ 4] = a[ 4] * unLerp + b[ 4] * lerp;
-	mat[ 5] = a[ 5] * unLerp + b[ 5] * lerp;
-	mat[ 6] = a[ 6] * unLerp + b[ 6] * lerp;
-	mat[ 7] = a[ 7] * unLerp + b[ 7] * lerp;
-	mat[ 8] = a[ 8] * unLerp + b[ 8] * lerp;
-	mat[ 9] = a[ 9] * unLerp + b[ 9] * lerp;
-	mat[10] = a[10] * unLerp + b[10] * lerp;
-	mat[11] = a[11] * unLerp + b[11] * lerp;
-}
-static void JointToMatrix( vec4_t rot, vec3_t scale, vec3_t trans,
+static void JointToMatrix( const quat_t rot, const vec3_t scale, const vec3_t trans,
 			   float *mat ) {
 	float xx = 2.0f * rot[0] * rot[0];
 	float yy = 2.0f * rot[1] * rot[1];
@@ -99,8 +84,7 @@ static void JointToMatrix( vec4_t rot, vec3_t scale, vec3_t trans,
 	mat[10] = scale[2] * (1.0f - (xx + yy));
 	mat[11] = trans[2];
 }
-static void Matrix34Invert( float *inMat, float *outMat )
-{
+static void Matrix34Invert( const float *inMat, float *outMat ) {
 	vec3_t trans;
 	float invSqrLen, *v;
 
@@ -120,6 +104,62 @@ static void Matrix34Invert( float *inMat, float *outMat )
 	outMat[ 7] = -DotProduct(outMat + 4, trans);
 	outMat[11] = -DotProduct(outMat + 8, trans);
 }
+static void QuatSlerp(const quat_t from, const quat_t _to, float fraction, quat_t out) {
+	float angle, cosAngle, sinAngle, backlerp, lerp;
+	quat_t to;
+
+	// cos() of angle
+	cosAngle = from[0] * _to[0] + from[1] * _to[1] + from[2] * _to[2] + from[3] * _to[3];
+
+	// negative handling is needed for taking shortest path (required for model joints)
+	if ( cosAngle < 0.0f ) {
+		cosAngle = -cosAngle;
+		to[0] = - _to[0];
+		to[1] = - _to[1];
+		to[2] = - _to[2];
+		to[3] = - _to[3];
+	} else {
+		QuatCopy( _to, to );
+	}
+
+	if ( cosAngle < 0.999999f ) {
+		// spherical lerp (slerp)
+		angle = acosf( cosAngle );
+		sinAngle = sinf( angle );
+		backlerp = sinf( ( 1.0f - fraction ) * angle ) / sinAngle;
+		lerp = sinf( fraction * angle ) / sinAngle;
+	} else {
+		// linear lerp
+		backlerp = 1.0f - fraction;
+		lerp = fraction;
+	}
+
+	out[0] = from[0] * backlerp + to[0] * lerp;
+	out[1] = from[1] * backlerp + to[1] * lerp;
+	out[2] = from[2] * backlerp + to[2] * lerp;
+	out[3] = from[3] * backlerp + to[3] * lerp;
+}
+static vec_t QuatNormalize2( const quat_t v, quat_t out) {
+	float	length, ilength;
+
+	length = v[0]*v[0] + v[1]*v[1] + v[2]*v[2] + v[3]*v[3];
+
+	if (length) {
+		/* writing it this way allows gcc to recognize that rsqrt can be used */
+		ilength = 1/(float)sqrt (length);
+		/* sqrt(length) = length * (1 / sqrt(length)) */
+		length *= ilength;
+		out[0] = v[0]*ilength;
+		out[1] = v[1]*ilength;
+		out[2] = v[2]*ilength;
+		out[3] = v[3]*ilength;
+	} else {
+		out[0] = out[1] = out[2] = 0;
+		out[3] = -1;
+	}
+
+	return length;
+}
 
 /*
 =================
@@ -139,7 +179,7 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
 	unsigned short		*framedata;
 	char			*str;
 	int			i, j, k;
-	float			jointInvMats[IQM_MAX_JOINTS * 12] = {0.0f};
+	iqmTransform_t		*transform;
 	float			*mat, *matInv;
 	size_t			size, joint_names;
 	byte			*dataPtr;
@@ -559,10 +599,11 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
 	if( header->num_joints ) {
 		size += joint_names;								// joint names
 		size += header->num_joints * sizeof(int);			// joint parents
-		size += header->num_joints * 12 * sizeof( float );	// joint mats
+		size += header->num_joints * 12 * sizeof(float);	// bind joint matricies
+		size += header->num_joints * 12 * sizeof(float);	// inverse bind joint matricies
 	}
 	if( header->num_poses ) {
-		size += header->num_poses * header->num_frames * 12 * sizeof( float ); // pose mats
+		size += header->num_poses * header->num_frames * sizeof(iqmTransform_t); // pose transforms
 	}
 	if( header->ofs_bounds ) {
 		size += header->num_frames * 6 * sizeof(float);		// model bounds
@@ -633,12 +674,15 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
 		iqmData->jointParents = (int*)dataPtr;
 		dataPtr += header->num_joints * sizeof(int);		// joint parents
 
-		iqmData->jointMats = (float*)dataPtr;
-		dataPtr += header->num_joints * 12 * sizeof( float ); // joint mats
+		iqmData->bindJoints = (float*)dataPtr;
+		dataPtr += header->num_joints * 12 * sizeof(float);		// bind joint matricies
+
+		iqmData->invBindJoints = (float*)dataPtr;
+		dataPtr += header->num_joints * 12 * sizeof(float);		// inverse bind joint matricies
 	}
 	if( header->num_poses ) {
-		iqmData->poseMats = (float*)dataPtr;
-		dataPtr += header->num_poses * header->num_frames * 12 * sizeof( float ); // pose mats
+		iqmData->poses = (iqmTransform_t*)dataPtr;
+		dataPtr += header->num_poses * header->num_frames * sizeof(iqmTransform_t); // pose transforms
 	}
 	if( header->ofs_bounds ) {
 		iqmData->bounds = (float*)dataPtr;
@@ -804,22 +848,23 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
 			iqmData->jointParents[i] = joint->parent;
 		}
 
-		// calculate joint matrices and their inverses
-		// joint inverses are needed only until the pose matrices are calculated
-		mat = iqmData->jointMats;
-		matInv = jointInvMats;
+		// calculate bind joint matrices and their inverses
+		mat = iqmData->bindJoints;
+		matInv = iqmData->invBindJoints;
 		joint = (iqmJoint_t *)((byte *)header + header->ofs_joints);
 		for( i = 0; i < header->num_joints; i++, joint++ ) {
 			float baseFrame[12], invBaseFrame[12];
 
+			QuatNormalize2( joint->rotate, joint->rotate );
+
 			JointToMatrix( joint->rotate, joint->scale, joint->translate, baseFrame );
 			Matrix34Invert( baseFrame, invBaseFrame );
 
 			if ( joint->parent >= 0 )
 			{
-				Matrix34Multiply( iqmData->jointMats + 12 * joint->parent, baseFrame, mat );
+				Matrix34Multiply( iqmData->bindJoints + 12 * joint->parent, baseFrame, mat );
 				mat += 12;
-				Matrix34Multiply( invBaseFrame, jointInvMats + 12 * joint->parent, matInv );
+				Matrix34Multiply( invBaseFrame, iqmData->invBindJoints + 12 * joint->parent, matInv );
 				matInv += 12;
 			}
 			else
@@ -834,16 +879,15 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
 
 	if( header->num_poses )
 	{
-		// calculate pose matrices
+		// calculate pose transforms
+		transform = iqmData->poses;
 		framedata = (unsigned short *)((byte *)header + header->ofs_frames);
-		mat = iqmData->poseMats;
 		for( i = 0; i < header->num_frames; i++ ) {
 			pose = (iqmPose_t *)((byte *)header + header->ofs_poses);
-			for( j = 0; j < header->num_poses; j++, pose++ ) {
+			for( j = 0; j < header->num_poses; j++, pose++, transform++ ) {
 				vec3_t	translate;
-				vec4_t	rotate;
+				quat_t	rotate;
 				vec3_t	scale;
-				float	mat1[12], mat2[12];
 
 				translate[0] = pose->channeloffset[0];
 				if( pose->mask & 0x001)
@@ -878,18 +922,9 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
 				if( pose->mask & 0x200)
 					scale[2] += *framedata++ * pose->channelscale[9];
 
-				// construct transformation matrix
-				JointToMatrix( rotate, scale, translate, mat1 );
-
-				if( pose->parent >= 0 ) {
-					Matrix34Multiply( iqmData->jointMats + 12 * pose->parent,
-							  mat1, mat2 );
-				} else {
-					Com_Memcpy( mat2, mat1, sizeof(mat1) );
-				}
-
-				Matrix34Multiply( mat2, jointInvMats + 12 * j, mat );
-				mat += 12;
+				VectorCopy( translate, transform->translate );
+				QuatNormalize2( rotate, transform->rotate );
+				VectorCopy( scale, transform->scale );
 			}
 		}
 	}
@@ -1128,37 +1163,59 @@ void R_AddIQMSurfaces( trRefEntity_t *ent ) {
 
 
 static void ComputePoseMats( iqmData_t *data, int frame, int oldframe,
-			      float backlerp, float *mat ) {
-	float	*mat1, *mat2;
-	int	*joint = data->jointParents;
-	int	i;
-
+			      float backlerp, float *poseMats ) {
+	iqmTransform_t relativeJoints[IQM_MAX_JOINTS];
+	iqmTransform_t *relativeJoint;
+	const iqmTransform_t *pose;
+	const iqmTransform_t *oldpose;
+	const int *jointParent;
+	const float *invBindMat;
+	float *poseMat, lerp;
+	int i;
+
+	relativeJoint = relativeJoints;
+
+	// copy or lerp animation frame pose
 	if ( oldframe == frame ) {
-		mat1 = data->poseMats + 12 * data->num_poses * frame;
-		for( i = 0; i < data->num_poses; i++, joint++ ) {
-			if( *joint >= 0 ) {
-				Matrix34Multiply( mat + 12 * *joint,
-						  mat1 + 12*i, mat + 12*i );
-			} else {
-				Com_Memcpy( mat + 12*i, mat1 + 12*i, 12 * sizeof(float) );
-			}
+		pose = &data->poses[frame * data->num_poses];
+		for ( i = 0; i < data->num_poses; i++, pose++, relativeJoint++ ) {
+			VectorCopy( pose->translate, relativeJoint->translate );
+			QuatCopy( pose->rotate, relativeJoint->rotate );
+			VectorCopy( pose->scale, relativeJoint->scale );
 		}
-	} else  {
-		mat1 = data->poseMats + 12 * data->num_poses * frame;
-		mat2 = data->poseMats + 12 * data->num_poses * oldframe;
-		
-		for( i = 0; i < data->num_poses; i++, joint++ ) {
-			if( *joint >= 0 ) {
-				float tmpMat[12];
-				InterpolateMatrix( mat1 + 12*i, mat2 + 12*i,
-						   backlerp, tmpMat );
-				Matrix34Multiply( mat + 12 * *joint,
-						  tmpMat, mat + 12*i );
-				
-			} else {
-				InterpolateMatrix( mat1 + 12*i, mat2 + 12*i,
-						   backlerp, mat + 12*i );
-			}
+	} else {
+		lerp = 1.0f - backlerp;
+		pose = &data->poses[frame * data->num_poses];
+		oldpose = &data->poses[oldframe * data->num_poses];
+		for ( i = 0; i < data->num_poses; i++, oldpose++, pose++, relativeJoint++ ) {
+			relativeJoint->translate[0] = oldpose->translate[0] * backlerp + pose->translate[0] * lerp;
+			relativeJoint->translate[1] = oldpose->translate[1] * backlerp + pose->translate[1] * lerp;
+			relativeJoint->translate[2] = oldpose->translate[2] * backlerp + pose->translate[2] * lerp;
+
+			relativeJoint->scale[0] = oldpose->scale[0] * backlerp + pose->scale[0] * lerp;
+			relativeJoint->scale[1] = oldpose->scale[1] * backlerp + pose->scale[1] * lerp;
+			relativeJoint->scale[2] = oldpose->scale[2] * backlerp + pose->scale[2] * lerp;
+
+			QuatSlerp( oldpose->rotate, pose->rotate, lerp, relativeJoint->rotate );
+		}
+	}
+
+	// multiply by inverse of bind pose and parent 'pose mat' (bind pose transform matrix)
+	relativeJoint = relativeJoints;
+	jointParent = data->jointParents;
+	invBindMat = data->invBindJoints;
+	poseMat = poseMats;
+	for ( i = 0; i < data->num_poses; i++, relativeJoint++, jointParent++, invBindMat += 12, poseMat += 12 ) {
+		float mat1[12], mat2[12];
+
+		JointToMatrix( relativeJoint->rotate, relativeJoint->scale, relativeJoint->translate, mat1 );
+
+		if ( *jointParent >= 0 ) {
+			Matrix34Multiply( &data->bindJoints[(*jointParent)*12], mat1, mat2 );
+			Matrix34Multiply( mat2, invBindMat, mat1 );
+			Matrix34Multiply( &poseMats[(*jointParent)*12], mat1, poseMat );
+		} else {
+			Matrix34Multiply( mat1, invBindMat, poseMat );
 		}
 	}
 }
@@ -1169,7 +1226,7 @@ static void ComputeJointMats( iqmData_t *data, int frame, int oldframe,
 	int	i;
 
 	if ( data->num_poses == 0 ) {
-		Com_Memcpy( mat, data->jointMats, data->num_joints * 12 * sizeof(float) );
+		Com_Memcpy( mat, data->bindJoints, data->num_joints * 12 * sizeof(float) );
 		return;
 	}
 
@@ -1181,7 +1238,7 @@ static void ComputeJointMats( iqmData_t *data, int frame, int oldframe,
 
 		Com_Memcpy(outmat, mat1, sizeof(outmat));
 
-		Matrix34Multiply( outmat, data->jointMats + 12*i, mat1 );
+		Matrix34Multiply( outmat, data->bindJoints + 12*i, mat1 );
 	}
 }
 
@@ -1245,20 +1302,21 @@ void RB_IQMSurfaceAnim( surfaceType_t *surface ) {
 			float *vtxMat = &influenceVtxMat[12*i];
 			float *nrmMat = &influenceNrmMat[9*i];
 			int	j;
-			float	blendWeights[4] = {0};
-			int		numWeights;
-
-			for ( numWeights = 0; numWeights < 4; numWeights++ ) {
-				if ( data->blendWeightsType == IQM_FLOAT )
-					blendWeights[numWeights] = data->influenceBlendWeights.f[4*influence + numWeights];
-				else
-					blendWeights[numWeights] = (float)data->influenceBlendWeights.b[4*influence + numWeights] / 255.0f;
+			float	blendWeights[4];
 
-				if ( blendWeights[numWeights] <= 0.0f )
-					break;
+			if ( data->blendWeightsType == IQM_FLOAT ) {
+				blendWeights[0] = data->influenceBlendWeights.f[4*influence + 0];
+				blendWeights[1] = data->influenceBlendWeights.f[4*influence + 1];
+				blendWeights[2] = data->influenceBlendWeights.f[4*influence + 2];
+				blendWeights[3] = data->influenceBlendWeights.f[4*influence + 3];
+			} else {
+				blendWeights[0] = (float)data->influenceBlendWeights.b[4*influence + 0] / 255.0f;
+				blendWeights[1] = (float)data->influenceBlendWeights.b[4*influence + 1] / 255.0f;
+				blendWeights[2] = (float)data->influenceBlendWeights.b[4*influence + 2] / 255.0f;
+				blendWeights[3] = (float)data->influenceBlendWeights.b[4*influence + 3] / 255.0f;
 			}
 
-			if ( numWeights == 0 ) {
+			if ( blendWeights[0] <= 0.0f ) {
 				// no blend joint, use identity matrix.
 				vtxMat[0] = identityMatrix[0];
 				vtxMat[1] = identityMatrix[1];
@@ -1288,7 +1346,11 @@ void RB_IQMSurfaceAnim( surfaceType_t *surface ) {
 				vtxMat[10] = blendWeights[0] * poseMats[12 * data->influenceBlendIndexes[4*influence + 0] + 10];
 				vtxMat[11] = blendWeights[0] * poseMats[12 * data->influenceBlendIndexes[4*influence + 0] + 11];
 
-				for( j = 1; j < numWeights; j++ ) {
+				for( j = 1; j < 4; j++ ) {
+					if ( blendWeights[j] <= 0.0f ) {
+						break;
+					}
+
 					vtxMat[0] += blendWeights[j] * poseMats[12 * data->influenceBlendIndexes[4*influence + j] + 0];
 					vtxMat[1] += blendWeights[j] * poseMats[12 * data->influenceBlendIndexes[4*influence + j] + 1];
 					vtxMat[2] += blendWeights[j] * poseMats[12 * data->influenceBlendIndexes[4*influence + j] + 2];
diff --git a/SP/code/sdl/sdl_glimp.c b/SP/code/sdl/sdl_glimp.c
index c5dbd08..94d1d87 100644
--- a/SP/code/sdl/sdl_glimp.c
+++ b/SP/code/sdl/sdl_glimp.c
@@ -62,8 +62,6 @@ static SDL_GLContext SDL_glContext = NULL;
 
 cvar_t *r_allowSoftwareGL; // Don't abort out if a hardware visual can't be obtained
 cvar_t *r_allowResize; // make window resizable
-cvar_t *r_windowPosx;
-cvar_t *r_windowPosy;
 cvar_t *r_centerWindow;
 cvar_t *r_sdlDriver;
 
@@ -77,7 +75,7 @@ void (APIENTRYP qglMultiTexCoord2fARB) (GLenum target, GLfloat s, GLfloat t);
 void (APIENTRYP qglLockArraysEXT) (GLint first, GLsizei count);
 void (APIENTRYP qglUnlockArraysEXT) (void);
 
-#define GLE(ret, name, ...) name##proc * qgl##name;
+#define GLE(ret, name, ...) name##proc * qgl##name = NULL;
 QGL_1_1_PROCS;
 QGL_1_1_FIXED_FUNCTION_PROCS;
 QGL_DESKTOP_1_1_PROCS;
@@ -101,19 +99,6 @@ GLimp_Shutdown
 */
 void GLimp_Shutdown( void )
 {
-	int x, y;
-	const char *posx;
-	const char *posy;
-
-	SDL_GetWindowPosition( SDL_window, &x, &y );
-	ri.Printf( PRINT_DEVELOPER, "Saving window position at %d,%d before closing.\n", x, y );
-
-	posx = va( "%d", x );
-	posy = va( "%d", y );
-
-	ri.Cvar_Set( "r_windowPosx", posx );
-	ri.Cvar_Set( "r_windowPosy", posy );
-
 	ri.IN_Shutdown();
 
 	SDL_QuitSubSystem( SDL_INIT_VIDEO );
@@ -341,7 +326,7 @@ static qboolean GLimp_GetProcAddresses( qboolean fixedFunction ) {
 	version = (const char *)qglGetString( GL_VERSION );
 
 	if ( !version ) {
-		Com_Error( ERR_FATAL, "GL_VERSION is NULL\n" );
+		Com_Error( ERR_FATAL, "GL_VERSION is NULL" );
 	}
 
 	if ( Q_stricmpn( "OpenGL ES", version, 9 ) == 0 ) {
@@ -357,7 +342,7 @@ static qboolean GLimp_GetProcAddresses( qboolean fixedFunction ) {
 	}
 
 	if ( fixedFunction ) {
-		if ( QGL_VERSION_ATLEAST( 1, 2 ) ) {
+		if ( QGL_VERSION_ATLEAST( 1, 1 ) ) {
 			QGL_1_1_PROCS;
 			QGL_1_1_FIXED_FUNCTION_PROCS;
 			QGL_DESKTOP_1_1_PROCS;
@@ -382,10 +367,10 @@ static qboolean GLimp_GetProcAddresses( qboolean fixedFunction ) {
 			qglFogi = GLimp_GLES_Fogi; /*Added*/
 #else
 			// error so this doesn't segfault due to NULL desktop GL functions being used
-			Com_Error( ERR_FATAL, "Unsupported OpenGL Version: %s\n", version );
+			Com_Error( ERR_FATAL, "Unsupported OpenGL Version: %s", version );
 #endif
 		} else {
-			Com_Error( ERR_FATAL, "Unsupported OpenGL Version (%s), OpenGL 1.2 is required\n", version );
+			Com_Error( ERR_FATAL, "Unsupported OpenGL Version (%s), OpenGL 1.1 is required", version );
 		}
 	} else {
 		if ( QGL_VERSION_ATLEAST( 2, 0 ) ) {
@@ -401,9 +386,9 @@ static qboolean GLimp_GetProcAddresses( qboolean fixedFunction ) {
 			QGL_1_5_PROCS;
 			QGL_2_0_PROCS;
 			// error so this doesn't segfault due to NULL desktop GL functions being used
-			Com_Error( ERR_FATAL, "Unsupported OpenGL Version: %s\n", version );
+			Com_Error( ERR_FATAL, "Unsupported OpenGL Version: %s", version );
 		} else {
-			Com_Error( ERR_FATAL, "Unsupported OpenGL Version (%s), OpenGL 2.0 is required\n", version );
+			Com_Error( ERR_FATAL, "Unsupported OpenGL Version (%s), OpenGL 2.0 is required", version );
 		}
 	}
 
@@ -545,6 +530,13 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, qboolean noborder, qbool
 	}
 	ri.Printf( PRINT_ALL, " %d %d\n", glConfig.vidWidth, glConfig.vidHeight);
 
+	// Center window
+	if( r_centerWindow->integer && !fullscreen )
+	{
+		x = ( desktopMode.w / 2 ) - ( glConfig.vidWidth / 2 );
+		y = ( desktopMode.h / 2 ) - ( glConfig.vidHeight / 2 );
+	}
+
 	// Destroy existing state if it exists
 	if( SDL_glContext != NULL )
 	{
@@ -655,7 +647,7 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, qboolean noborder, qbool
 			perChannelColorBits = 0; /* Use minimum size for 16-bit color */
 
 		/* Need alpha or else SGIs choose 36+ bit RGB mode */
-		SDL_GL_SetAttribute( SDL_GL_ALPHA_SIZE, 1 );
+		SDL_GL_SetAttribute( SDL_GL_ALPHA_SIZE, 1);
 #endif
 
 #ifdef USE_OPENGLES
@@ -674,54 +666,27 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, qboolean noborder, qbool
 		if(r_stereoEnabled->integer)
 		{
 			glConfig.stereoEnabled = qtrue;
-			SDL_GL_SetAttribute( SDL_GL_STEREO, 1 );
+			SDL_GL_SetAttribute(SDL_GL_STEREO, 1);
 		}
 		else
 		{
 			glConfig.stereoEnabled = qfalse;
-			SDL_GL_SetAttribute( SDL_GL_STEREO, 0 );
+			SDL_GL_SetAttribute(SDL_GL_STEREO, 0);
 		}
 		
 		SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
 
+#if 0 // if multisampling is enabled on X11, this causes create window to fail.
 		// If not allowing software GL, demand accelerated
 		if( !r_allowSoftwareGL->integer )
-		{
-			int value;
-
 			SDL_GL_SetAttribute( SDL_GL_ACCELERATED_VISUAL, 1 );
+#endif
 
-			//Fall back to allow either if setting attribute failed
-			if( SDL_GL_GetAttribute( SDL_GL_ACCELERATED_VISUAL, &value ) != 1 )
-				SDL_GL_SetAttribute( SDL_GL_ACCELERATED_VISUAL, -1 );
-		}
-
-		if( r_centerWindow->integer && !fullscreen )
- 		{
-			if( ( SDL_window = SDL_CreateWindow( CLIENT_WINDOW_TITLE, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
-					glConfig.vidWidth, glConfig.vidHeight, flags ) ) == NULL )
-			{
-				ri.Printf( PRINT_DEVELOPER, "SDL_CreateWindow failed: %s\n", SDL_GetError( ) );
-				continue;
-			}
-		}
-		else if ( ( r_windowPosx->integer || r_windowPosy->integer ) && !fullscreen )
+		if( ( SDL_window = SDL_CreateWindow( CLIENT_WINDOW_TITLE, x, y,
+				glConfig.vidWidth, glConfig.vidHeight, flags ) ) == NULL )
 		{
-			if( ( SDL_window = SDL_CreateWindow( CLIENT_WINDOW_TITLE, r_windowPosx->integer, r_windowPosy->integer,
-					glConfig.vidWidth, glConfig.vidHeight, flags ) ) == NULL )
-			{
-				ri.Printf( PRINT_DEVELOPER, "SDL_CreateWindow failed: %s\n", SDL_GetError( ) );
-				continue;
-			}
- 		}
-		else
-		{
-			if( ( SDL_window = SDL_CreateWindow( CLIENT_WINDOW_TITLE, x, y,
-					glConfig.vidWidth, glConfig.vidHeight, flags ) ) == NULL )
-			{
-				ri.Printf( PRINT_DEVELOPER, "SDL_CreateWindow failed: %s\n", SDL_GetError( ) );
-				continue;
-			}
+			ri.Printf( PRINT_DEVELOPER, "SDL_CreateWindow failed: %s\n", SDL_GetError( ) );
+			continue;
 		}
 
 		if( fullscreen )
@@ -790,7 +755,7 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, qboolean noborder, qbool
 					ri.Printf( PRINT_ALL, "GLimp_GetProcAddresses() failed for OpenGL 3.2 core context\n" );
 					renderer = NULL;
 				}
- 
+
 				if (!renderer || (strstr(renderer, "Software Renderer") || strstr(renderer, "Software Rasterizer")))
 				{
 					if ( renderer )
@@ -883,6 +848,7 @@ static qboolean GLimp_StartDriverAndSetMode(int mode, qboolean fullscreen, qbool
 	if (!SDL_WasInit(SDL_INIT_VIDEO))
 	{
 		const char *driverName;
+		SDL_version linked;
 
 		if (SDL_Init(SDL_INIT_VIDEO) != 0)
 		{
@@ -890,6 +856,8 @@ static qboolean GLimp_StartDriverAndSetMode(int mode, qboolean fullscreen, qbool
 			return qfalse;
 		}
 
+		SDL_GetVersion(&linked);
+		ri.Printf( PRINT_ALL, "SDL version %d.%d.%d\n", linked.major, linked.minor, linked.patch);
 		driverName = SDL_GetCurrentVideoDriver( );
 		ri.Printf( PRINT_ALL, "SDL using driver \"%s\"\n", driverName );
 		ri.Cvar_Set( "r_sdlDriver", driverName );
@@ -978,7 +946,6 @@ static void GLimp_InitExtensions( qboolean fixedFunction )
 		}
 	}
 
-
 	// OpenGL 1 fixed function pipeline
 	if ( fixedFunction )
 	{
@@ -1115,6 +1082,17 @@ static void GLimp_InitExtensions( qboolean fixedFunction )
 	{
 		ri.Printf( PRINT_ALL, "...GL_EXT_texture_filter_anisotropic not found\n" );
 	}
+
+	haveClampToEdge = qfalse;
+	if ( QGL_VERSION_ATLEAST( 1, 2 ) || QGLES_VERSION_ATLEAST( 1, 0 ) || SDL_GL_ExtensionSupported( "GL_SGIS_texture_edge_clamp" ) )
+	{
+		ri.Printf( PRINT_ALL, "...using GL_SGIS_texture_edge_clamp\n" );
+		haveClampToEdge = qtrue;
+	}
+	else
+	{
+		ri.Printf( PRINT_ALL, "...GL_SGIS_texture_edge_clamp not found\n" );
+	}
 }
 
 #define R_MODE_FALLBACK 3 // 640 * 480
@@ -1134,8 +1112,6 @@ void GLimp_Init( qboolean fixedFunction )
 	r_allowSoftwareGL = ri.Cvar_Get( "r_allowSoftwareGL", "0", CVAR_LATCH );
 	r_sdlDriver = ri.Cvar_Get( "r_sdlDriver", "", CVAR_ROM );
 	r_allowResize = ri.Cvar_Get( "r_allowResize", "0", CVAR_ARCHIVE | CVAR_LATCH );
-	r_windowPosx = ri.Cvar_Get( "r_windowPosx", "0", CVAR_ARCHIVE );
-	r_windowPosy = ri.Cvar_Get( "r_windowPosy", "0", CVAR_ARCHIVE );
 	r_centerWindow = ri.Cvar_Get( "r_centerWindow", "0", CVAR_ARCHIVE | CVAR_LATCH );
 
 	if( ri.Cvar_VariableIntegerValue( "com_abnormalExit" ) )
@@ -1247,8 +1223,8 @@ void GLimp_EndFrame( void )
 
 	if( r_fullscreen->modified )
 	{
-		qboolean	fullscreen;
-		qboolean	needToToggle;
+		int         fullscreen;
+		qboolean    needToToggle;
 
 		// Find out the current state
 		fullscreen = !!( SDL_GetWindowFlags( SDL_window ) & SDL_WINDOW_FULLSCREEN );
@@ -1266,10 +1242,13 @@ void GLimp_EndFrame( void )
 		if( needToToggle )
 		{
 			// Need the vid_restart here since r_fullscreen is only latched
-			if( fullscreen ) {
+			if( fullscreen )
+			{
 				Com_Printf( "Switching to windowed rendering\n" );
 				ri.Cmd_ExecuteText(EXEC_APPEND, "vid_restart\n");
-			} else {
+			}
+			else
+			{
 				Com_Printf( "Switching to fullscreen rendering\n" );
 				ri.Cmd_ExecuteText(EXEC_APPEND, "vid_restart\n");
 			}
diff --git a/SP/code/sdl/sdl_input.c b/SP/code/sdl/sdl_input.c
index f6adb36..ce55c9b 100644
--- a/SP/code/sdl/sdl_input.c
+++ b/SP/code/sdl/sdl_input.c
@@ -33,6 +33,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #include "../client/client.h"
 #include "../sys/sys_local.h"
 
+#if !SDL_VERSION_ATLEAST(2, 0, 17)
+#define KMOD_SCROLL KMOD_RESERVED
+#endif
+
 static cvar_t *in_keyboardDebug     = NULL;
 
 static SDL_GameController *gamepad = NULL;
@@ -84,7 +88,7 @@ static void IN_PrintKey( const SDL_Keysym *keysym, keyNum_t key, qboolean down )
 	if( keysym->mod & KMOD_NUM )      Com_Printf( " KMOD_NUM" );
 	if( keysym->mod & KMOD_CAPS )     Com_Printf( " KMOD_CAPS" );
 	if( keysym->mod & KMOD_MODE )     Com_Printf( " KMOD_MODE" );
-	if( keysym->mod & KMOD_RESERVED ) Com_Printf( " KMOD_RESERVED" );
+	if( keysym->mod & KMOD_SCROLL )   Com_Printf( " KMOD_SCROLL" );
 
 	Com_Printf( " Q:0x%02x(%s)\n", key, Key_KeynumToString( key, qtrue ) );
 }
@@ -490,7 +494,8 @@ static void IN_InitJoystick( void )
 	}
 
 	total = SDL_NumJoysticks();
-	Com_DPrintf("%d possible joysticks\n", total);
+	if ( total )
+		Com_Printf("%d possible joysticks\n", total);
 
 	// Print list and build cvar to allow ui to select joystick.
 	for (i = 0; i < total; i++)
@@ -1123,9 +1128,7 @@ static void IN_ProcessEvents( void )
 							width = e.window.data1;
 							height = e.window.data2;
 
-							// check for fullscreen
-							// SDL_WINDOWEVENT_RESIZED occurs when requested resolution != given resolution
-							// This prevents an infinite vid_restart loop 
+							// ignore this event on fullscreen
 							if( cls.glconfig.isFullscreen )
 							{
 								break;
diff --git a/SP/code/sdl/sdl_snd.c b/SP/code/sdl/sdl_snd.c
index eb0dd58..09cc87f 100644
--- a/SP/code/sdl/sdl_snd.c
+++ b/SP/code/sdl/sdl_snd.c
@@ -187,6 +187,7 @@ qboolean SNDDMA_Init(void)
 {
 	SDL_AudioSpec desired;
 	SDL_AudioSpec obtained;
+	SDL_version linked;
 	int tmp;
 
 	if (snd_inited)
@@ -200,16 +201,17 @@ qboolean SNDDMA_Init(void)
 		s_sdlMixSamps = Cvar_Get("s_sdlMixSamps", "0", CVAR_ARCHIVE);
 	}
 
-	Com_Printf( "SDL_Init( SDL_INIT_AUDIO )... " );
+	Com_DPrintf( "SDL_Init( SDL_INIT_AUDIO )... " );
 
 	if (SDL_Init(SDL_INIT_AUDIO) != 0)
 	{
-		Com_Printf( "FAILED (%s)\n", SDL_GetError( ) );
+		Com_Printf( "SDL_Init( SDL_INIT_AUDIO ) FAILED (%s)\n", SDL_GetError( ) );
 		return qfalse;
 	}
 
-	Com_Printf( "OK\n" );
-
+	Com_DPrintf( "OK\n" );
+	SDL_GetVersion(&linked);
+	Com_Printf( "SDL version %d.%d.%d\n", linked.major, linked.minor, linked.patch);
 	Com_Printf( "SDL audio driver is \"%s\".\n", SDL_GetCurrentAudioDriver( ) );
 
 	memset(&desired, '\0', sizeof (desired));
@@ -281,12 +283,7 @@ qboolean SNDDMA_Init(void)
 #ifdef USE_SDL_AUDIO_CAPTURE
 	// !!! FIXME: some of these SDL_OpenAudioDevice() values should be cvars.
 	s_sdlCapture = Cvar_Get( "s_sdlCapture", "1", CVAR_ARCHIVE | CVAR_LATCH );
-	// !!! FIXME: pulseaudio capture records audio the entire time the program is running. https://bugzilla.libsdl.org/show_bug.cgi?id=4087
-	if (Q_stricmp(SDL_GetCurrentAudioDriver(), "pulseaudio") == 0)
-	{
-		Com_Printf("SDL audio capture support disabled for pulseaudio (https://bugzilla.libsdl.org/show_bug.cgi?id=4087)\n");
-	}
-	else if (!s_sdlCapture->integer)
+	if (!s_sdlCapture->integer)
 	{
 		Com_Printf("SDL audio capture support disabled by user ('+set s_sdlCapture 1' to enable)\n");
 	}
diff --git a/SP/code/sys/sys_main.c b/SP/code/sys/sys_main.c
index e7a5db7..2c880f1 100644
--- a/SP/code/sys/sys_main.c
+++ b/SP/code/sys/sys_main.c
@@ -579,7 +579,7 @@ Used to load a development dll instead of a virtual machine
 =================
 */
 void *Sys_LoadGameDll(const char *name,
-	intptr_t (QDECL **entryPoint)(intptr_t, ...),
+	vmMainProc *entryPoint,
 	intptr_t (*systemcalls)(intptr_t, ...))
 {
 	void *libHandle;
diff --git a/SP/code/sys/sys_unix.c b/SP/code/sys/sys_unix.c
index 324b414..32ba948 100644
--- a/SP/code/sys/sys_unix.c
+++ b/SP/code/sys/sys_unix.c
@@ -964,6 +964,14 @@ qboolean Sys_DllExtension( const char *name ) {
 		return qtrue;
 	}
 
+#ifdef __APPLE__
+	// Allow system frameworks without dylib extensions
+	// i.e., /System/Library/Frameworks/OpenAL.framework/OpenAL
+	if ( strncmp( name, "/System/Library/Frameworks/", 27 ) == 0 ) {
+		return qtrue;
+	}
+#endif
+
 	// Check for format of filename.so.1.2.3
 	p = strstr( name, DLL_EXT "." );
 
diff --git a/SP/code/tools/stringify.c b/SP/code/tools/stringify.c
new file mode 100644
index 0000000..a5ce84b
--- /dev/null
+++ b/SP/code/tools/stringify.c
@@ -0,0 +1,51 @@
+#include <stdio.h>
+#include <ctype.h>
+#include <string.h>
+#include <libgen.h>
+
+int main(int argc, char **argv)
+{
+    FILE *ifp;
+    FILE *ofp;
+    char buffer[1024];
+
+    if(argc < 3)
+        return 1;
+
+    char *inFile = argv[1];
+    char *outFile = argv[2];
+
+    ifp = fopen(inFile, "r");
+    if(!ifp)
+        return 2;
+
+    ofp = fopen(outFile, "w");
+    if(!ofp)
+        return 3;
+
+    // Strip extension
+    char *base = basename(inFile);
+    *strrchr(base, '.') = '\0';
+
+    fprintf(ofp, "const char *fallbackShader_%s =\n", base);
+
+    while(fgets(buffer, sizeof(buffer), ifp))
+    {
+        // Strip trailing whitespace from line
+        char *end = buffer + strlen(buffer) - 1;
+        while(end >= buffer && isspace(*end))
+            end--;
+
+        end[1] = '\0';
+
+        // Write line enquoted, with a newline
+        fprintf(ofp, "\"%s\\n\"\n", buffer);
+    }
+
+    fprintf(ofp, ";\n");
+
+    fclose(ifp);
+    fclose(ofp);
+
+    return 0;
+}
diff --git a/SP/code/ui/ui_main.c b/SP/code/ui/ui_main.c
index 22790e8..1ec258a 100644
--- a/SP/code/ui/ui_main.c
+++ b/SP/code/ui/ui_main.c
@@ -4690,8 +4690,7 @@ static void UI_RunMenuScript( char **args ) {
 			trap_Cvar_Set( "cdkey2", "" );
 			trap_Cvar_Set( "cdkey3", "" );
 			trap_Cvar_Set( "cdkey4", "" );
-			trap_Cvar_Set( "cdkeychecksum", "" );
-			if ( buff[0] != 32 && strlen( buff ) == CDKEY_LEN ) {
+			if ( strlen( buff ) == CDKEY_LEN ) {
 				Q_strncpyz( out, buff, 5 );
 				trap_Cvar_Set( "cdkey1", out );
 				Q_strncpyz( out, buff + 4, 5 );
diff --git a/SP/make-macosx-app.sh b/SP/make-macosx-app.sh
new file mode 100755
index 0000000..caa00ea
--- /dev/null
+++ b/SP/make-macosx-app.sh
@@ -0,0 +1,404 @@
+#!/bin/bash
+
+# Let's make the user give us a target to work with.
+# architecture is assumed universal if not specified, and is optional.
+# if arch is defined, it we will store the .app bundle in the target arch build directory
+if [ $# == 0 ] || [ $# -gt 2 ]; then
+	echo "Usage:   $0 target <arch>"
+	echo "Example: $0 release x86"
+	echo "Valid targets are:"
+	echo " release"
+	echo " debug"
+	echo
+	echo "Optional architectures are:"
+	echo " x86"
+	echo " x86_64"
+	echo " ppc"
+	echo " arm64"
+	echo
+	exit 1
+fi
+
+# validate target name
+if [ "$1" == "release" ]; then
+	TARGET_NAME="release"
+elif [ "$1" == "debug" ]; then
+	TARGET_NAME="debug"
+else
+	echo "Invalid target: $1"
+	echo "Valid targets are:"
+	echo " release"
+	echo " debug"
+	exit 1
+fi
+
+CURRENT_ARCH=""
+
+# validate the architecture if it was specified
+if [ "$2" != "" ]; then
+	if [ "$2" == "x86" ]; then
+		CURRENT_ARCH="x86"
+	elif [ "$2" == "x86_64" ]; then
+		CURRENT_ARCH="x86_64"
+	elif [ "$2" == "ppc" ]; then
+		CURRENT_ARCH="ppc"
+	elif [ "$2" == "arm64" ]; then
+		CURRENT_ARCH="arm64"
+	else
+		echo "Invalid architecture: $2"
+		echo "Valid architectures are:"
+		echo " x86"
+		echo " x86_64"
+		echo " ppc"
+		echo " arm64"
+		echo
+		exit 1
+	fi
+fi
+
+# symlinkArch() creates a symlink with the architecture suffix.
+# meant for universal binaries, but also handles the way this script generates
+# application bundles for a single architecture as well.
+function symlinkArch()
+{
+    EXT="dylib"
+    SEP="${3}"
+    SRCFILE="${1}"
+    DSTFILE="${2}${SEP}"
+    DSTPATH="${4}"
+
+    if [ ! -e "${DSTPATH}/${SRCFILE}.${EXT}" ]; then
+        echo "**** ERROR: missing ${SRCFILE}.${EXT} from ${MACOS}"
+        exit 1
+    fi
+
+    if [ ! -d "${DSTPATH}" ]; then
+        echo "**** ERROR: path not found ${DSTPATH}"
+        exit 1
+    fi
+
+    pushd "${DSTPATH}" > /dev/null
+
+    IS32=`file "${SRCFILE}.${EXT}" | grep "i386"`
+    IS64=`file "${SRCFILE}.${EXT}" | grep "x86_64"`
+    ISPPC=`file "${SRCFILE}.${EXT}" | grep "ppc"`
+    ISARM=`file "${SRCFILE}.${EXT}" | grep "arm64"`
+
+    if [ "${IS32}" != "" ]; then
+        if [ ! -L "${DSTFILE}i386.${EXT}" ]; then
+            ln -s "${SRCFILE}.${EXT}" "${DSTFILE}i386.${EXT}"
+        fi
+    elif [ -L "${DSTFILE}i386.${EXT}" ]; then
+        rm "${DSTFILE}i386.${EXT}"
+    fi
+
+    if [ "${IS64}" != "" ]; then
+        if [ ! -L "${DSTFILE}x86_64.${EXT}" ]; then
+            ln -s "${SRCFILE}.${EXT}" "${DSTFILE}x86_64.${EXT}"
+        fi
+    elif [ -L "${DSTFILE}x86_64.${EXT}" ]; then
+        rm "${DSTFILE}x86_64.${EXT}"
+    fi
+
+    if [ "${ISPPC}" != "" ]; then
+        if [ ! -L "${DSTFILE}ppc.${EXT}" ]; then
+            ln -s "${SRCFILE}.${EXT}" "${DSTFILE}ppc.${EXT}"
+        fi
+    elif [ -L "${DSTFILE}ppc.${EXT}" ]; then
+        rm "${DSTFILE}ppc.${EXT}"
+    fi
+
+    if [ "${ISARM}" != "" ]; then
+        if [ ! -L "${DSTFILE}arm64.${EXT}" ]; then
+            ln -s "${SRCFILE}.${EXT}" "${DSTFILE}arm64.${EXT}"
+        fi
+    elif [ -L "${DSTFILE}arm64.${EXT}" ]; then
+        rm "${DSTFILE}arm64.${EXT}"
+    fi
+
+    popd > /dev/null
+}
+
+SEARCH_ARCHS="	\
+	x86	\
+	x86_64	\
+	ppc	\
+	arm64 \
+"
+
+HAS_LIPO=`command -v lipo`
+HAS_CP=`command -v cp`
+
+# if lipo is not available, we cannot make a universal binary, print a warning
+if [ ! -x "${HAS_LIPO}" ] && [ "${CURRENT_ARCH}" == "" ]; then
+	CURRENT_ARCH=`uname -m`
+	if [ "${CURRENT_ARCH}" == "i386" ]; then CURRENT_ARCH="x86"; fi
+	echo "$0 cannot make a universal binary, falling back to architecture ${CURRENT_ARCH}"
+fi
+
+# if the optional arch parameter is used, replace SEARCH_ARCHS to only work with one
+if [ "${CURRENT_ARCH}" != "" ]; then
+	SEARCH_ARCHS="${CURRENT_ARCH}"
+fi
+
+AVAILABLE_ARCHS=""
+
+IORTCW_VERSION=`grep '^VERSION=' Makefile | sed -e 's/.*=\(.*\)/\1/'`
+IORTCW_CLIENT_ARCHS=""
+IORTCW_RENDERER_GL1_ARCHS=""
+IORTCW_RENDERER_GL2_ARCHS=""
+IORTCW_CGAME_ARCHS=""
+IORTCW_GAME_ARCHS=""
+IORTCW_UI_ARCHS=""
+
+BASEDIR="main"
+
+CGAME="cgame.sp"
+GAME="qagame.sp"
+UI="ui.sp"
+
+RENDERER_OPENGL="renderer_sp_opengl1"
+RENDERER_OPENGL2="renderer_sp_rend2"
+
+CGAME_NAME="${CGAME}.dylib"
+GAME_NAME="${GAME}.dylib"
+UI_NAME="${UI}.dylib"
+
+RENDERER_OPENGL1_NAME="renderer_sp_opengl1.dylib"
+RENDERER_OPENGL2_NAME="renderer_sp_rend2.dylib"
+
+ICNSDIR="misc"
+ICNS="iortcw.icns"
+PKGINFO="APPLIORTCW"
+
+OBJROOT="build"
+#BUILT_PRODUCTS_DIR="${OBJROOT}/${TARGET_NAME}-darwin-${CURRENT_ARCH}"
+PRODUCT_NAME="iowolfsp"
+WRAPPER_EXTENSION="app"
+WRAPPER_NAME="${PRODUCT_NAME}.${WRAPPER_EXTENSION}"
+CONTENTS_FOLDER_PATH="${WRAPPER_NAME}/Contents"
+UNLOCALIZED_RESOURCES_FOLDER_PATH="${CONTENTS_FOLDER_PATH}/Resources"
+EXECUTABLE_FOLDER_PATH="${CONTENTS_FOLDER_PATH}/MacOS"
+EXECUTABLE_NAME="${PRODUCT_NAME}"
+
+# loop through the architectures to build string lists for each universal binary
+for ARCH in $SEARCH_ARCHS; do
+	CURRENT_ARCH=${ARCH}
+
+	if [ ${CURRENT_ARCH} == "x86" ]; then FILE_ARCH="i386"; fi
+	if [ ${CURRENT_ARCH} == "x86_64" ]; then FILE_ARCH="x86_64"; fi
+	if [ ${CURRENT_ARCH} == "ppc" ]; then FILE_ARCH="ppc"; fi
+	if [ ${CURRENT_ARCH} == "arm64" ]; then FILE_ARCH="arm64"; fi
+
+	BUILT_PRODUCTS_DIR="${OBJROOT}/${TARGET_NAME}-darwin-${CURRENT_ARCH}"
+	IORTCW_CLIENT="${EXECUTABLE_NAME}.${CURRENT_ARCH}"
+	IORTCW_RENDERER_GL1="${RENDERER_OPENGL}_${FILE_ARCH}.dylib"
+	IORTCW_RENDERER_GL2="${RENDERER_OPENGL2}_${FILE_ARCH}.dylib"
+	IORTCW_CGAME="${CGAME}.${FILE_ARCH}.dylib"
+	IORTCW_GAME="${GAME}.${FILE_ARCH}.dylib"
+	IORTCW_UI="${UI}.${FILE_ARCH}.dylib"
+
+	if [ ! -d ${BUILT_PRODUCTS_DIR} ]; then
+		CURRENT_ARCH=""
+		BUILT_PRODUCTS_DIR=""
+		continue
+	fi
+
+	# executables
+	if [ -e ${BUILT_PRODUCTS_DIR}/${IORTCW_CLIENT} ]; then
+		IORTCW_CLIENT_ARCHS="${BUILT_PRODUCTS_DIR}/${IORTCW_CLIENT} ${IORTCW_CLIENT_ARCHS}"
+		VALID_ARCHS="${ARCH} ${VALID_ARCHS}"
+	else
+		continue
+	fi
+
+	# renderers
+	if [ -e ${BUILT_PRODUCTS_DIR}/${IORTCW_RENDERER_GL1} ]; then
+		IORTCW_RENDERER_GL1_ARCHS="${BUILT_PRODUCTS_DIR}/${IORTCW_RENDERER_GL1} ${IORTCW_RENDERER_GL1_ARCHS}"
+	fi
+	if [ -e ${BUILT_PRODUCTS_DIR}/${IORTCW_RENDERER_GL2} ]; then
+		IORTCW_RENDERER_GL2_ARCHS="${BUILT_PRODUCTS_DIR}/${IORTCW_RENDERER_GL2} ${IORTCW_RENDERER_GL2_ARCHS}"
+	fi
+
+	# game
+	if [ -e ${BUILT_PRODUCTS_DIR}/${BASEDIR}/${IORTCW_CGAME} ]; then
+		IORTCW_CGAME_ARCHS="${BUILT_PRODUCTS_DIR}/${BASEDIR}/${IORTCW_CGAME} ${IORTCW_CGAME_ARCHS}"
+	fi
+	if [ -e ${BUILT_PRODUCTS_DIR}/${BASEDIR}/${IORTCW_GAME} ]; then
+		IORTCW_GAME_ARCHS="${BUILT_PRODUCTS_DIR}/${BASEDIR}/${IORTCW_GAME} ${IORTCW_GAME_ARCHS}"
+	fi
+	if [ -e ${BUILT_PRODUCTS_DIR}/${BASEDIR}/${IORTCW_UI} ]; then
+		IORTCW_UI_ARCHS="${BUILT_PRODUCTS_DIR}/${BASEDIR}/${IORTCW_UI} ${IORTCW_UI_ARCHS}"
+	fi
+
+	#echo "valid arch: ${ARCH}"
+done
+
+# final preparations and checks before attempting to make the application bundle
+cd `dirname $0`
+
+if [ ! -f Makefile ]; then
+	echo "$0 must be run from the iortcw build directory"
+	exit 1
+fi
+
+if [ "${IORTCW_CLIENT_ARCHS}" == "" ]; then
+	echo "$0: no iortcw binary architectures were found for target '${TARGET_NAME}'"
+	exit 1
+fi
+
+# set the final application bundle output directory
+if [ "${2}" == "" ]; then
+	BUILT_PRODUCTS_DIR="${OBJROOT}/${TARGET_NAME}-darwin-universal"
+	if [ ! -d ${BUILT_PRODUCTS_DIR} ]; then
+		mkdir -p ${BUILT_PRODUCTS_DIR} || exit 1;
+	fi
+else
+	BUILT_PRODUCTS_DIR="${OBJROOT}/${TARGET_NAME}-darwin-${CURRENT_ARCH}"
+fi
+
+BUNDLEBINDIR="${BUILT_PRODUCTS_DIR}/${EXECUTABLE_FOLDER_PATH}"
+
+
+# here we go
+echo "Creating bundle '${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}'"
+echo "with architectures:"
+for ARCH in ${VALID_ARCHS}; do
+	echo " ${ARCH}"
+done
+echo ""
+
+# make the application bundle directories
+if [ ! -d "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_FOLDER_PATH}/$BASEDIR" ]; then
+	mkdir -p "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_FOLDER_PATH}/$BASEDIR" || exit 1;
+fi
+if [ ! -d "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" ]; then
+	mkdir -p "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" || exit 1;
+fi
+
+# copy and generate some application bundle resources
+cp code/libs/macosx/*.dylib "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_FOLDER_PATH}"
+cp ${ICNSDIR}/${ICNS} "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/$ICNS" || exit 1;
+echo -n ${PKGINFO} > "${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/PkgInfo" || exit 1;
+
+# create Info.Plist
+PLIST="<?xml version=\"1.0\" encoding=\"UTF-8\"?>
+<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
+<plist version=\"1.0\">
+<dict>
+    <key>CFBundleDevelopmentRegion</key>
+    <string>en</string>
+    <key>CFBundleExecutable</key>
+    <string>${EXECUTABLE_NAME}</string>
+    <key>CFBundleIconFile</key>
+    <string>iortcw</string>
+    <key>CFBundleIdentifier</key>
+    <string>org.iortcw.${PRODUCT_NAME}</string>
+    <key>CFBundleInfoDictionaryVersion</key>
+    <string>6.0</string>
+    <key>CFBundleName</key>
+    <string>${PRODUCT_NAME}</string>
+    <key>CFBundlePackageType</key>
+    <string>APPL</string>
+    <key>CFBundleShortVersionString</key>
+    <string>${IORTCW_VERSION}</string>
+    <key>CFBundleSignature</key>
+    <string>????</string>
+    <key>CFBundleVersion</key>
+    <string>${IORTCW_VERSION}</string>
+    <key>CGDisableCoalescedUpdates</key>
+    <true/>
+    <key>LSMinimumSystemVersion</key>
+    <string>${MACOSX_DEPLOYMENT_TARGET}</string>"
+
+if [ -n "${MACOSX_DEPLOYMENT_TARGET_PPC}" ] || [ -n "${MACOSX_DEPLOYMENT_TARGET_X86}" ] || [ -n "${MACOSX_DEPLOYMENT_TARGET_X86_64}" ] || [ -n "${MACOSX_DEPLOYMENT_TARGET_ARM64}" ]; then
+	PLIST="${PLIST}
+    <key>LSMinimumSystemVersionByArchitecture</key>
+    <dict>"
+
+	if [ -n "${MACOSX_DEPLOYMENT_TARGET_PPC}" ]; then
+	PLIST="${PLIST}
+        <key>ppc</key>
+        <string>${MACOSX_DEPLOYMENT_TARGET_PPC}</string>"
+	fi
+
+	if [ -n "${MACOSX_DEPLOYMENT_TARGET_X86}" ]; then
+	PLIST="${PLIST}
+        <key>i386</key>
+        <string>${MACOSX_DEPLOYMENT_TARGET_X86}</string>"
+	fi
+
+	if [ -n "${MACOSX_DEPLOYMENT_TARGET_X86_64}" ]; then
+	PLIST="${PLIST}
+        <key>x86_64</key>
+        <string>${MACOSX_DEPLOYMENT_TARGET_X86_64}</string>"
+	fi
+
+	if [ -n "${MACOSX_DEPLOYMENT_TARGET_ARM64}" ]; then
+	PLIST="${PLIST}
+        <key>arm64</key>
+        <string>${MACOSX_DEPLOYMENT_TARGET_ARM64}</string>"
+	fi
+
+	PLIST="${PLIST}
+    </dict>"
+fi
+
+PLIST="${PLIST}
+    <key>NSHumanReadableCopyright</key>
+    <string>Return to Castle Wolfenstein single player Copyright (C) 1999-2010 id Software LLC, a ZeniMax Media company.</string>
+    <key>NSPrincipalClass</key>
+    <string>NSApplication</string>
+    <key>NSHighResolutionCapable</key>
+    <false/>
+</dict>
+</plist>
+"
+echo -e "${PLIST}" > "${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Info.plist"
+
+# action takes care of generating universal binaries if lipo is available
+# otherwise, it falls back to using a simple copy, expecting the first item in
+# the second parameter list to be the desired architecture
+function action()
+{
+	COMMAND=""
+
+	if [ -x "${HAS_LIPO}" ]; then
+		COMMAND="${HAS_LIPO} -create -o"
+		$HAS_LIPO -create -o "${1}" ${2} # make sure $2 is treated as a list of files
+	elif [ -x ${HAS_CP} ]; then
+		COMMAND="${HAS_CP}"
+		SRC="${2// */}" # in case there is a list here, use only the first item
+		$HAS_CP "${SRC}" "${1}"
+	else
+		"$0 cannot create an application bundle."
+		exit 1
+	fi
+
+	#echo "${COMMAND}" "${1}" "${2}"
+}
+
+#
+# the meat of universal binary creation
+# destination file names do not have architecture suffix.
+# action will handle merging universal binaries if supported.
+# symlink appropriate architecture names for universal (fat) binary support.
+#
+
+# executables
+action "${BUNDLEBINDIR}/${EXECUTABLE_NAME}"				"${IORTCW_CLIENT_ARCHS}"
+
+# renderers
+action "${BUNDLEBINDIR}/${RENDERER_OPENGL1_NAME}"		"${IORTCW_RENDERER_GL1_ARCHS}"
+action "${BUNDLEBINDIR}/${RENDERER_OPENGL2_NAME}"		"${IORTCW_RENDERER_GL2_ARCHS}"
+symlinkArch "${RENDERER_OPENGL}" "${RENDERER_OPENGL}" "_" "${BUNDLEBINDIR}"
+symlinkArch "${RENDERER_OPENGL2}" "${RENDERER_OPENGL2}" "_" "${BUNDLEBINDIR}"
+
+# game
+action "${BUNDLEBINDIR}/${BASEDIR}/${CGAME_NAME}"		"${IORTCW_CGAME_ARCHS}"
+action "${BUNDLEBINDIR}/${BASEDIR}/${GAME_NAME}"		"${IORTCW_GAME_ARCHS}"
+action "${BUNDLEBINDIR}/${BASEDIR}/${UI_NAME}"			"${IORTCW_UI_ARCHS}"
+symlinkArch "${CGAME}"	"${CGAME}."	""	"${BUNDLEBINDIR}/${BASEDIR}"
+symlinkArch "${GAME}"	"${GAME}."	""	"${BUNDLEBINDIR}/${BASEDIR}"
+symlinkArch "${UI}"		"${UI}."		""	"${BUNDLEBINDIR}/${BASEDIR}"
+
diff --git a/SP/make-macosx-ub.sh b/SP/make-macosx-ub.sh
index 2cefb0c..fe33fa4 100755
--- a/SP/make-macosx-ub.sh
+++ b/SP/make-macosx-ub.sh
@@ -1,73 +1,60 @@
-#!/bin/sh
+#!/bin/bash
 CC=gcc-4.0
-APPBUNDLE=iowolfsp.app
-BINARY=iowolfsp.ub
-PKGINFO=APPLIORTCW
-ICNS=misc/iortcw.icns
-DESTDIR=build/release-darwin-ub
-BASEDIR=main
-
-BIN_OBJ="
-	build/release-darwin-x86_64/iowolfsp.x86_64
-	build/release-darwin-x86/iowolfsp.x86
-	build/release-darwin-ppc/iowolfsp.ppc
-"
-BASE_OBJ="
-	build/release-darwin-x86_64/$BASEDIR/cgame.sp.x86_64.dylib
-	build/release-darwin-x86/$BASEDIR/cgame.sp.i386.dylib
-	build/release-darwin-ppc/$BASEDIR/cgame.sp.ppc.dylib
-	build/release-darwin-x86_64/$BASEDIR/ui.sp.x86_64.dylib
-	build/release-darwin-x86/$BASEDIR/ui.sp.i386.dylib
-	build/release-darwin-ppc/$BASEDIR/ui.sp.ppc.dylib
-	build/release-darwin-x86_64/$BASEDIR/qagame.sp.x86_64.dylib
-	build/release-darwin-x86/$BASEDIR/qagame.sp.i386.dylib
-	build/release-darwin-ppc/$BASEDIR/qagame.sp.ppc.dylib
-"
-RENDER_OBJ="
-	build/release-darwin-x86_64/renderer_sp_opengl1_x86_64.dylib
-	build/release-darwin-x86/renderer_sp_opengl1_i386.dylib
-	build/release-darwin-ppc/renderer_sp_opengl1_ppc.dylib
-	build/release-darwin-x86_64/renderer_sp_rend2_x86_64.dylib
-	build/release-darwin-x86/renderer_sp_rend2_i386.dylib
-	build/release-darwin-ppc/renderer_sp_rend2_ppc.dylib
-"
 
 cd `dirname $0`
 if [ ! -f Makefile ]; then
-	echo "This script must be run from the iowolfsp build directory"
+	echo "This script must be run from the iortcw build directory"
 	exit 1
 fi
 
-Q3_VERSION=`grep '^VERSION=' Makefile | sed -e 's/.*=\(.*\)/\1/'`
-
-# we want to use the oldest available SDK for max compatiblity. However 10.4 and older
+# we want to use the oldest available SDK for max compatibility. However 10.4 and older
 # can not build 64bit binaries, making 10.5 the minimum version.   This has been tested 
 # with xcode 3.1 (xcode31_2199_developerdvd.dmg).  It contains the 10.5 SDK and a decent
-# enough gcc to actually compile iowolfsp
-# For PPC macs, G4's or better are required to run iowolfsp.
+# enough gcc to actually compile iortcw
+# For PPC macs, G4's or better are required to run iortcw.
 
 unset X86_64_SDK
 unset X86_64_CFLAGS
+unset X86_64_MACOSX_VERSION_MIN
 unset X86_SDK
 unset X86_CFLAGS
+unset X86_MACOSX_VERSION_MIN
 unset PPC_SDK
 unset PPC_CFLAGS
+unset PPC_MACOSX_VERSION_MIN
 
 if [ -d /Developer/SDKs/MacOSX10.5.sdk ]; then
+	X86_64_SDK=/Developer/SDKs/MacOSX10.5.sdk
+	X86_64_CFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk"
+	X86_64_MACOSX_VERSION_MIN="10.5"
+
+	X86_SDK=/Developer/SDKs/MacOSX10.5.sdk
+	X86_CFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk"
+	X86_MACOSX_VERSION_MIN="10.5"
+
 	PPC_SDK=/Developer/SDKs/MacOSX10.5.sdk
-	PPC_CFLAGS="-arch ppc -isysroot /Developer/SDKs/MacOSX10.5.sdk"
+	PPC_CFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk"
+	PPC_MACOSX_VERSION_MIN="10.5"
 fi
 
+# SDL 2.0.5+ (x86, x86_64) only supports MacOSX 10.6 and later
 if [ -d /Developer/SDKs/MacOSX10.6.sdk ]; then
 	X86_64_SDK=/Developer/SDKs/MacOSX10.6.sdk
-	X86_64_CFLAGS="-arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk"
+	X86_64_CFLAGS="-isysroot /Developer/SDKs/MacOSX10.6.sdk"
+	X86_64_MACOSX_VERSION_MIN="10.6"
 
 	X86_SDK=/Developer/SDKs/MacOSX10.6.sdk
-	X86_CFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.6.sdk"
+	X86_CFLAGS="-isysroot /Developer/SDKs/MacOSX10.6.sdk"
+	X86_MACOSX_VERSION_MIN="10.6"
+else
+	# Don't try to compile with 10.5 version min
+	X86_64_SDK=
+	X86_SDK=
 fi
+# end SDL 2.0.5
 
 if [ -z $X86_64_SDK ] || [ -z $X86_SDK ] || [ -z $PPC_SDK ]; then
-       echo "\
+	echo "\
 ERROR: This script is for building a Universal Binary.  You cannot build
        for a different architecture unless you have the proper Mac OS X SDKs
        installed.  If you just want to to compile for your own system run
@@ -76,105 +63,45 @@ ERROR: This script is for building a Universal Binary.  You cannot build
        In order to build a binary with maximum compatibility you must
        build on Mac OS X 10.6 and have the MacOSX10.5 and MacOSX10.6
        SDKs installed from the Xcode install disk Packages folder."
-       exit 1
+
+	exit 1
 fi
 
-echo "Building X86_64 Client against \"$X86_64_SDK\""
-echo "Building X86 Client against \"$X86_SDK\""
-echo "Building PPC Client against \"$PPC_SDK\""
+echo "Building X86_64 Client/Dedicated Server against \"$X86_64_SDK\""
+echo "Building X86 Client/Dedicated Server against \"$X86_SDK\""
+echo "Building PPC Client/Dedicated Server against \"$PPC_SDK\""
 echo
 
-if [ ! -d $DESTDIR ]; then
-	mkdir -p $DESTDIR
-fi
-
 # For parallel make on multicore boxes...
 NCPU=`sysctl -n hw.ncpu`
 
-# x86_64 client
-if [ -d build/release-release-x86_64 ]; then
-	rm -r build/release-darwin-x86_64
-fi
-(ARCH=x86_64 CC=gcc-4.0 CFLAGS=$X86_64_CFLAGS make -j$NCPU) || exit 1;
+# x86_64 client and server
+#if [ -d build/release-release-x86_64 ]; then
+#	rm -r build/release-darwin-x86_64
+#fi
+(ARCH=x86_64 CC=gcc-4.0 CFLAGS=$X86_64_CFLAGS MACOSX_VERSION_MIN=$X86_64_MACOSX_VERSION_MIN make -j$NCPU) || exit 1;
 
 echo;echo
 
-# x86 client
-if [ -d build/release-darwin-x86 ]; then
-	rm -r build/release-darwin-x86
-fi
-(ARCH=x86 CC=gcc-4.0 CFLAGS=$X86_CFLAGS make -j$NCPU) || exit 1;
+# x86 client and server
+#if [ -d build/release-darwin-x86 ]; then
+#	rm -r build/release-darwin-x86
+#fi
+(ARCH=x86 CC=gcc-4.0 CFLAGS=$X86_CFLAGS MACOSX_VERSION_MIN=$X86_MACOSX_VERSION_MIN make -j$NCPU) || exit 1;
 
 echo;echo
 
-# PPC client
-if [ -d build/release-darwin-ppc ]; then
-	rm -r build/release-darwin-ppc
-fi
-(ARCH=ppc CC=gcc-4.0 CFLAGS=$PPC_CFLAGS make -j$NCPU) || exit 1;
-
-echo;echo
+# PPC client and server
+#if [ -d build/release-darwin-ppc ]; then
+#	rm -r build/release-darwin-ppc
+#fi
+(ARCH=ppc CC=gcc-4.0 CFLAGS=$PPC_CFLAGS MACOSX_VERSION_MIN=$PPC_MACOSX_VERSION_MIN make -j$NCPU) || exit 1;
 
-echo "Creating .app bundle $DESTDIR/$APPBUNDLE"
-if [ ! -d $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR ]; then
-	mkdir -p $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR || exit 1;
-fi
-if [ ! -d $DESTDIR/$APPBUNDLE/Contents/Resources ]; then
-	mkdir -p $DESTDIR/$APPBUNDLE/Contents/Resources
-fi
-cp $ICNS $DESTDIR/$APPBUNDLE/Contents/Resources/iortcw.icns || exit 1;
-echo $PKGINFO > $DESTDIR/$APPBUNDLE/Contents/PkgInfo
-echo "
-	<?xml version=\"1.0\" encoding=\"UTF-8\"?>
-	<!DOCTYPE plist
-		PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\"
-		\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
-	<plist version=\"1.0\">
-	<dict>
-		<key>LSMinimumSystemVersion</key>
-		<string>10.5.0</string>
-		<key>LSMinimumSystemVersionByArchitecture</key>
-		<dict>
-			<key>i386</key>
-			<string>10.6.0</string>
-			<key>x86_64</key>
-			<string>10.6.0</string>
-		</dict>
-		<key>CFBundleDevelopmentRegion</key>
-		<string>English</string>
-		<key>CFBundleExecutable</key>
-		<string>$BINARY</string>
-		<key>CFBundleGetInfoString</key>
-		<string>iowolfsp $Q3_VERSION</string>
-		<key>CFBundleIconFile</key>
-		<string>iortcw.icns</string>
-		<key>CFBundleIdentifier</key>
-		<string>org.iortcw</string>
-		<key>CFBundleInfoDictionaryVersion</key>
-		<string>6.0</string>
-		<key>CFBundleName</key>
-		<string>iowolfsp</string>
-		<key>CFBundlePackageType</key>
-		<string>APPL</string>
-		<key>CFBundleShortVersionString</key>
-		<string>$Q3_VERSION</string>
-		<key>CFBundleSignature</key>
-		<string>$PKGINFO</string>
-		<key>CFBundleVersion</key>
-		<string>$Q3_VERSION</string>
-		<key>NSExtensions</key>
-		<dict/>
-		<key>NSPrincipalClass</key>
-		<string>NSApplication</string>
-	</dict>
-	</plist>
-	" > $DESTDIR/$APPBUNDLE/Contents/Info.plist
-
-
-# Make UB's from previous builds of x86, x86_64 and ppc binaries
-lipo -create -o $DESTDIR/$APPBUNDLE/Contents/MacOS/$BINARY $BIN_OBJ
-
-cp $RENDER_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/
-cp $BASE_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR/
-cp code/libs/macosx/*.dylib $DESTDIR/$APPBUNDLE/Contents/MacOS/
+echo
 
+# use the following shell script to build a universal application bundle
+export MACOSX_DEPLOYMENT_TARGET="10.5"
+export MACOSX_DEPLOYMENT_TARGET_PPC="$PPC_MACOSX_VERSION_MIN"
+export MACOSX_DEPLOYMENT_TARGET_X86="$X86_MACOSX_VERSION_MIN"
+export MACOSX_DEPLOYMENT_TARGET_X86_64="$X86_64_MACOSX_VERSION_MIN"
+"./make-macosx-app.sh" release
diff --git a/SP/make-macosx.sh b/SP/make-macosx.sh
new file mode 100755
index 0000000..68b1500
--- /dev/null
+++ b/SP/make-macosx.sh
@@ -0,0 +1,94 @@
+#!/bin/bash
+#
+
+# Let's make the user give us a target build system
+
+if [ $# -ne 1 ]; then
+	echo "Usage:   $0 target_architecture"
+	echo "Example: $0 x86"
+	echo "other valid options are x86_64, ppc or arm64"
+	echo
+	echo "If you don't know or care about architectures please consider using make-macosx-ub.sh instead of this script."
+	exit 1
+fi
+
+if [ "$1" == "x86" ]; then
+	BUILDARCH=x86
+elif [ "$1" == "x86_64" ]; then
+	BUILDARCH=x86_64
+elif [ "$1" == "ppc" ]; then
+	BUILDARCH=ppc
+elif [ "$1" == "arm64" ]; then
+	BUILDARCH=arm64
+else
+	echo "Invalid architecture: $1"
+	echo "Valid architectures are x86, x86_64, ppc or arm64"
+	exit 1
+fi
+
+CC=gcc-4.0
+DESTDIR=build/release-darwin-${BUILDARCH}
+
+cd `dirname $0`
+if [ ! -f Makefile ]; then
+	echo "This script must be run from the iortcw build directory"
+	exit 1
+fi
+
+# we want to use the oldest available SDK for max compatibility. However 10.4 and older
+# can not build 64bit binaries, making 10.5 the minimum version.   This has been tested
+# with xcode 3.1 (xcode31_2199_developerdvd.dmg).  It contains the 10.5 SDK and a decent
+# enough gcc to actually compile iortcw
+# For PPC macs, G4's or better are required to run iortcw.
+
+unset ARCH_SDK
+unset ARCH_CFLAGS
+unset ARCH_MACOSX_VERSION_MIN
+
+MACOS_VERSION=$(sw_vers -productVersion)
+MACOS_MAJOR_VER=$(echo $MACOS_VERSION | awk -F. '{print $1}')
+MACOS_MINOR_VER=$(echo $MACOS_VERSION | awk -F. '{print $2}')
+
+# SDL 2.0.1 (ppc) supports MacOSX 10.5
+# SDL 2.0.5+ (x86, x86_64) supports MacOSX 10.6 and later
+if [ $BUILDARCH = "ppc" ]; then
+	if [ -d /Developer/SDKs/MacOSX10.5.sdk ]; then
+		ARCH_SDK=/Developer/SDKs/MacOSX10.5.sdk
+		ARCH_CFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk"
+	fi
+	ARCH_MACOSX_VERSION_MIN="10.5"
+elif [ -d /Developer/SDKs/MacOSX10.6.sdk ]; then
+	ARCH_SDK=/Developer/SDKs/MacOSX10.6.sdk
+	ARCH_CFLAGS="-isysroot /Developer/SDKs/MacOSX10.6.sdk"
+	ARCH_MACOSX_VERSION_MIN="10.6"
+elif [ $MACOS_MAJOR_VER == 10 ] && [ $MACOS_MINOR_VER >= 9 ] || [ $MACOS_MAJOR_VER > 10 ]; then
+	ARCH_MACOSX_VERSION_MIN="10.9"
+else
+	ARCH_MACOSX_VERSION_MIN="10.7"
+fi
+
+
+echo "Building ${BUILDARCH} Client/Dedicated Server against \"$ARCH_SDK\""
+sleep 3
+
+if [ ! -d $DESTDIR ]; then
+	mkdir -p $DESTDIR
+fi
+
+# For parallel make on multicore boxes...
+NCPU=`sysctl -n hw.ncpu`
+
+
+# intel client and server
+#if [ -d build/release-darwin-${BUILDARCH} ]; then
+#	rm -r build/release-darwin-${BUILDARCH}
+#fi
+(ARCH=${BUILDARCH} CFLAGS=$ARCH_CFLAGS MACOSX_VERSION_MIN=$ARCH_MACOSX_VERSION_MIN make -j$NCPU) || exit 1;
+
+# use the following shell script to build an application bundle
+export MACOSX_DEPLOYMENT_TARGET="${ARCH_MACOSX_VERSION_MIN}"
+export MACOSX_DEPLOYMENT_TARGET_PPC=
+export MACOSX_DEPLOYMENT_TARGET_X86=
+export MACOSX_DEPLOYMENT_TARGET_X86_64=
+export MACOSX_DEPLOYMENT_TARGET_ARM64=
+"./make-macosx-app.sh" release ${BUILDARCH}
diff --git a/SP/make-macosx_xcode3.sh b/SP/make-macosx_xcode3.sh
deleted file mode 100755
index 6283fc3..0000000
--- a/SP/make-macosx_xcode3.sh
+++ /dev/null
@@ -1,147 +0,0 @@
-#!/bin/sh
-#
-
-# Lets make the user give us a target build system
-
-if [ $# -ne 1 ]; then
-	echo "Usage:   $0 target_architecture"
-	echo "Example: $0 x86"
-	echo "other valid options are x86_64 or ppc"
-	echo
-	echo "If you don't know or care about architectures please consider using make-macosx-ub.sh instead of this script."
-	exit 1
-fi
-
-if [ "$1" == "x86" ]; then
-	BUILDARCH=x86
-	ARCH=i386
-elif [ "$1" == "x86_64" ]; then
-	BUILDARCH=x86_64
-	ARCH=x86_64
-elif [ "$1" == "ppc" ]; then
-	BUILDARCH=ppc
-	ARCH=ppc
-else
-	echo "Invalid architecture: $1"
-	echo "Valid architectures are x86, x86_64 or ppc"
-	exit 1
-fi
-
-CC=gcc-4.0
-CXX=g++-4.0
-APPBUNDLE=iowolfsp.app
-BINARY=iowolfsp.${ARCH}
-PKGINFO=APPLIOTCW
-ICNS=misc/iortcw.icns
-DESTDIR=build/release-darwin-${BUILDARCH}
-BASEDIR=main
-
-BIN_OBJ="
-	build/release-darwin-${BUILDARCH}/iowolfsp.${BUILDARCH}
-"
-BASE_OBJ="
-	build/release-darwin-${BUILDARCH}/$BASEDIR/cgame.sp.${ARCH}.dylib
-	build/release-darwin-${BUILDARCH}/$BASEDIR/ui.sp.${ARCH}.dylib
-	build/release-darwin-${BUILDARCH}/$BASEDIR/qagame.sp.${ARCH}.dylib
-"
-RENDER_OBJ="
-	build/release-darwin-${BUILDARCH}/renderer_sp_opengl1_${ARCH}.dylib
-	build/release-darwin-${BUILDARCH}/renderer_sp_rend2_${ARCH}.dylib
-"
-
-cd `dirname $0`
-if [ ! -f Makefile ]; then
-	echo "This script must be run from the iowolfsp build directory"
-	exit 1
-fi
-
-Q3_VERSION=`grep '^VERSION=' Makefile | sed -e 's/.*=\(.*\)/\1/'`
-
-# We only care if we're >= 10.4, not if we're specifically Tiger.
-# "8" is the Darwin major kernel version.
-TIGERHOST=`uname -r |perl -w -p -e 's/\A(\d+)\..*\Z/$1/; $_ = (($_ >= 8) ? "1" : "0");'`
-
-# we want to use the oldest available SDK for max compatiblity. However 10.4 and older
-# can not build 64bit binaries, making 10.5 the minimum version.   This has been tested 
-# with xcode 3.1 (xcode31_2199_developerdvd.dmg).  It contains the 10.5 SDK and a decent
-# enough gcc to actually compile iowolfsp
-# For PPC macs, G4's or better are required to run iowolfsp.
-
-unset ARCH_SDK
-unset ARCH_CFLAGS
-
-if [ -d /Developer/SDKs/MacOSX10.5.sdk ]; then
-	ARCH_SDK=/Developer/SDKs/MacOSX10.5.sdk
-	ARCH_CFLAGS="-arch ${ARCH} -isysroot /Developer/SDKs/MacOSX10.5.sdk"
-fi
-
-
-echo "Building ${BUILDARCH} Client/Dedicated Server against \"$ARCH_SDK\""
-sleep 3
-
-if [ ! -d $DESTDIR ]; then
-	mkdir -p $DESTDIR
-fi
-
-# For parallel make on multicore boxes...
-NCPU=`sysctl -n hw.ncpu`
-
-
-# intel client and server
-if [ -d build/release-darwin-${BUILDARCH} ]; then
-	rm -r build/release-darwin-${BUILDARCH}
-fi
-(CC=${CC} CXX=${CXX} ARCH=${BUILDARCH} CFLAGS=$ARCH_CFLAGS make -j$NCPU) || exit 1;
-
-echo "Creating .app bundle $DESTDIR/$APPBUNDLE"
-if [ ! -d $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR ]; then
-	mkdir -p $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR || exit 1;
-fi
-if [ ! -d $DESTDIR/$APPBUNDLE/Contents/Resources ]; then
-	mkdir -p $DESTDIR/$APPBUNDLE/Contents/Resources
-fi
-cp $ICNS $DESTDIR/$APPBUNDLE/Contents/Resources/iortcw.icns || exit 1;
-echo $PKGINFO > $DESTDIR/$APPBUNDLE/Contents/PkgInfo
-echo "
-	<?xml version=\"1.0\" encoding=\"UTF-8\"?>
-	<!DOCTYPE plist
-		PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\"
-		\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
-	<plist version=\"1.0\">
-	<dict>
-		<key>CFBundleDevelopmentRegion</key>
-		<string>English</string>
-		<key>CFBundleExecutable</key>
-		<string>$BINARY</string>
-		<key>CFBundleGetInfoString</key>
-		<string>iowolfsp $Q3_VERSION</string>
-		<key>CFBundleIconFile</key>
-		<string>iortcw.icns</string>
-		<key>CFBundleIdentifier</key>
-		<string>org.ioquake.iortcw</string>
-		<key>CFBundleInfoDictionaryVersion</key>
-		<string>6.0</string>
-		<key>CFBundleName</key>
-		<string>iowolfsp</string>
-		<key>CFBundlePackageType</key>
-		<string>APPL</string>
-		<key>CFBundleShortVersionString</key>
-		<string>$Q3_VERSION</string>
-		<key>CFBundleSignature</key>
-		<string>$PKGINFO</string>
-		<key>CFBundleVersion</key>
-		<string>$Q3_VERSION</string>
-		<key>NSExtensions</key>
-		<dict/>
-		<key>NSPrincipalClass</key>
-		<string>NSApplication</string>
-	</dict>
-	</plist>
-	" > $DESTDIR/$APPBUNDLE/Contents/Info.plist
-
-
-cp $BIN_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$BINARY
-cp $RENDER_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/
-cp $BASE_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR/
-cp code/libs/macosx/*.dylib $DESTDIR/$APPBUNDLE/Contents/MacOS/
-cp code/libs/macosx/*.dylib $DESTDIR
diff --git a/SP/make-macosx_xcode4.sh b/SP/make-macosx_xcode4.sh
deleted file mode 100755
index 7ee78e3..0000000
--- a/SP/make-macosx_xcode4.sh
+++ /dev/null
@@ -1,130 +0,0 @@
-#!/bin/sh
-#
-
-# Lets make the user give us a target build system
-
-if [ $# -ne 1 ]; then
-	echo "Usage:   $0 target_architecture"
-	echo "Example: $0 x86"
-	echo "The other valid option is x86_64"
-	echo
-	echo "If you don't know or care about architectures please consider using make-macosx-ub.sh instead of this script."
-	exit 1
-fi
-
-if [ "$1" == "x86" ]; then
-	BUILDARCH=x86
-	ARCH=i386
-elif [ "$1" == "x86_64" ]; then
-	BUILDARCH=x86_64
-	ARCH=x86_64
-else
-	echo "Invalid architecture: $1"
-	echo "Valid architectures are x86, x86_64"
-	exit 1
-fi
-
-CC=gcc
-CXX=g++
-APPBUNDLE=iowolfsp.app
-BINARY=iowolfsp.${ARCH}
-PKGINFO=APPLIOTCW
-ICNS=misc/iortcw.icns
-DESTDIR=build/release-darwin-${BUILDARCH}
-BASEDIR=main
-
-BIN_OBJ="
-	build/release-darwin-${BUILDARCH}/iowolfsp.${BUILDARCH}
-"
-BASE_OBJ="
-	build/release-darwin-${BUILDARCH}/$BASEDIR/cgame.sp.${ARCH}.dylib
-	build/release-darwin-${BUILDARCH}/$BASEDIR/ui.sp.${ARCH}.dylib
-	build/release-darwin-${BUILDARCH}/$BASEDIR/qagame.sp.${ARCH}.dylib
-"
-RENDER_OBJ="
-	build/release-darwin-${BUILDARCH}/renderer_sp_opengl1_${ARCH}.dylib
-	build/release-darwin-${BUILDARCH}/renderer_sp_rend2_${ARCH}.dylib
-"
-
-cd `dirname $0`
-if [ ! -f Makefile ]; then
-	echo "This script must be run from the iowolfsp build directory"
-	exit 1
-fi
-
-Q3_VERSION=`grep '^VERSION=' Makefile | sed -e 's/.*=\(.*\)/\1/'`
-
-# We only care if we're >= 10.4, not if we're specifically Tiger.
-# "8" is the Darwin major kernel version.
-TIGERHOST=`uname -r |perl -w -p -e 's/\A(\d+)\..*\Z/$1/; $_ = (($_ >= 8) ? "1" : "0");'`
-
-unset ARCH_CFLAGS
-
-ARCH_CFLAGS="-arch ${ARCH}"
-
-if [ ! -d $DESTDIR ]; then
-	mkdir -p $DESTDIR
-fi
-
-# For parallel make on multicore boxes...
-NCPU=`sysctl -n hw.ncpu`
-
-
-# intel client and server
-if [ -d build/release-darwin-${BUILDARCH} ]; then
-	rm -r build/release-darwin-${BUILDARCH}
-fi
-(CC=${CC} CXX=${CXX} ARCH=${BUILDARCH} CFLAGS=$ARCH_CFLAGS make -j$NCPU) || exit 1;
-
-echo "Creating .app bundle $DESTDIR/$APPBUNDLE"
-if [ ! -d $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR ]; then
-	mkdir -p $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR || exit 1;
-fi
-if [ ! -d $DESTDIR/$APPBUNDLE/Contents/Resources ]; then
-	mkdir -p $DESTDIR/$APPBUNDLE/Contents/Resources
-fi
-cp $ICNS $DESTDIR/$APPBUNDLE/Contents/Resources/iortcw.icns || exit 1;
-echo $PKGINFO > $DESTDIR/$APPBUNDLE/Contents/PkgInfo
-echo "
-	<?xml version=\"1.0\" encoding=\"UTF-8\"?>
-	<!DOCTYPE plist
-		PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\"
-		\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
-	<plist version=\"1.0\">
-	<dict>
-		<key>CFBundleDevelopmentRegion</key>
-		<string>English</string>
-		<key>CFBundleExecutable</key>
-		<string>$BINARY</string>
-		<key>CFBundleGetInfoString</key>
-		<string>iowolfsp $Q3_VERSION</string>
-		<key>CFBundleIconFile</key>
-		<string>iortcw.icns</string>
-		<key>CFBundleIdentifier</key>
-		<string>org.ioquake.iortcw</string>
-		<key>CFBundleInfoDictionaryVersion</key>
-		<string>6.0</string>
-		<key>CFBundleName</key>
-		<string>iowolfsp</string>
-		<key>CFBundlePackageType</key>
-		<string>APPL</string>
-		<key>CFBundleShortVersionString</key>
-		<string>$Q3_VERSION</string>
-		<key>CFBundleSignature</key>
-		<string>$PKGINFO</string>
-		<key>CFBundleVersion</key>
-		<string>$Q3_VERSION</string>
-		<key>NSExtensions</key>
-		<dict/>
-		<key>NSPrincipalClass</key>
-		<string>NSApplication</string>
-	</dict>
-	</plist>
-	" > $DESTDIR/$APPBUNDLE/Contents/Info.plist
-
-
-cp $BIN_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$BINARY
-cp $RENDER_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/
-cp $BASE_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR/
-cp code/libs/macosx/*.dylib $DESTDIR/$APPBUNDLE/Contents/MacOS/
-cp code/libs/macosx/*.dylib $DESTDIR
diff --git a/SP/make-macosx_xcode5.sh b/SP/make-macosx_xcode5.sh
deleted file mode 100755
index a9d06c4..0000000
--- a/SP/make-macosx_xcode5.sh
+++ /dev/null
@@ -1,130 +0,0 @@
-#!/bin/sh
-#
-
-# Lets make the user give us a target build system
-
-if [ $# -ne 1 ]; then
-	echo "Usage:   $0 target_architecture"
-	echo "Example: $0 x86"
-	echo "The other valid option is x86_64"
-	echo
-	echo "If you don't know or care about architectures please consider using make-macosx-ub.sh instead of this script."
-	exit 1
-fi
-
-if [ "$1" == "x86" ]; then
-	BUILDARCH=x86
-	ARCH=i386
-elif [ "$1" == "x86_64" ]; then
-	BUILDARCH=x86_64
-	ARCH=x86_64
-else
-	echo "Invalid architecture: $1"
-	echo "Valid architectures are x86, x86_64"
-	exit 1
-fi
-
-CC=clang
-CXX=clang++
-APPBUNDLE=iowolfsp.app
-BINARY=iowolfsp.${ARCH}
-PKGINFO=APPLIOTCW
-ICNS=misc/iortcw.icns
-DESTDIR=build/release-darwin-${BUILDARCH}
-BASEDIR=main
-
-BIN_OBJ="
-	build/release-darwin-${BUILDARCH}/iowolfsp.${BUILDARCH}
-"
-BASE_OBJ="
-	build/release-darwin-${BUILDARCH}/$BASEDIR/cgame.sp.${ARCH}.dylib
-	build/release-darwin-${BUILDARCH}/$BASEDIR/ui.sp.${ARCH}.dylib
-	build/release-darwin-${BUILDARCH}/$BASEDIR/qagame.sp.${ARCH}.dylib
-"
-RENDER_OBJ="
-	build/release-darwin-${BUILDARCH}/renderer_sp_opengl1_${ARCH}.dylib
-	build/release-darwin-${BUILDARCH}/renderer_sp_rend2_${ARCH}.dylib
-"
-
-cd `dirname $0`
-if [ ! -f Makefile ]; then
-	echo "This script must be run from the iowolfsp build directory"
-	exit 1
-fi
-
-Q3_VERSION=`grep '^VERSION=' Makefile | sed -e 's/.*=\(.*\)/\1/'`
-
-# We only care if we're >= 10.4, not if we're specifically Tiger.
-# "8" is the Darwin major kernel version.
-TIGERHOST=`uname -r |perl -w -p -e 's/\A(\d+)\..*\Z/$1/; $_ = (($_ >= 8) ? "1" : "0");'`
-
-unset ARCH_CFLAGS
-
-ARCH_CFLAGS="-arch ${ARCH}"
-
-if [ ! -d $DESTDIR ]; then
-	mkdir -p $DESTDIR
-fi
-
-# For parallel make on multicore boxes...
-NCPU=`sysctl -n hw.ncpu`
-
-
-# intel client and server
-if [ -d build/release-darwin-${BUILDARCH} ]; then
-	rm -r build/release-darwin-${BUILDARCH}
-fi
-(CC=${CC} CXX=${CXX} ARCH=${BUILDARCH} CFLAGS=$ARCH_CFLAGS make -j$NCPU) || exit 1;
-
-echo "Creating .app bundle $DESTDIR/$APPBUNDLE"
-if [ ! -d $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR ]; then
-	mkdir -p $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR || exit 1;
-fi
-if [ ! -d $DESTDIR/$APPBUNDLE/Contents/Resources ]; then
-	mkdir -p $DESTDIR/$APPBUNDLE/Contents/Resources
-fi
-cp $ICNS $DESTDIR/$APPBUNDLE/Contents/Resources/iortcw.icns || exit 1;
-echo $PKGINFO > $DESTDIR/$APPBUNDLE/Contents/PkgInfo
-echo "
-	<?xml version=\"1.0\" encoding=\"UTF-8\"?>
-	<!DOCTYPE plist
-		PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\"
-		\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
-	<plist version=\"1.0\">
-	<dict>
-		<key>CFBundleDevelopmentRegion</key>
-		<string>English</string>
-		<key>CFBundleExecutable</key>
-		<string>$BINARY</string>
-		<key>CFBundleGetInfoString</key>
-		<string>iowolfsp $Q3_VERSION</string>
-		<key>CFBundleIconFile</key>
-		<string>iortcw.icns</string>
-		<key>CFBundleIdentifier</key>
-		<string>org.ioquake.iortcw</string>
-		<key>CFBundleInfoDictionaryVersion</key>
-		<string>6.0</string>
-		<key>CFBundleName</key>
-		<string>iowolfsp</string>
-		<key>CFBundlePackageType</key>
-		<string>APPL</string>
-		<key>CFBundleShortVersionString</key>
-		<string>$Q3_VERSION</string>
-		<key>CFBundleSignature</key>
-		<string>$PKGINFO</string>
-		<key>CFBundleVersion</key>
-		<string>$Q3_VERSION</string>
-		<key>NSExtensions</key>
-		<dict/>
-		<key>NSPrincipalClass</key>
-		<string>NSApplication</string>
-	</dict>
-	</plist>
-	" > $DESTDIR/$APPBUNDLE/Contents/Info.plist
-
-
-cp $BIN_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$BINARY
-cp $RENDER_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/
-cp $BASE_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR/
-cp code/libs/macosx/*.dylib $DESTDIR/$APPBUNDLE/Contents/MacOS/
-cp code/libs/macosx/*.dylib $DESTDIR
diff --git a/SP/media/scripts/characters.mtr b/SP/media/scripts/characters.mtr
new file mode 100644
index 0000000..82615b7
--- /dev/null
+++ b/SP/media/scripts/characters.mtr
@@ -0,0 +1,3879 @@
+//models/players/zombie/sk_bod1
+//{
+//	picmip2
+//    {
+//       	map models/players/zombie/sk_bod1.tga
+//		rgbGen lightingdiffuse
+ //   }
+//}
+////bj/////
+models/players/Bj/bj_body1
+{
+	picmip2
+	{
+		map models/players/Bj/bj_body1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/Bj/bj_head1
+{
+	picmip2
+	{
+		map models/players/Bj/bj_head1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/Bj/bj_head1_blink
+{
+	picmip2
+	{
+		map models/players/Bj/bj_head1_blink.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/Bj/bj_legs1
+{
+	picmip2
+	{
+		map models/players/Bj/bj_legs1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/Bj/acc/bj_eq1
+{
+	picmip2
+	{
+		map models/players/Bj/acc/bj_eq1.tga
+		rgbGen lightingDiffuse
+	}
+}
+////blackguard////
+
+
+models/players/blackguard/acc/bg_bp
+{
+	picmip2
+	{
+		map models/players/blackguard/acc/bg_bp.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/blackguard/acc/bg_glass
+{
+	picmip2
+	sort 5
+	{
+		map models/players/blackguard/acc/bg_glass.tga
+		blendfunc blend
+		rgbGen lightingDiffuse
+	}
+}
+models/players/blackguard/acc/bg_helmut1
+{
+	picmip2
+	{
+		map models/players/blackguard/acc/bg_helmut1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/blackguard/acc/bg_helmutcam
+{
+	picmip2
+	{
+		map models/players/blackguard/acc/bg_helmutcam.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/blackguard/acc/bg_helmutswf1
+{
+	picmip2
+	{
+		map models/players/blackguard/acc/bg_helmutswf1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/blackguard/acc/cap
+{
+	picmip2
+	{
+		map models/players/blackguard/acc/cap.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/blackguard/acc/capswf
+{
+	picmip2
+	{
+		map models/players/blackguard/acc/capswf.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/blackguard/acc/snow_bp1
+{
+	picmip2
+	{
+		map models/players/blackguard/acc/snow_bp1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/blackguard/acc/snow_glass1
+{
+	picmip2
+	sort 5
+	{
+		map models/players/blackguard/acc/snow_glass1.tga
+		blendfunc blend
+		rgbGen lightingDiffuse
+	}
+}
+models/players/blackguard/acc/snow_helmut1
+{
+	picmip2
+	{
+		map models/players/blackguard/acc/snow_helmut1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/blackguard/bg_body1
+{
+	picmip2
+	{
+		map models/players/blackguard/bg_body1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/blackguard/bg_body2
+{
+	picmip2
+	{
+		map models/players/blackguard/bg_body2.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/blackguard/bg_bodycam1
+{
+	picmip2
+	{
+		map models/players/blackguard/bg_bodycam1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/blackguard/bg_bodycas1
+{
+	picmip2
+	{
+		map models/players/blackguard/bg_bodycas1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/blackguard/bg_bodyswf1
+{
+	picmip2
+	{
+		map models/players/blackguard/bg_bodyswf1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+
+models/players/blackguard/bg_boot1
+{
+	picmip2
+	{
+		map models/players/blackguard/bg_boot1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/blackguard/bg_bootcam
+{
+	picmip2
+	{
+		map models/players/blackguard/bg_bootcam.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/blackguard/bg_bootcas
+{
+	picmip2
+	{
+		map models/players/blackguard/bg_bootcas.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/blackguard/bg_head1
+{
+	picmip2
+	{
+		map models/players/blackguard/bg_head1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/blackguard/bg_head1_blink
+{
+	picmip2
+	{
+		map models/players/blackguard/bg_head1_blink.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+	}
+}
+models/players/blackguard/bg_head2_blink
+{
+	picmip2
+	{
+		map models/players/blackguard/bg_head2_blink.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/blackguard/bg_head2
+{
+	picmip2
+	{
+		map models/players/blackguard/bg_head2.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/blackguard/bg_head3
+{
+	picmip2
+	{
+		map models/players/blackguard/bg_head3.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/blackguard/bg_head4
+{
+	picmip2
+	{
+		map models/players/blackguard/bg_head4.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/blackguard/bg_head5
+{
+	picmip2
+	{
+		map models/players/blackguard/bg_head5.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/blackguard/bg_head6
+{
+	picmip2
+	{
+		map models/players/blackguard/bg_head6.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/blackguard/bg_head7											
+{
+	picmip2
+	{
+		map models/players/blackguard/bg_head7.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/blackguard/bg_head8
+{
+	picmip2
+	{
+		map models/players/blackguard/bg_head8.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/blackguard/bg_headcas1
+{
+	picmip2
+	{
+		map models/players/blackguard/bg_headcas1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/blackguard/bg_headcas2
+{
+	picmip2
+	{
+		map models/players/blackguard/bg_headcas2.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/blackguard/bg_headcas3
+{
+	picmip2
+	{
+		map models/players/blackguard/bg_headcas3.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/blackguard/bg_head3_blink
+{
+	picmip2
+	{
+		map models/players/blackguard/bg_head3_blink.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/blackguard/snow_body1
+{
+	picmip2
+	{
+		map models/players/blackguard/snow_body1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/blackguard/snow_boot1
+{
+	picmip2
+	{
+		map models/players/blackguard/snow_boot1.tga
+		rgbGen lightingDiffuse
+	}
+}
+////deathshead////
+models/players/deathshead1/dh_head1
+{
+	picmip2
+	{
+		map models/players/deathshead1/dh_head1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/deathshead1/dh_head1_blink
+{
+	picmip2
+	{
+		map models/players/deathshead1/dh_head1_blink.tga
+		alphaFunc GE128
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/deathshead1/dh_mon
+{
+	picmip2
+	{
+		map models/players/deathshead1/dh_mon.tga
+		blendfunc blend
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/deathshead1/lab_body1
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/deathshead1/lab_body1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/deathshead1/lab_legs1
+{
+	picmip2
+	{
+		map models/players/deathshead1/lab_legs1.tga
+		rgbGen lightingDiffuse
+	}
+}
+////director/////
+models/players/director/dir_body1
+{
+	picmip2
+	{
+		map models/players/director/dir_body1.tga
+		rgbGen lightingDiffuse
+	}
+}
+////himmler//
+models/players/himmler/him_head_blink
+{
+	picmip2
+	{
+		map models/players/himmler/him_head_blink.tga
+		alphaFunc GE128
+		rgbGen lightingDiffuse
+	}
+}
+
+
+models/players/himmler/him_glasses
+{
+	picmip2
+	cull twosided
+	//sort 5
+	{
+		map models/players/himmler/him_glasses.tga
+		blendfunc blend
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/director/dir_glasses
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/director/dir_glasses.tga
+		blendfunc blend
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/director/dir_head1
+{
+	picmip2
+	{
+		map models/players/director/dir_head1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/director/dir_head_blink
+{
+	picmip2
+	{
+		map models/players/director/dir_head_blink.tga
+		alphaFunc GE128
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/director/dir_legs1
+{
+	picmip2
+	{
+		map models/players/director/dir_legs1.tga
+		rgbGen lightingDiffuse
+	}
+}
+///drz////
+models/players/drz/drz_body1
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/drz/drz_body1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/drz/drz_swfbody1
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/drz/drz_swfbody1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/drz/drz_xbody1
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/drz/drz_xbody1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/drz/drz_glass
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/drz/drz_glass.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen lightingdiffuse
+	}
+	{
+		map models/players/drz/escape_env.tga
+		blendFunc GL_ONE_MINUS_DST_ALPHA GL_ONE
+		tcMod Scale 2 2   
+		tcGen environment
+	}
+}
+
+models/players/drz/drz_goggles
+{
+	picmip2
+	{
+		map models/players/drz/drz_goggles.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/drz/drz_head1
+{
+	picmip2
+	{
+		map models/players/drz/drz_head1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/drz/drz_head2
+{
+	picmip2
+	{
+		map models/players/drz/drz_head2.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/drz/drz_head4
+{
+	picmip2
+	{
+		map models/players/drz/drz_head4.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/drz/drz_head_blink
+{
+	picmip2
+	{
+		map models/players/drz/drz_head_blink.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/drz/drz_head5
+{
+	picmip2
+	{
+		map models/players/drz/drz_head5.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+//models/players/drz/drz_head5_blink
+//{
+//	picmip2
+//	{
+//		map models/players/drz/drz_head5_blink.tga
+//		rgbGen lightingDiffuse
+//	}
+//}
+
+models/players/drz/drz_head6
+{
+	picmip2
+	{
+		map models/players/drz/drz_head6.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/drz/drz_head6_blink
+{
+	picmip2
+	{
+		map models/players/drz/drz_head6_blink.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/drz/drz_head7
+{
+	picmip2
+	{
+		map models/players/drz/drz_head7.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/drz/drz_head8
+{
+	picmip2
+	{
+		map models/players/drz/drz_head8.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/drz/drz_legs1
+{
+	picmip2
+	{
+		map models/players/drz/drz_legs1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/drz/drz_rockbody1
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/drz/drz_rockbody1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/drz/drz_rocklegs1
+{
+	picmip2
+	{
+		map models/players/drz/drz_rocklegs1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/drz/drz_xlegs1
+{
+	picmip2
+	{
+		map models/players/drz/drz_xlegs1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/drz/escape_env
+{
+	picmip2
+	{
+		map models/players/drz/escape_env.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/drz/vin_head1
+{
+	picmip2
+	{
+		map models/players/drz/vin_head1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/drz/vin_body1
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/drz/vin_body1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/drz/vin_legs1
+{
+	picmip2
+	{
+		map models/players/drz/vin_legs1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/drz/acc/drz_belt1
+{
+	picmip2
+	{
+		map models/players/drz/acc/drz_belt1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/drz/acc/drz_cap1
+{
+	picmip2
+	{
+		map models/players/drz/acc/drz_cap1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/drz/acc/drz_glass1
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/drz/acc/drz_glass1.tga
+		blendfunc blend
+		rgbGen lightingDiffuse
+	}
+}
+
+
+///eliteguard//
+models/players/eliteguard/eg_body1
+{
+	picmip2
+	{
+		map models/players/eliteguard/eg_body1.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingdiffuse
+	}
+}
+models/players/eliteguard/eg_body2
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/eliteguard/eg_body2.tga
+		rgbGen lightingdiffuse
+	}
+}
+models/players/eliteguard/eg_body3
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/eliteguard/eg_body3.tga
+		rgbGen lightingdiffuse
+	}
+}
+models/players/eliteguard/eg_bodycas1
+{
+	picmip2
+	//cull twosided
+	{
+		map models/players/eliteguard/eg_bodycas1.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingdiffuse
+	}
+}
+models/players/eliteguard/eg_bodycas2
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/eliteguard/eg_bodycas2.tga
+		rgbGen lightingdiffuse
+	}
+}
+
+models/players/eliteguard/eg_boot
+{
+	picmip2
+	{
+		map models/players/eliteguard/eg_boot.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/eliteguard/eg_bootcas
+{
+	picmip2
+	{
+		map models/players/eliteguard/eg_bootcas.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/eliteguard/acc/eg_glasses
+{
+	picmip2
+	cull twosided
+
+	{
+		map models/players/eliteguard/acc/eg_glasses.tga
+		blendfunc blend
+		rgbGen lightingDiffuse
+	}
+}
+models/players/eliteguard/acc/eg_bar1
+{
+	picmip2
+	cull twosided
+
+	{
+		map models/players/eliteguard/acc/eg_bar1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/eliteguard/eg_head1
+{
+	picmip2
+	cull twosided
+
+	{
+		map models/players/eliteguard/eg_head1.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/eliteguard/eg_head_blink
+{
+	picmip2
+	
+
+	{
+		map models/players/eliteguard/eg_head_blink.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+	}
+}
+models/players/eliteguard/eg_head_blink2
+{
+	picmip2
+	
+
+	{
+		map models/players/eliteguard/eg_head_blink2.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+	}
+}
+models/players/eliteguard/eg_head_blink3
+{
+	picmip2
+	
+
+	{
+		map models/players/eliteguard/eg_head_blink3.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+	}
+}
+models/players/eliteguard/eg_head_blink4
+{
+	picmip2
+	
+
+	{
+		map models/players/eliteguard/eg_head_blink4.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+	}
+}
+models/players/eliteguard/eg_head_blink5
+{
+	picmip2
+	
+
+	{
+		map models/players/eliteguard/eg_head_blink5.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+	}
+}
+models/players/eliteguard/eg_head_blink6
+{
+	picmip2
+	
+
+	{
+		map models/players/eliteguard/eg_head_blink6.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/eliteguard/eg_head2
+{
+	picmip2
+	cull twosided	
+	{
+		map models/players/eliteguard/eg_head2.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+	}
+}
+models/players/eliteguard/eg_head3
+{
+	picmip2
+	cull twosided	
+	{
+		map models/players/eliteguard/eg_head3.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/eliteguard/eg_head4
+{
+	picmip2
+	cull twosided	
+	{
+		map models/players/eliteguard/eg_head4.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/eliteguard/eg_head5
+{
+	picmip2
+		
+	{
+		map models/players/eliteguard/eg_head5.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/eliteguard/eg_head6
+{
+	picmip2
+	//cull twosided	
+	{
+		map models/players/eliteguard/eg_head6.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/eliteguard/eg_headcas1
+{
+	picmip2
+	cull twosided	
+	{
+		map models/players/eliteguard/eg_headcas1.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+	}
+}
+models/players/eliteguard/eg_headcas2
+{
+	picmip2
+		
+	{
+		map models/players/eliteguard/eg_headcas2.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/eliteguard/eg_headcas3
+{
+	picmip2
+		
+	{
+		map models/players/eliteguard/eg_headcas3.tga
+		rgbGen lightingDiffuse
+	}
+}
+///eva////
+
+models/players/eva/eva_body1
+{
+	picmip2
+	{
+		map models/players/eva/eva_body1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/eva/eva_boot
+{
+	picmip2
+	{
+		map models/players/eva/eva_boot.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/eva/eva_head1
+{
+	picmip2
+	{
+		map models/players/eva/eva_head1.tga
+		rgbGen lightingDiffuse
+	}
+}
+////guard///
+
+models/players/guard/i_head1
+{
+	picmip2
+	{
+		map models/players/guard/i_head1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/guard/i_body1
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/guard/i_body1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/guard/i_legs1
+{
+	picmip2
+	{
+		map models/players/guard/i_legs1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+///hans///
+models/players/hans/fi_body1
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/hans/fi_body1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/hans/fi_head1
+{
+	picmip2
+	{
+		map models/players/hans/fi_head1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/hans/fi_head_blink
+{
+	picmip2
+	{
+		map models/players/hans/fi_head_blink.tga
+		blendfunc blend
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/hans/fi_legs1
+{
+	picmip2
+	{
+		map models/players/hans/fi_legs1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/hans/acc/ammo1
+{
+	picmip2
+	{
+		map models/players/hans/acc/ammo1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/hans/acc/i_helmut
+{
+	picmip2
+	{
+		map models/players/hans/acc/i_helmut.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+////heinrich////
+models/players/heinrich/hein_armor1
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/heinrich/hein_armor1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/heinrich/hein_body1
+{
+	picmip2
+	{
+		map models/players/heinrich/hein_body1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/heinrich/hein_hair1
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/heinrich/hein_hair1.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/heinrich/hein_head1
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/heinrich/hein_head1.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/heinrich/hein_sword1
+{
+	picmip2
+	{
+		map models/players/heinrich/hein_sword1.tga
+		rgbGen lightingDiffuse
+	}
+}
+///helga///
+models/players/helga/hel_body1
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/helga/hel_body1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/helga/hel_head1
+{
+	picmip2
+	{
+		map models/players/helga/hel_head1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/helga/hel_head_blink
+{
+	picmip2
+	{
+		map models/players/helga/hel_head_blink.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/helga/hel_legs1
+{
+	picmip2
+	{
+		map models/players/helga/hel_legs1.tga
+		rgbGen lightingDiffuse
+	}
+}
+//higgs///
+models/players/higgs/higg_bar1
+{
+	picmip2
+	{
+		map models/players/higgs/higg_bar1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/higgs/higg_body1
+{
+	picmip2
+	{
+		map models/players/higgs/higg_body1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/higgs/higg_head1
+{
+	picmip2
+	{
+		map models/players/higgs/higg_head1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/higgs/higg_head_blink
+{
+	picmip2
+	{
+		map models/players/higgs/higg_head_blink.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/higgs/higg_legs1
+{
+	picmip2
+	{
+		map models/players/higgs/higg_legs1.tga
+		rgbGen lightingDiffuse
+	}
+}
+////infantryss////
+models/players/infantryss/amer_body1
+{
+	picmip2
+	{
+		map models/players/infantryss/amer_body1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/amer_legs1
+{
+	picmip2
+	{
+		map models/players/infantryss/amer_legs1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/ammo1
+{
+	picmip2
+	{
+		map models/players/infantryss/ammo1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_body1
+{
+	cull twosided
+	picmip2
+	{
+		map models/players/infantryss/i_body1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/i_body2
+{
+	cull twosided
+	picmip2
+	{
+		map models/players/infantryss/i_body2.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_body3
+{
+	picmip2
+	{
+		map models/players/infantryss/i_body3.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_bodyburn
+{
+	picmip2
+	{
+		map models/players/infantryss/i_bodyburn.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_bodycam1
+{
+	picmip2
+	{
+		map models/players/infantryss/i_bodycam1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_bodysn1
+{
+	picmip2
+	{
+		map models/players/infantryss/i_bodysn1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/i_xbody1
+{
+	picmip2
+	{
+		map models/players/infantryss/i_xbody1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_body_vill
+{
+	picmip2
+	{
+		map models/players/infantryss/i_body_vill.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/i_churbody1
+{
+	picmip2
+	{
+		map models/players/infantryss/i_churbody1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/i_churbody2
+{
+	picmip2
+	{
+		map models/players/infantryss/i_churbody2.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/i_churlegs1
+{
+	picmip2
+	{
+		map models/players/infantryss/i_churlegs1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/i_churlegs2
+{
+	picmip2
+	{
+		map models/players/infantryss/i_churlegs2.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/i_crylegs2
+{
+	picmip2
+	{
+		map models/players/infantryss/i_crylegs2.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_crybody1
+{
+	picmip2
+	{
+		map models/players/infantryss/i_crybody1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_cryhead1
+{
+	picmip2
+	{
+		map models/players/infantryss/i_cryhead1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/i_cryhead2
+{
+	picmip2
+	{
+		map models/players/infantryss/i_cryhead2.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/i_cryhead3
+{
+	picmip2
+	{
+		map models/players/infantryss/i_cryhead3.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/i_cryhead4
+{
+	picmip2
+	{
+		map models/players/infantryss/i_cryhead4.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_head1
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/i_head2
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head2.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/i_head3
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head3.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/i_head4
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head4.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/i_head5
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head5.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/i_head6
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head6.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/i_head7
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head7.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/i_head8
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head8.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/i_head9
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head9.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/i_head10
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head10.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/i_head11
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head11.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/i_head12
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head12.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/i_head13
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head13.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_head14
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head14.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_head15
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head15.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/i_head15_blink
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head15_blink.tga
+	//	alphaFunc GE128
+	//	depthWrite
+		blendfunc blend
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/i_sfmhead1_blink
+{
+	picmip2
+	{
+		map models/players/infantryss/i_sfmhead1_blink.tga
+	//	alphaFunc GE128
+	//	depthWrite
+		blendfunc blend
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_sfmhead2_blink
+{
+	picmip2
+	{
+		map models/players/infantryss/i_sfmhead2_blink.tga
+	//	alphaFunc GE128
+	//	depthWrite
+		blendfunc blend
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_sfmhead3_blink
+{
+	picmip2
+	{
+		map models/players/infantryss/i_sfmhead3_blink.tga
+	//	alphaFunc GE128
+	//	depthWrite
+		blendfunc blend
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_head_blink
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head_blink.tga
+	//	alphaFunc GE128
+	//	depthWrite
+		blendfunc blend
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_head15_blink
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head15_blink.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_head16
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head16.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_head16_blink
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head16_blink.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_head17
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head17.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_head17_blink
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head17_blink.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_head18
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head18.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_head18_blink
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head18_blink.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_head19
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head19.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_head19_blink
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head19_blink.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_head1_blink
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head1_blink.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_head20
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head20.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_head20_blink
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head20_blink.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_head21
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head21.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_head21_blink
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head21_blink.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_head23
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head23.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_head23_blink
+{
+	picmip2
+	{
+		map models/players/infantryss/i_head23_blink.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+
+
+models/players/infantryss/i_headburn
+{
+	picmip2
+	{
+		map models/players/infantryss/i_headburn.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/i_headcam1
+{
+	picmip2
+	{
+		map models/players/infantryss/i_headcam1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_headsn1
+{
+	picmip2
+	{
+		map models/players/infantryss/i_headsn1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_headsn2
+{
+	picmip2
+	{
+		map models/players/infantryss/i_headsn2.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/i_headsn3
+{
+	picmip2
+	{
+		map models/players/infantryss/i_headsn3.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/i_headsn4
+{
+	picmip2
+	{
+		map models/players/infantryss/i_headsn4.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_legs1
+{
+	picmip2
+	{
+		map models/players/infantryss/i_legs1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/i_legs2
+{
+	picmip2
+	{
+		map models/players/infantryss/i_legs2.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_legs3
+{
+	picmip2
+	{
+		map models/players/infantryss/i_legs3.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_legsburn
+{
+	picmip2
+	{
+		map models/players/infantryss/i_legsburn.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_legscam1
+{
+	picmip2
+	{
+		map models/players/infantryss/i_legscam1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_legscam2
+{
+	picmip2
+	{
+		map models/players/infantryss/i_legscam2.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_legssn1
+{
+	picmip2
+	{
+		map models/players/infantryss/i_legssn1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_legssn2
+{
+	picmip2
+	{
+		map models/players/infantryss/i_legssn2.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_rockbody1
+{
+	picmip2
+	{
+		map models/players/infantryss/i_rockbody1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_rocklegs1
+{
+	picmip2
+	{
+		map models/players/infantryss/i_rocklegs1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_sfmbody1
+{
+	picmip2
+	{
+		map models/players/infantryss/i_sfmbody1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_sfmbody2
+{
+	picmip2
+	{
+		map models/players/infantryss/i_sfmbody2.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_sfmhead1
+{
+	picmip2
+	{
+		map models/players/infantryss/i_sfmhead1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_sfmhead1_blink
+{
+	picmip2
+	{
+		map models/players/infantryss/i_sfmhead1_blink.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_sfmhead2
+{
+	picmip2
+	{
+		map models/players/infantryss/i_sfmhead2.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_sfmhead2_blink
+{
+	picmip2
+	{
+		map models/players/infantryss/i_sfmhead2_blink.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_sfmhead3
+{
+	picmip2
+	{
+		map models/players/infantryss/i_sfmhead3.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_sfmhead3_blink
+{
+	picmip2
+	{
+		map models/players/infantryss/i_sfmhead3_blink.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/infantryss/i_sfmlegs1
+{
+	picmip2
+	{
+		map models/players/infantryss/i_sfmlegs1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/acc/ammo1
+{
+	picmip2
+	{
+		map models/players/infantryss/acc/ammo1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/acc/ammosn1
+{
+	picmip2
+	{
+		map models/players/infantryss/acc/ammosn1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/acc/binoc
+{
+	picmip2
+	{
+		map models/players/infantryss/acc/binoc.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/acc/cap
+{
+	picmip2
+	{
+		map models/players/infantryss/acc/cap.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/acc/churcap
+{
+	picmip2
+	{
+		map models/players/infantryss/acc/churcap.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/acc/cig
+{
+	picmip2
+	{
+		map models/players/infantryss/acc/cig.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/acc/crycap
+{
+	picmip2
+	{
+		map models/players/infantryss/acc/crycap.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/acc/escapecap
+{
+	picmip2
+	{
+		map models/players/infantryss/acc/escapecap.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/acc/fieldkit
+{
+	picmip2
+	{
+		map models/players/infantryss/acc/fieldkit.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/acc/fieldkitsn
+{
+	picmip2
+	{
+		map models/players/infantryss/acc/fieldkitsn.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/acc/helgrass
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/infantryss/acc/helgrass.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/acc/i_camohelmut1
+{
+	picmip2
+	{
+		map models/players/infantryss/acc/i_camohelmut1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/acc/i_camohelmut1
+{
+	picmip2
+	{
+		map models/players/infantryss/acc/i_camohelmut1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/acc/i_helmut
+{
+	picmip2
+	{
+		map models/players/infantryss/acc/i_helmut.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/acc/i_helmut1
+{
+	picmip2
+	{
+		map models/players/infantryss/acc/i_helmut1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/acc/i_helmut2
+{
+	picmip2
+	{
+		map models/players/infantryss/acc/i_helmut2.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/acc/i_helmut3
+{
+	picmip2
+	{
+		map models/players/infantryss/acc/i_helmut3.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/acc/i_helmutburn
+{
+	picmip2
+	{
+		map models/players/infantryss/acc/i_helmutburn.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/acc/i_helmutsn1
+{
+	picmip2
+	{
+		map models/players/infantryss/acc/i_helmutsn1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/acc/mp40belt
+{
+	picmip2
+	{
+		map models/players/infantryss/acc/mp40belt.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/acc/mp40beltd
+{
+	picmip2
+	{
+		map models/players/infantryss/acc/mp40beltd.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/acc/mp40beltsn
+{
+	picmip2
+	{
+		map models/players/infantryss/acc/mp40beltsn.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/acc/radio
+{
+	picmip2
+	{
+		map models/players/infantryss/acc/radio.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/acc/rockcap
+{
+	picmip2
+	{
+		map models/players/infantryss/acc/rockcap.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/acc/rockhelmut
+{
+	picmip2
+	{
+		map models/players/infantryss/acc/rockhelmut.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/acc/sfmcap
+{
+	picmip2
+	{
+		map models/players/infantryss/acc/sfmcap.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/acc/sfmhelmut
+{
+	picmip2
+	{
+		map models/players/infantryss/acc/sfmhelmut.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/acc/villcap
+{
+	picmip2
+	{
+		map models/players/infantryss/acc/villcap.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/acc/xlabcap
+{
+	picmip2
+	{
+		map models/players/infantryss/acc/xlabcap.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/infantryss/acc/xlabhelmut
+{
+	picmip2
+	{
+		map models/players/infantryss/acc/xlabhelmut.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+
+///inge///
+models/players/inge/ing_body1
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/inge/ing_body1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/inge/ing_body2
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/inge/ing_body2.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/inge/ing_body3
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/inge/ing_body3.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/inge/ing_head1
+{
+	picmip2
+	{
+		map models/players/inge/ing_head1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/inge/ing_head2
+{
+	picmip2
+	{
+		map models/players/inge/ing_head2.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/inge/ing_head2_blink
+{
+	picmip2
+	{
+		map models/players/inge/ing_head2_blink.tga
+		blendfunc blend
+		rgbGen lightingDiffuse
+	}
+}
+models/players/inge/ing_head1_blink
+{
+	picmip2
+	
+	{
+		map models/players/inge/ing_head1_blink.tga
+		blendfunc blend
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/inge/ing_legs1
+{
+	picmip2
+	{
+		map models/players/inge/ing_legs1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/inge/ing_legs2
+{
+	picmip2
+	{
+		map models/players/inge/ing_legs2.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+
+
+////jack///
+
+models/players/jack/jack_body1
+{
+	picmip2
+	{
+		map models/players/jack/jack_body1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/jack/jack_glasses
+{
+	picmip2
+	cull twosided
+	sort 5	
+	{
+		map models/players/jack/jack_glasses.tga
+		blendfunc blend
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/jack/jack_head1
+{
+	picmip2
+	{
+		map models/players/jack/jack_head1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/jack/jack_head_blink
+{
+	picmip2
+	
+	{
+		map models/players/jack/jack_head_blink.tga
+		alphaFunc GE128
+		rgbGen lightingDiffuse
+	}
+}
+
+
+models/players/jack/jack_legs1
+{
+	picmip2
+	{
+		map models/players/jack/jack_legs1.tga
+		rgbGen lightingDiffuse
+	}
+}
+///loper//
+
+
+models/players/loper/elec1
+{
+	picmip2
+	cull twosided
+	{
+
+		blendFunc add
+		animMap 13 models/players/loper/elec1.tga models/players/loper/elec2.tga models/players/loper/elec3.tga 
+		rgbGen identity
+
+	}
+
+}
+
+models/players/loper/elec2
+{
+	picmip2
+	{
+		map models/players/loper/elec2.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/loper/elec3
+{
+	picmip2
+	{
+		map models/players/loper/elec3.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/loper/lop_body1
+{
+	picmip2
+	{
+		map models/players/loper/lop_body1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/loper/lop_body2
+{
+	picmip2
+	{
+		map models/players/loper/lop_body2.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/loper/lop_head1
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/loper/lop_head1.tga
+		alphaFunc GE128
+		rgbGen lightingdiffuse
+
+	}
+
+}
+models/players/loper/lop_head2
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/loper/lop_head2.tga
+		alphaFunc GE128
+		rgbGen lightingdiffuse
+
+	}
+
+}
+
+models/players/loper/lop_lower1
+{
+	picmip2
+	{
+		map models/players/loper/spark.tga
+                tcmod rotate 350
+		tcmod scale -1 -1
+		blendFunc GL_ONE GL_ZERO
+		rgbGen identity
+	} 
+        {
+        	map models/players/loper/lop_lower1.tga
+		blendFunc blend
+		rgbGen lightingdiffuse
+	}
+}
+
+models/players/loper/spark
+{
+	picmip2
+	{
+		map models/players/loper/spark.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+////mechanic//
+models/players/mechanic/mech_body1
+{
+	picmip2
+	{
+		map models/players/mechanic/mech_body1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/mechanic/mech_bodyswf1
+{
+	picmip2
+	{
+		map models/players/mechanic/mech_bodyswf1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/mechanic/mech_head1
+{
+	picmip2
+	{
+		map models/players/mechanic/mech_head1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/mechanic/mech_head_blink
+{
+	picmip2
+	{
+		map models/players/mechanic/mech_head_blink.tga
+		blendfunc blend
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/mechanic/mech_head2
+{
+	picmip2
+	{
+		map models/players/mechanic/mech_head2.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/mechanic/mech_head2_blink
+{
+	picmip2
+	{
+		map models/players/mechanic/mech_head2_blink.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/mechanic/mech_head3
+{
+	picmip2
+	{
+		map models/players/mechanic/mech_head3.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/mechanic/mech_head3_blink
+{
+	picmip2
+	{
+		map models/players/mechanic/mech_head3_blink.tga
+		blendfunc blend
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/mechanic/mech_radio1
+{
+	picmip2
+	{
+		map models/players/mechanic/mech_radio1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/mechanic/mech_rockbody1
+{
+	picmip2
+	{
+		map models/players/mechanic/mech_rockbody1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/mechanic/acc/cap
+{
+	picmip2
+	{
+		map models/players/mechanic/acc/cap.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/mechanic/acc/mech_cap1
+{
+	picmip2
+	{
+		map models/players/mechanic/acc/mech_cap1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/mechanic/acc/radio
+{
+	picmip2
+	{
+		map models/players/mechanic/acc/radio.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+////multiplayer////
+
+models/players/multi/body_upper_german
+{
+	picmip2
+	{
+		map models/players/multi/body_upper_german.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/multi/head_german
+{
+	picmip2
+	{
+		map models/players/multi/head_german.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/multi/legs_german
+{
+	picmip2
+	{
+		map models/players/multi/legs_german.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+///murphy////
+models/players/murphy/murp_body1
+{
+	cull twosided
+	picmip2
+	{
+		map models/players/murphy/murp_body1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/murphy/murp_head1
+{
+	picmip2
+	{
+		map models/players/murphy/murp_head1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/murphy/murp_head_blink
+{
+	picmip2
+	{
+		map models/players/murphy/murp_head_blink.tga
+//		blendfunc blend
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/murphy/murp_legs1
+{
+	picmip2
+	{
+		map models/players/murphy/murp_legs1.tga
+		rgbGen lightingDiffuse
+	}
+}
+///officerss///
+
+models/players/officerss/o_body1
+{
+	cull twosided
+	picmip2
+	{
+		map models/players/officerss/o_body1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/officerss/o_body2
+{
+	picmip2
+	{
+		map models/players/officerss/o_body2.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/officerss/o_body3
+{
+	picmip2
+	{
+		map models/players/officerss/o_body3.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/officerss/o_body4
+{
+	picmip2
+	{
+		map models/players/officerss/o_body4.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/officerss/o_body5
+{
+	picmip2
+	{
+		map models/players/officerss/o_body5.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/officerss/o_body6
+{
+	picmip2
+	{
+		map models/players/officerss/o_body6.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/officerss/o_chatbody1
+{
+	picmip2
+	{
+		map models/players/officerss/o_chatbody1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/officerss/o_chatbody2
+{
+	picmip2
+	{
+		map models/players/officerss/o_chatbody2.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/officerss/o_forbody1
+{
+	picmip2
+	{
+		map models/players/officerss/o_forbody1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/officerss/o_forlegs1
+{
+	picmip2
+	{
+		map models/players/officerss/o_forlegs1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/officerss/o_head1
+{
+	picmip2
+	{
+		map models/players/officerss/o_head1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/officerss/o_head_blink
+{
+	picmip2
+	{
+		map models/players/officerss/o_head_blink.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/officerss/o_head2
+{
+	picmip2
+	{
+		map models/players/officerss/o_head2.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/officerss/o_head3
+{
+	picmip2
+	{
+		map models/players/officerss/o_head3.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/officerss/o_head4
+{
+	picmip2
+	{
+		map models/players/officerss/o_head4.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/officerss/o_head5
+{
+	picmip2
+	{
+		map models/players/officerss/o_head5.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/officerss/o_head6
+{
+	picmip2
+	{
+		map models/players/officerss/o_head6.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/officerss/o_head7
+{
+	picmip2
+	{
+		map models/players/officerss/o_head7.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/officerss/o_legs1
+{
+	picmip2
+	{
+		map models/players/officerss/o_legs1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/officerss/o_legs2
+{
+	picmip2
+	{
+		map models/players/officerss/o_legs2.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/officerss/o_legs3
+{
+	picmip2
+	{
+		map models/players/officerss/o_legs3.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/officerss/o_legs4
+{
+	picmip2
+	{
+		map models/players/officerss/o_legs4.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/officerss/o_legs5
+{
+	picmip2
+	{
+		map models/players/officerss/o_legs5.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/officerss/o_chatlegs1
+{
+	picmip2
+	{
+		map models/players/officerss/o_chatlegs1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/officerss/acc/binoc
+{
+	picmip2
+	{
+		map models/players/officerss/acc/binoc.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/officerss/acc/cig
+{
+	picmip2
+	{
+		map models/players/officerss/acc/cig.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/officerss/acc/o_belt1
+{
+	picmip2
+	{
+		map models/players/officerss/acc/o_belt1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/officerss/acc/o_cap1
+{
+	picmip2
+	{
+		map models/players/officerss/acc/o_cap1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/officerss/acc/o_cap2
+{
+	picmip2
+	{
+		map models/players/officerss/acc/o_cap2.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/officerss/acc/o_cap3
+{
+	picmip2
+	{
+		map models/players/officerss/acc/o_cap3.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/officerss/acc/o_cap4
+{
+	picmip2
+	{
+		map models/players/officerss/acc/o_cap4.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/officerss/acc/o_cap5
+{
+	picmip2
+	{
+		map models/players/officerss/acc/o_cap5.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/officerss/acc/o_glass1
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/officerss/acc/o_glass1.tga
+		blendfunc blend
+		rgbGen lightingDiffuse
+	}
+}
+
+////partisan////
+models/players/partisan/prt_body1
+{
+	picmip2
+	{
+		map models/players/partisan/prt_body1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/partisan/prt_body2
+{
+	picmip2
+	{
+		map models/players/partisan/prt_body2.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/partisan/prt_sfmbody1
+{
+	picmip2
+	{
+		map models/players/partisan/prt_sfmbody1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/partisan/prt_sfmlegs1
+{
+	picmip2
+	{
+		map models/players/partisan/prt_sfmlegs1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/partisan/prt_head1_blink
+{
+	picmip2
+	{
+		map models/players/partisan/prt_head1_blink.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+	}
+}
+models/players/partisan/prt_head2_blink
+{
+	picmip2
+	{
+		map models/players/partisan/prt_head2_blink.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+	}
+}
+models/players/partisan/prt_head3_blink
+{
+	picmip2
+	{
+		map models/players/partisan/prt_head3_blink.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+	}
+}
+models/players/partisan/prt_head4_blink
+{
+	picmip2
+	{
+		map models/players/partisan/prt_head4_blink.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+	}
+}
+models/players/partisan/prt_head5_blink
+{
+	picmip2
+	{
+		map models/players/partisan/prt_head5_blink.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/partisan/prt_head1
+{
+	picmip2
+	{
+		map models/players/partisan/prt_head1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/partisan/prt_head2
+{
+	picmip2
+	{
+		map models/players/partisan/prt_head2.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/partisan/prt_head3
+{
+	picmip2
+	{
+		map models/players/partisan/prt_head3.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/partisan/prt_head4
+{
+	picmip2
+	{
+		map models/players/partisan/prt_head4.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/partisan/prt_legs1
+{
+	picmip2
+	{
+		map models/players/partisan/prt_legs1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/partisan/prt_legs2
+{
+	picmip2
+	{
+		map models/players/partisan/prt_legs2.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/partisan/acc/o_belt1
+{
+	picmip2
+	{
+		map models/players/partisan/acc/o_belt1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/partisan/acc/pisbelt1
+{
+	picmip2
+	{
+		map models/players/partisan/acc/pisbelt1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/partisan/acc/prt_bar1
+{
+	picmip2
+	{
+		map models/players/partisan/acc/prt_bar1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/partisan/acc/prt_glasses
+{
+	picmip2
+	{
+		map models/players/partisan/acc/prt_glasses.tga
+		blendfunc blend
+		rgbGen lightingDiffuse
+	}
+}
+//priestess///
+models/players/priestess/ptess_body1
+{
+	picmip2
+	//cull twosided
+	
+	{
+		map models/players/priestess/ptess_body1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/priestess/ptess_cape
+{
+	picmip2
+	
+	
+	{
+		map models/players/priestess/ptess_cape.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/priestess/ptess_head1
+{
+	picmip2
+	
+	
+	{
+		map models/players/priestess/ptess_head1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/priestess/ptess_head_blink
+{
+	picmip2
+	
+	{
+		map models/players/priestess/ptess_head_blink.tga
+		blendfunc blend
+		rgbGen lightingDiffuse
+	}
+}
+
+//protosoldier//
+models/players/protosoldier/proto_armor1
+{
+	picmip2
+	cull twosided
+	
+	{
+		map models/players/protosoldier/proto_armor1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/protosoldier/proto_body1
+{
+	picmip2
+	{
+		map models/players/protosoldier/proto_body1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/protosoldier/proto_extra
+{
+	picmip2
+	{
+		map models/players/protosoldier/proto_extra.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/protosoldier/proto_head1
+{
+	picmip2
+	{
+		map models/players/protosoldier/proto_head1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/protosoldier/proto_legs1
+{
+	picmip2
+	{
+		map models/players/protosoldier/proto_legs1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/protosoldier/proto_stim1
+{
+	picmip2
+	{
+		map models/players/protosoldier/proto_stim1.tga
+		rgbGen lightingDiffuse
+	}
+}
+///supersoldier////
+models/players/supersoldier/sup_armor1
+{
+	picmip2
+	cull twosided
+	
+
+	{
+		map models/players/supersoldier/sup_armor1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/supersoldier/sup_body1
+{
+	picmip2
+	{
+		map textures/effects/regenmap3.tga
+		rgbGen identity
+		tcMod rotate 360
+		tcMod scroll 1 0
+	}
+
+	{
+		map models/players/supersoldier/sup_body1.tga
+		blendfunc blend
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/supersoldier/sup_extra
+{
+	picmip2
+	{
+		map models/players/supersoldier/sup_extra.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/supersoldier/sup_head1
+{
+	picmip2
+	{
+		map models/players/supersoldier/sup_head1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/supersoldier/sup_helmut1
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/supersoldier/sup_helmut1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/supersoldier/goo1
+{
+	picmip2
+	
+	{
+		map models/players/supersoldier/goo1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/supersoldier/sup_legs1
+{
+	picmip2
+	{
+		map textures/effects/regenmap3.tga
+		rgbGen identity
+		tcMod rotate 360
+		tcMod scroll 1 0
+	}
+	
+
+	{
+		map models/players/supersoldier/sup_legs1.tga
+		blendFunc blend
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/supersoldier/sup_stim1
+{
+	picmip2
+	{
+		map models/players/supersoldier/goo1.tga
+		rgbGen identity
+		//tcMod rotate 360
+		tcMod scroll 1 0
+	}
+
+
+	{
+		map models/players/supersoldier/sup_stim1.tga
+		blendFunc blend
+		rgbGen lightingDiffuse
+	}
+}
+models/players/supersoldier/wzom_ghost1
+{
+	picmip2
+	{
+		map models/players/supersoldier/wzom_ghost1.tga
+		blendFunc blend
+		rgbGen lightingDiffuse
+	}
+}
+models/players/supersoldier/wzom_ghost2
+{
+	picmip2
+	{
+		map models/players/supersoldier/wzom_ghost2.tga
+		blendFunc blend
+		rgbGen lightingDiffuse
+	}
+}
+models/players/supersoldier/wzom_ghost3
+{
+	picmip2
+	{
+		map models/players/supersoldier/wzom_ghost3.tga
+		blendFunc blend
+		rgbGen lightingDiffuse
+	}
+}
+
+///trench///
+
+
+models/players/trench/t_body1
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/trench/t_body1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/trench/t_body2
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/trench/t_body2.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/trench/t_body3
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/trench/t_body3.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/trench/t_legs1
+{
+	picmip2
+	{
+		map models/players/trench/t_legs1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/trench/t_legs2
+{
+	picmip2
+	{
+		map models/players/trench/t_legs2.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/trench/acc/ammo1
+{
+	picmip2
+	{
+		map models/players/trench/acc/ammo1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/trench/acc/cap
+{
+	picmip2
+	{
+		map models/players/trench/acc/cap.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/trench/acc/fieldkit
+{
+	picmip2
+	{
+		map models/players/trench/acc/fieldkit.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/trench/acc/i_helmut1
+{
+	picmip2
+	{
+		map models/players/trench/acc/i_helmut1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/trench/acc/i_helmut2
+{
+	picmip2
+	{
+		map models/players/trench/acc/i_helmut2.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/trench/acc/i_helmut3
+{
+	picmip2
+	{
+		map models/players/trench/acc/i_helmut3.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/trench/acc/mp40belt
+{
+	picmip2
+	{
+		map models/players/trench/acc/mp40belt.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/trench/acc/o_cap3
+{
+	picmip2
+	{
+		map models/players/trench/acc/o_cap3.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+///venom//
+models/players/venom/vi_head
+{
+	picmip2
+	{
+		map models/players/venom/vi_head.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/venom/v_body1
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/venom/v_body1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/venom/v_bodysn1
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/venom/v_bodysn1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/venom/v_facbody1
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/venom/v_facbody1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/venom/v_glassn1
+{
+	picmip2
+	sort 5
+	{
+		map models/players/venom/v_glassn1.tga
+		blendfunc blend
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/venom/v_glass
+{
+	picmip2
+	sort 5
+	{
+		map models/players/venom/v_glass.tga
+		blendfunc blend
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/venom/v_head1
+{
+	picmip2
+	{
+		map models/players/venom/v_head1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/venom/v_fachead1
+{
+	picmip2
+	{
+		map models/players/venom/v_fachead1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/venom/v_legs1
+{
+	picmip2
+	{
+		map models/players/venom/v_legs1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/venom/v_legssn1
+{
+	picmip2
+	{
+		map models/players/venom/v_legssn1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/venom/acc/v_bp
+{
+	picmip2
+	{
+		map models/players/venom/acc/v_bp.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/venom/acc/v_bpsn1
+{
+	picmip2
+	{
+		map models/players/venom/acc/v_bpsn1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+///warrior//
+models/players/warrior/armor1
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/warrior/armor1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/warrior/armor2
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/warrior/armor2.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/warrior/armor3
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/warrior/armor3.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/warrior/acc/wzom_helm1
+			
+{	
+	picmip2
+	cull twosided
+	
+	{
+		map models/players/warrior/acc/wzom_helm1.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingdiffuse
+	}
+}
+models/players/warrior/acc/wzom_helm2
+			
+{	
+	picmip2
+	cull twosided
+	
+	{
+		map models/players/warrior/acc/wzom_helm2.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingdiffuse
+	}
+}
+
+
+models/players/warrior/glow
+{
+	picmip2
+	{
+		map models/players/warrior/glow.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/warrior/wzom_body1
+{
+	picmip2
+	{
+		map models/players/warrior/wzom_body1.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+	}
+}
+models/players/warrior/wzom_body2
+{
+	picmip2
+	{
+		map models/players/warrior/wzom_body2.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+	}
+}
+models/players/warrior/wzom_body3
+{
+	picmip2
+	{
+		map models/players/warrior/wzom_body3.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/warrior/wzom_head1
+{
+	picmip2
+//	sort 5
+	{
+		map models/players/warrior/glow.tga
+            tcmod rotate 350
+		tcmod scale -1 -1
+		blendFunc GL_ONE GL_ZERO
+	//	rgbGen identity
+		rgbGen wave sin 1 0.5 0 0.5 
+	} 
+	
+	{
+		map models/players/warrior/wzom_head1.tga
+		blendfunc blend
+		rgbGen lightingdiffuse
+	}
+}
+models/players/warrior/wzom_head2
+{
+	picmip2
+//	sort 5
+	{
+		map models/players/warrior/glow.tga
+            tcmod rotate 350
+		tcmod scale -1 -1
+		blendFunc GL_ONE GL_ZERO
+	//	rgbGen identity
+		rgbGen wave sin 1 0.5 0 0.5
+	} 
+	{
+		map models/players/warrior/wzom_head2.tga
+		blendfunc blend
+		rgbGen lightingdiffuse
+	}
+}
+models/players/warrior/wzom_head3
+{
+	picmip2
+	
+	{
+		map models/players/warrior/wzom_head3.tga
+	//	blendfunc blend
+		rgbGen lightingdiffuse
+	}
+}
+
+///zemph///
+models/players/zemph/drz_head4
+{
+	picmip2
+	{
+		map models/players/zemph/drz_head4.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/zemph/drz_xbody1
+{
+	picmip2
+	{
+		map models/players/zemph/drz_xbody1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/zemph/drz_xlegs1
+{
+	picmip2
+	{
+		map models/players/zemph/drz_xlegs1.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+
+///zombie///
+models/players/zombie/zom_body1
+{
+	picmip2
+	{
+		map models/players/zombie/zom_body1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/zombie/zom_body2
+{
+	picmip2
+	{
+		map models/players/zombie/zom_body2.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/zombie/zom_body3
+{
+	picmip2
+	{
+		map models/players/zombie/zom_body3.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/zombie/zom_body4
+{
+	picmip2
+	{
+		map models/players/zombie/zom_body4.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/zombie/zom_body5
+{
+	picmip2
+	{
+		map models/players/zombie/zom_body5.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/zombie/zom_body6
+{
+	picmip2
+	cull twosided
+	{
+		map models/players/zombie/zom_body6.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/zombie/zom_head1
+{
+	picmip2
+	{
+		map models/players/zombie/zom_head1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/zombie/zom_head2
+{
+	picmip2
+	{
+		map models/players/zombie/zom_head2.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/zombie/zom_head3
+{
+	picmip2
+	{
+		map models/players/zombie/zom_head3.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/zombie/zom_head4
+{
+	picmip2
+	{
+		map models/players/zombie/zom_head4.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/players/zombie/zom_head5
+{
+	picmip2
+	{
+		map models/players/zombie/zom_head5.tga
+		rgbGen lightingDiffuse
+	}
+}
+
+models/players/zombie/zom_head6
+{      
+	picmip2
+	cull twosided
+	//sort 5
+        
+	{
+		map models/players/zombie/fire.tga
+		rgbGen identity
+		tcMod scroll 0 1
+	}
+	{
+		map models/players/zombie/zom_head6.tga
+		blendfunc blend
+		rgbGen lightingdiffuse
+	}
+}
+
+models/players/zombie/zom_hair
+{
+	picmip2
+	cull twosided
+	//sort 5
+	{
+		map models/players/zombie/zom_hair.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+	}
+}
+//models/players/zombie/acc/zom_hair
+//{
+//	picmip2
+//	cull twosided
+//	{
+//		map models/players/zombie/acc/zom_hair.tga
+///		alphaFunc GE128
+//		depthWrite
+///		rgbGen lightingDiffuse
+//	}
+//}
+
+///beast///
+
+
+models/players/beast/mouth
+{
+
+	picmip2
+	//deformVertexes wave 30 sin 0 .8 0 .3
+	//cull twosided
+	{
+		map models/players/beast/fire.tga
+		rgbGen identity
+		tcMod scroll 0 1
+	}
+
+	{
+		map models/players/beast/mouth.tga
+		blendfunc blend
+		rgbGen lightingdiffuse
+	}
+}
+models/players/beast/skulls2
+{
+	picmip2
+	deformVertexes wave 30 sin 0 .8 0 .3
+	
+
+	cull twosided
+	{
+		map models/players/beast/fire.tga
+		rgbGen identity
+		tcMod scroll 0 1
+	}
+
+	{
+		map models/players/beast/skulls2.tga
+		blendfunc blend
+		rgbGen lightingdiffuse
+	}
+}
+models/players/beast/bes_body1
+{
+	picmip2
+	//deformVertexes wave 30 sin 0 .8 0 .3
+	//deformVertexes wave 30 sin 0 1 0 .3
+	//deformVertexes wave 194 sin 0 1 0 .4
+
+	cull twosided
+	{
+		map models/players/beast/bes_body1.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingdiffuse
+	}
+}
+
+
+
+/////////// have a nice day /////////////////
diff --git a/SP/media/scripts/models.mtr b/SP/media/scripts/models.mtr
new file mode 100644
index 0000000..a823dbd
--- /dev/null
+++ b/SP/media/scripts/models.mtr
@@ -0,0 +1,8108 @@
+// this file contains shaders attached models
+//
+models/mapobjects/test/table
+{
+	{
+		map models/mapobjects/deadosa/elec1.tga
+//		blendFunc GL_ONE GL_ZERO
+//		rgbGen lightingdiffuse
+//		tcGen environment 
+		tcMod scale 2 2
+		tcMod scroll 2 2
+	}
+	{
+		map models/mapobjects/deadosa/table.tga
+		blendfunc blend
+		rgbGen vertex
+	}
+}
+textures/props/table
+{
+	cull twosided
+	{
+		map models/mapobjects/deadosa/elec1.tga
+//		blendFunc GL_ONE GL_ZERO
+//		rgbGen lightingdiffuse
+//		tcGen environment 
+		tcMod scale 2 2
+		tcMod scroll 2 2
+	}
+	{
+		map textures/props/table.tga
+		blendfunc blend
+		rgbGen vertex
+	}
+}
+
+
+
+models/mapobjects/ironmaiden/eyes1
+{
+//	cull twosided
+	{
+//		blendFunc blend
+//		blendFunc add
+		AnimMap 1 models/mapobjects/ironmaiden/eyes1.tga models/mapobjects/ironmaiden/eyes2.tga models/mapobjects/ironmaiden/eyes3.tga models/mapobjects/ironmaiden/eyes4.tga 
+//		rgbGen wave sin 1 .6 0 .5
+		rgbGen vertex
+	}
+}
+models/mapobjects/vacum/mouth
+{
+	//deformVertexes wave 30 sin 0 .8 0 .3
+	
+
+	//cull twosided
+	{
+		map models/mapobjects/vacum/fire.tga
+		rgbGen identity
+		tcMod scroll 0 1
+	}
+
+	{
+		map models/mapobjects/vacum/mouth.tga
+		blendfunc blend
+		rgbGen vertex
+	}
+}
+models/mapobjects/vacum/skulls2
+{
+	deformVertexes wave 30 sin 0 .8 0 .3
+	
+
+	cull twosided
+	{
+		map models/mapobjects/vacum/fire.tga
+		rgbGen identity
+		tcMod scroll 0 1
+	}
+
+	{
+		map models/mapobjects/vacum/skulls2.tga
+		blendfunc blend
+		rgbGen vertex
+	}
+}
+
+models/mapobjects/vacum/zom_body1
+{
+	cull twosided
+	{
+		map models/mapobjects/vacum/zom_body1.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingdiffuse
+	}
+}
+models/mapobjects/vacum/zom_helm1
+{
+	cull twosided
+	{
+		map models/mapobjects/vacum/zom_helm1.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingdiffuse
+	}
+}
+models/mapobjects/vacum/armor1
+{
+	cull twosided
+	{
+		map models/mapobjects/vacum/armor1.tga
+		rgbGen lightingdiffuse
+	}
+}
+
+models\mapobjects\vacum\vac_goo
+{
+	cull twosided
+	{
+		map models/mapobjects/vacum/vac_goo.tga
+		rgbGen lightingdiffuse
+	}
+}
+
+
+models\mapobjects\vacum\vac_body
+{
+	cull twosided
+	{
+		map models/mapobjects/vacum/vac_body.tga
+		rgbGen lightingdiffuse
+	}
+}
+models/mapobjects/vacum/shad
+{
+//	cull twosided
+	{
+		map models/mapobjects/vacum/shad.tga
+		blendfunc blend
+		rgbGen lightingdiffuse
+	}
+}
+
+models\mapobjects\vacum\vac_glass
+{
+	cull twosided
+	{
+		map models/mapobjects/vacum/vac_glass.tga
+		blendfunc blend
+		rgbGen lightingdiffuse
+	}
+}
+
+models/mapobjects/apoth/glass
+{
+	{
+		map models/mapobjects/apoth/glass.tga
+		blendfunc blend
+		rgbGen vertex
+	}
+}
+
+models\mapobjects\curtain\curtain
+{
+	
+	{
+		map models/mapobjects/curtain/curtain.tga
+		blendfunc blend
+		rgbGen lightingdiffuse
+	}
+}
+
+models\mapobjects\parachute\para
+{
+	cull twosided
+	{
+		map models/mapobjects/parachute/para.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingdiffuse
+	}
+}
+models/mapobjects/test/gown
+{
+	cull twosided
+	nomipmaps
+	{
+		map models/mapobjects/test/gown.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingdiffuse
+	}
+}
+models/mapobjects/test/ptess_head
+{
+	cull twosided
+	
+	{
+		map models/mapobjects/test/ptess_head.tga
+		rgbGen vertex
+	}
+}
+
+models\mapobjects\bush\bush
+{
+	cull twosided
+	{
+		map models/mapobjects/bush/bush.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen vertex
+	}
+}
+
+models/players/murphy/murp_body1
+{
+	cull twosided
+	
+	{
+		map models/players/murphy/murp_body1.tga
+		rgbGen lightingdiffuse
+	}
+}
+
+models/players/higgs/higg_body1
+{
+	cull twosided
+	
+	{
+		map models/players/higgs/higg_body1.tga
+		rgbGen lightingdiffuse
+	}
+}
+
+
+
+models/players/inge/inge_body1
+{
+	cull twosided
+	
+	{
+		map models/players/inge/inge_body1.tga
+		rgbGen lightingdiffuse
+	}
+}
+models/players/inge/inge_body2
+{
+	cull twosided
+	
+	{
+		map models/players/inge/inge_body2.tga
+		rgbGen lightingdiffuse
+	}
+}
+models/players/inge/inge_body3
+{
+	cull twosided
+	
+	{
+		map models/players/inge/inge_body3.tga
+		rgbGen lightingdiffuse
+	}
+}
+models/players/officerss/acc/o_glass1
+{
+	cull twosided
+	
+	{
+		map models/players/officerss/acc/o_glass1.tga
+		blendfunc blend
+		rgbGen lightingdiffuse
+	}
+}
+models/players/director/dir_glasses
+{
+	cull twosided
+	
+	{
+		map models/players/director/dir_glasses.tga
+		blendfunc blend
+		rgbGen lightingdiffuse
+	}
+}
+
+models/players/director/dir_body1
+{
+	cull twosided
+	
+	{
+		map models/players/director/dir_body1.tga
+		rgbGen lightingdiffuse
+	}
+}
+
+models/players/hans/fi_head1
+{
+	cull twosided
+	
+	{
+		map models/players/hans/fi_head1.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingdiffuse
+	
+	}
+}
+models/players/hans/fi_head1_blink
+{
+	cull twosided
+	
+	{
+		map models/players/hans/fi_head1_blink.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingdiffuse
+	
+	}
+}
+
+models/players/hans/acc/mustac
+{
+	cull twosided
+	
+	{
+		map models/players/hans/acc/mustac.tga
+		blendfunc blend
+		rgbGen lightingdiffuse
+	
+	}
+}
+
+models/players/partisan/acc/prt_glasses
+{
+	cull twosided
+	
+	{
+		map models/players/partisan/acc/prt_glasses.tga
+		blendfunc blend
+		rgbGen lightingdiffuse
+	}
+}
+
+models/players/partisan/acc/prt_bar1
+{
+	cull twosided
+	
+	{
+		map models/players/partisan/acc/prt_bar1.tga
+	
+		rgbGen lightingdiffuse
+	}
+}
+
+
+models/players/jack/jack_glasses
+{
+	cull twosided
+	
+	{
+		map models/players/jack/jack_glasses.tga
+		blendfunc blend
+		rgbGen lightingdiffuse
+	}
+}
+models/players/jack/jack_body1
+{
+	cull twosided
+	
+	{
+		map models/players/jack/jack_body1.tga
+		rgbGen lightingdiffuse
+	}
+}
+
+
+models/players/eliteguard/betty_body1
+{
+	
+	{
+		map models/players/eliteguard/betty_body1.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingdiffuse
+	}
+}
+models/players/eliteguard/betty_head1
+{
+	cull twosided
+	{
+		map models/players/eliteguard/betty_head1.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingdiffuse
+	}
+}
+
+models/players/protosoldier/proto_body1
+{
+	cull twosided
+	{
+		map models/players/protosoldier/proto_body1.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingdiffuse
+	}
+}
+models/players/protosoldier/proto_legs1
+{
+	cull twosided
+	{
+		map models/players/protosoldier/proto_legs1.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingdiffuse
+	}
+}
+////infantryss///
+
+models/players/infantryss/acc/helgrass
+{
+	cull twosided
+	{
+		map models/players/infantryss/acc/helgrass.tga
+		alphaFunc GE128
+		depthWrite
+	//	blendfunc blend
+		rgbGen lightingdiffuse
+	}
+}
+
+models/players/infantryss/i_body1
+{
+	cull twosided
+	{
+		map models/players/infantryss/i_body1.tga
+		rgbGen lightingdiffuse
+	}
+}
+models/players/officerss/o_body1
+{
+	cull twosided
+	{
+		map models/players/officerss/o_body1.tga
+		rgbGen lightingdiffuse
+	}
+}
+
+models\mapobjects\parachute\para2
+{
+	cull twosided
+	{
+		map models/mapobjects/parachute/para2.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingdiffuse
+	}
+}
+
+models/mapobjects/test/eg_body1
+{
+	cull twosided
+	{
+		map models/mapobjects/test/eg_body1.tga
+		alphaFunc GE128
+		depthWrite	
+		rgbGen vertex
+	}
+}
+
+models/mapobjects/test/x
+{
+	cull twosided
+	{
+		map models/mapobjects/test/x.tga
+		alphaFunc GE128
+		depthWrite	
+		rgbGen vertex
+	}
+}
+
+
+models/mapobjects/test/v_body1
+{
+	cull twosided
+	{
+		map models/mapobjects/test/v_body1.tga
+		rgbGen vertex
+	}
+}
+
+models/players/venom/v_body1
+{
+	cull twosided
+	{
+		map models/players/venom/v_body1.tga
+		rgbGen lightingdiffuse
+	}
+}
+
+models/mapobjects/test/v_glass
+{
+	cull twosided
+	{
+		map models/mapobjects/test/v_glass.tga
+		blendfunc blend
+	//	rgbGen lightingdiffuse
+	}
+}
+models/players/venom/v_glass
+{
+//	cull twosided
+	sort 5
+	{
+		map models/players/venom/v_glass.tga
+		blendfunc blend
+		rgbGen lightingdiffuse
+	}
+}
+
+models/mapobjects/test/bg_glass
+{
+	cull twosided
+	{
+		map models/mapobjects/test/bg_glass.tga
+		blendfunc blend
+	//	rgbGen lightingdiffuse
+	}
+}
+models/players/blackguard/acc/bg_glass
+{
+//	cull twosided
+	sort 5
+	{
+		map models/players/blackguard/acc/bg_glass.tga
+		blendfunc blend
+		rgbGen lightingdiffuse
+	}
+}
+
+models\mapobjects\curtain\2curtains
+{
+	cull twosided
+	{
+		map models/mapobjects/curtain/2curtains.tga
+		blendfunc blend
+		rgbGen lightingdiffuse
+	}
+}
+
+models\mapobjects\curtain\2curtainsb
+{
+	cull twosided
+	{
+		map models/mapobjects/curtain/2curtainsb.tga
+		blendfunc blend
+		rgbGen lightingdiffuse
+	}
+}
+
+
+
+models\mapobjects\curtain\curtain_200
+{
+	cull twosided
+
+	{
+		map models/mapobjects/curtain/curtain_200.tga
+		rgbGen lightingdiffuse
+	}
+}
+
+models\mapobjects\flag\flag1
+{
+	cull twosided
+	{
+		map models/mapobjects/flag/flag1.tga
+		rgbGen lightingdiffuse
+	}
+}
+
+models\mapobjects\flag\flag1a
+{
+	cull twosided
+	{
+		map models/mapobjects/flag/flag1a.tga
+		rgbGen lightingdiffuse
+	}
+}
+
+models\mapobjects\flag\flag1b
+{
+	cull twosided
+	{
+		map models/mapobjects/flag/flag1b.tga
+		blendfunc blend
+		rgbGen lightingdiffuse
+	}
+}
+
+models\mapobjects\flag\american
+{
+	cull twosided
+	{
+		map models/mapobjects/flag/american.tga
+		rgbGen lightingdiffuse
+	}
+}
+models\mapobjects\flag\flag1_escape
+{
+	cull twosided
+	{
+		map models/mapobjects/flag/flag1_escape.tga
+		rgbGen identity
+	}
+}
+
+models\mapobjects\flag\bannerflag
+{
+	cull twosided
+	{
+		map models\mapobjects\flag\bannerflag.tga
+		rgbGen lightingdiffuse
+	}
+}
+
+models\mapobjects\flag\british
+{
+	cull twosided
+	{
+		map models\mapobjects\flag\british.tga
+		blendfunc blend
+		rgbGen lightingdiffuse
+	}
+}
+
+
+models/mapobjects/torture/glass
+{
+	
+	//{
+	//	map textures/effects/tinfx.tga
+	//	blendfunc blend
+	//	rgbGen lightingdiffuse
+	//	tcGen environment 
+	//}
+	{ 
+		map models/mapobjects/test3/c_water2.tga
+		blendFunc GL_dst_color GL_one
+		rgbgen identity
+		tcmod scale 1 1
+		tcmod scroll .05 .05
+	}
+
+
+	{
+		map models/mapobjects/torture/glass.tga
+		blendfunc blend
+		tcmod scale 1 1
+		rgbGen identity
+	}
+	
+}
+
+models/mapobjects/torture/water
+{
+	
+	{
+		map models/mapobjects/torture/water.tga
+	//	blendFunc GL_dst_color GL_one
+	//	rgbgen identity
+		blendfunc blend
+		tcmod scale 3 3
+		rgbGen vertex
+	}
+	
+}
+
+models/mapobjects/torture/brain
+{
+	
+	{
+		map models/mapobjects/torture/brain.tga
+	//	blendFunc GL_dst_color GL_one
+		rgbgen identity
+	//	blendfunc blend
+	//	rgbGen vertex
+	}
+	
+}
+
+
+
+
+
+models/mapobjects/bodyparts/i_body1
+{
+	cull twosided
+
+	{
+		map models/mapobjects/bodyparts/i_body1.tga
+		rgbGen vertex
+	}
+}
+
+
+models/mapobjects/knight/knt3
+{
+	{
+		map textures/effects/tinfx.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen lightingdiffuse
+		tcGen environment 
+	}
+	{
+		map models/mapobjects/knight/knt3.tga
+		blendfunc blend
+		rgbGen lightingdiffuse
+	}
+}
+
+
+models/mapobjects/firehead/kid
+{
+	cull twosided
+	{
+		map models/mapobjects/test/kid.tga
+//		blendfunc blend
+		alphaFunc GE128
+		depthWrite
+		rgbGen vertex
+	}
+}
+
+models/mapobjects/knight/knt2
+{
+	{
+		map textures/effects/tinfx.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen lightingdiffuse
+		tcGen environment 
+	}
+	{
+		map models/mapobjects/knight/knt3.tga
+		blendfunc blend
+		rgbGen lightingdiffuse
+	}
+}
+
+
+//
+// Ridah, in-game skeleton requires a slightly different shader
+//
+skeletonSkin
+{
+    cull disable
+    surfaceparm alphashadow
+
+    {
+       	map models/mapobjects/skel/skel.tga
+       	alphaFunc GE128
+		depthWrite
+		rgbGen lightingdiffuse
+		alphaGen entity
+    }
+}
+
+//// glass shard /////
+
+models/shards/glass
+{
+	
+	surfaceparm trans	
+	cull none
+	qer_editorimage models/shards/glass.tga
+	qer_trans 	0.5
+     
+   {
+	//	map models/shards/glass.tga
+	//	map textures/effects/tinfx.tga
+		map textures/effects/wdfx4.tga
+          	tcgen environment
+		blendFunc GL_ONE GL_ONE
+		rgbGen identity
+	}
+}
+////skel///
+///models\players\zombie\sk_bod1
+//
+//{
+//  cull disable
+//    surfaceparm alphashadow
+//
+//    {
+//       	map models/players/zombie/sk_bod1.tga
+//       	alphaFunc GE128
+//	depthWrite
+//	rgbGen lightingdiffuse
+//    }
+//}
+
+
+
+
+
+//// test////
+
+models/mapobjects/test/how_bod1
+
+{
+    cull disable
+    surfaceparm alphashadow
+
+    {
+       	map models/mapobjects/test/how_bod1.tga
+       	alphaFunc GE128
+		depthWrite
+		rgbGen vertex
+    }
+}
+
+
+models/mapobjects/test/zom_helm
+
+{
+    cull twosided
+    surfaceparm alphashadow
+
+    {
+       	map models/mapobjects/test/zom_helm.tga
+       	alphaFunc GE128
+		depthWrite
+		rgbGen vertex
+    }
+}
+
+models/mapobjects/test/armor
+
+{
+    cull twosided
+//    surfaceparm alphashadow
+//
+    {
+       	map models/mapobjects/test/armor.tga
+//       	alphaFunc GE128
+//		depthWrite
+		rgbGen vertex
+    }
+}
+
+////babyg////
+
+models/mapobjects/piano/babyg
+
+{
+		cull twosided
+
+	{
+		map models/mapobjects/piano/babyg.tga
+		blendfunc gl_one gl_ZERO
+		rgbGen vertex
+	}
+	{
+		map textures/effects/tinfx.tga
+	//	map textures/effects/shine.tga
+		blendFunc GL_ONE_MINUS_DST_ALPHA GL_ONE
+		rgbGen identity
+		tcMod scale 1 1
+		tcGen environment 
+	}
+	{
+		map $lightmap
+		rgbGen identity
+		blendfunc filter
+	
+	
+	}
+}
+
+
+
+//// test////
+models/mapobjects/test/bg_gog
+			
+{
+	//cull twosided
+	
+	{
+		map models/mapobjects/test/bg_gog.tga
+		blendfunc GL_ONE_MINUS_SRC_ALPHA gl_src_alpha
+	//	blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	//	blendFunc add
+	//	alphaFunc GE128
+	//	depthWrite
+		rgbGen vertex
+	}
+}
+
+models/mapobjects/test/deth_body1
+			
+{
+	cull twosided
+	
+	{
+		map models/mapobjects/test/deth_body1.tga
+	//	blendfunc GL_ONE_MINUS_SRC_ALPHA gl_src_alpha
+	//	blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	//	blendFunc add
+	//	alphaFunc GE128
+	//	depthWrite
+		rgbGen vertex
+	}
+}
+models/mapobjects/test/deth_mon
+{
+	cull twosided
+	
+	{
+		map models/mapobjects/test/deth_mon.tga
+		blendfunc GL_ONE_MINUS_SRC_ALPHA gl_src_alpha
+		rgbGen vertex
+	}
+	
+	
+}
+
+models/players/frogman/frg_mglass
+{
+	cull twosided
+	
+	{
+		map models/players/frogman/frg_mglass.tga
+		blendfunc GL_ONE_MINUS_SRC_ALPHA gl_src_alpha
+		rgbGen vertex
+	}
+	
+	
+}
+
+models/players/sealoper/sl_engine
+{
+	cull twosided
+	{
+		map models/players/sealoper/sl_engine.tga
+		rgbgen lightingdiffuse
+	}
+}
+
+
+
+
+models/players/femzombie/wt_body1
+			
+{
+	cull twosided
+	
+	{
+		map models/players/femzombie/wt_body1.tga
+	//	blendfunc GL_ONE_MINUS_SRC_ALPHA gl_src_alpha
+	//	blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	//	blendFunc add
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingdiffuse
+	}
+}
+
+
+
+
+
+models/mapobjects/test/lg_glasses
+			
+{
+	//cull twosided
+	
+	{
+		map models/mapobjects/test/lg_glasses.tga
+		blendfunc GL_ONE_MINUS_SRC_ALPHA gl_src_alpha
+	//	blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	//	blendFunc add
+	//	alphaFunc GE128
+	//	depthWrite
+		rgbGen vertex
+	}
+	
+	
+}
+
+
+models/mapobjects/test/wt_body1
+			
+{
+	cull twosided
+	
+	{
+		map models/mapobjects/test/wt_body1.tga
+	//	blendfunc GL_ONE_MINUS_SRC_ALPHA gl_src_alpha
+	//	blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	//	blendFunc add
+		alphaFunc GE128
+		depthWrite
+		rgbGen diffuse
+	}
+	
+	
+}
+
+models/players/blackguard/bg_body1
+			
+{
+	cull twosided
+	
+	{
+		map models/players/blackguard/bg_body1.tga
+	//	blendfunc GL_ONE_MINUS_SRC_ALPHA gl_src_alpha
+	//	blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	//	blendFunc add
+	//	alphaFunc GE128
+	//	depthWrite
+		rgbGen lightingdiffuse
+	}
+	
+	
+}
+models/mapobjects/test/lg_body1
+			
+{
+	cull twosided
+	
+	{
+		map models/mapobjects/test/lg_body1.tga
+	//	blendfunc GL_ONE_MINUS_SRC_ALPHA gl_src_alpha
+	//	blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	//	blendFunc add
+	//	alphaFunc GE128
+	//	depthWrite
+		rgbGen vertex
+	}
+	
+	
+}
+
+
+
+models/mapobjects/test/rj_slop1
+			
+{
+	cull twosided
+	
+	{
+		map models/mapobjects/test/rj_slop1.tga
+		blendfunc GL_ONE_MINUS_SRC_ALPHA gl_src_alpha
+	//	blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	//	blendFunc add
+	//	alphaFunc GE128
+	//	depthWrite
+		rgbGen vertex
+	}
+	
+	
+}
+
+models/mapobjects/test/rj_body2
+
+{
+	cull twosided
+	
+	{
+		map models/mapobjects/test/rj_body2.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen vertex
+	}
+	
+	
+}
+
+models/players/rejectx/rj_glow
+
+{
+	cull twosided
+	
+	{
+		map models/players/rejectx/rj_glow.tga
+		blendfunc blend
+	//	tcmod turb 0 1 0 1
+		rgbGen identity
+	}
+	
+	
+}
+
+
+///remove///
+models/mapobjects/test/rj_glow
+
+{
+	cull twosided
+	
+	{
+		map models/mapobjects/test/rj_glow.tga
+		blendfunc blend
+	//	tcmod turb 0 1 0 1
+		rgbGen identity
+	}
+	
+	
+}
+
+
+
+models/players/rejectx/rj_stim
+
+{
+	//cull twosided
+	
+	{      
+        
+		map models/players/rejectx/rj_stim.tga
+                tcmod rotate 350
+		tcGen environment
+   		tcmod scale -1 -1
+		blendFunc GL_ONE GL_ZERO
+		rgbGen identity
+	} 
+      
+}
+
+
+
+models/mapobjects/test/rj_stim
+
+{
+	//cull twosided
+	
+	{      
+        
+		map models/mapobjects/test/rj_stim.tga
+                tcmod rotate 350
+		tcGen environment
+   		tcmod scale -1 -1
+		blendFunc GL_ONE GL_ZERO
+		rgbGen identity
+	} 
+      
+}
+
+models/players/drz/acc/drz_glass1
+{
+	cull twosided
+	
+	{
+		map models/players/drz/acc/drz_glass1.tga
+		blendfunc blend
+		rgbGen lightingdiffuse
+	}
+	
+	
+}
+
+models/players/drz/drz_mon
+{
+	cull twosided
+	
+	{
+		map models/players/drz/drz_mon.tga
+		blendfunc GL_ONE_MINUS_SRC_ALPHA gl_src_alpha
+		rgbGen lightingdiffuse
+	}
+	
+	
+}
+models/players/drz/drz_body1
+{
+	cull twosided
+	
+	{
+		map models/players/drz/drz_body1.tga
+	//	blendfunc GL_ONE_MINUS_SRC_ALPHA gl_src_alpha
+		rgbGen lightingdiffuse
+	}
+	
+	
+}
+models/players/drz/vin_body1
+{
+	cull twosided
+	
+	{
+		map models/players/drz/vin_body1.tga
+		rgbGen lightingdiffuse
+	}
+	
+	
+}
+
+models/players/partisan/prt_body1
+{
+	cull twosided
+	
+	{
+		map models/players/partisan/prt_body1.tga
+	//	blendfunc GL_ONE_MINUS_SRC_ALPHA gl_src_alpha
+		rgbGen lightingdiffuse
+	}
+	
+	
+}
+
+//// maxx eye ////
+
+models\mapobjects\eye\eye
+{
+	{
+		map models\mapobjects\eye\eye.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen identity
+	}
+	{
+		map textures/effects/wdfx.tga
+		blendFunc GL_ONE_MINUS_DST_ALPHA GL_ONE 
+		tcGen environment
+	}
+	{
+		map $lightmap
+		blendFunc GL_DST_COLOR GL_ONE_MINUS_DST_ALPHA
+		rgbGen identity
+	}
+}
+
+
+models\furniture\barrel\barrel_m01
+{
+
+	cull twosided
+	{
+		map models/furniture/barrel/barrel_m01.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen lightingdiffuse
+	}
+
+}
+
+models\furniture\barrel\barrel_m01g
+{
+
+	cull twosided
+	{
+		map models/furniture/barrel/barrel_m01.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen lightingdiffuse
+	}
+
+}
+
+
+
+//// maxx tank shader ///
+
+//----(SA) 
+//
+
+models\mapobjects\vehicles\sherman
+{
+	{
+		map models/mapobjects/vehicles/sherman.tga
+		rgbGen lightingdiffuse
+	}
+
+}
+
+models\mapobjects\vehicles\panzer
+{
+	{
+		map models/mapobjects/vehicles/panzer.tga
+		rgbGen lightingdiffuse
+	}
+
+}
+
+models/mapobjects/vehicles/tankside3
+{
+	cull twosided
+	{
+		map models/mapobjects/vehicles/tankside3.tga
+		rgbGen lightingdiffuse
+	}
+
+}
+
+models/mapobjects/vehicles/JEEP3
+{
+	{
+		map models/mapobjects/vehicles/JEEP3.tga
+		rgbGen lightingdiffuse
+	}
+
+}
+
+
+// models/mapobjects/vehicles/sherman_s
+models\mapobjects\furniture\sherman_s
+{
+	{
+		map models/mapobjects/furniture/sherman_s.tga
+//		rgbGen lightingDiffuse
+//		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		blendfunc blend
+		rgbGen identity
+	}
+
+}
+
+
+models\mapobjects\vehicles\sherman_s
+{
+	{
+		map models/mapobjects/vehicles/sherman_s.tga
+		blendfunc blend
+		rgbGen identity
+	}
+
+ }
+
+
+models/mapobjects/vehicles/sherman_s
+{
+	{
+		map models/mapobjects/vehicles/sherman_s.tga
+		blendfunc blend
+		rgbGen identity
+	}
+
+ }
+
+
+//models/mapobjects/vehicles/sherman
+models\mapobjects\vehicles\sherman_bak
+{
+
+	{
+		map models/mapobjects/vehicles/sherman.tga
+		rgbGen vertex 
+	//	rgbGen identity
+
+	}
+
+}
+
+models\mapobjects\vehicles\sherman_w
+{
+
+	{
+		map models/mapobjects/vehicles/sherman_w.tga
+	//	rgbGen vertex 
+		rgbGen identity
+
+	}
+
+}
+
+//////  skull maxx /////////
+
+models/mapobjects/skull/skull2a
+
+//{
+//    cull disable
+//    surfaceparm alphashadow
+//        {
+//           	map models/mapobjects/skull/skull2.tga
+//           	alphaFunc GE128
+//		depthWrite
+//		rgbGen vertex
+//        }
+//}
+
+
+
+{
+	{
+		map models/mapobjects/skull/skull2a.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	//	blendfunc GL_ONE GL_ONE
+	//	alphaFunc GE128
+	//	tcGen environment
+	//	blendFunc GL_ONE GL_ONE
+//		rgbGen vertex
+		rgbGen lightingDiffuse		// (SA) any objects external to the map (players/weapons/keys/etc) should use
+									// rgbGen lightingDiffuse.  No other rgbGen should be expected to work in 
+									// all situations.
+	}
+
+    
+
+
+	//{
+	//	map textures/effects/tinfxb.tga
+	//	tcGen environment
+	//	blendFunc GL_ONE GL_ONE
+	//}
+}
+
+textures/sfx/kenelectric
+{
+ 	{
+		map textures/sfx/kenelectric.tga
+                tcmod scale 1 1
+                tcmod rotate 2
+                tcmod scroll .5 .5
+		blendfunc GL_ONE GL_ONE
+		
+	}
+
+}
+
+textures/effects/tinfx2
+{
+	{
+		map textures/effects/tinfx2.tga
+		tcGen environment
+		tcmod scale 1 1
+		blendfunc GL_ONE GL_ONE
+		rgbGen identity
+	}
+}
+models/mapobjects/lamplight_y
+{
+	q3map_surfacelight 10000
+	light 1
+        cull disable
+	{
+                map textures/effects/envmapmach.tga
+		//map models/mapobjects/lamplight_y.tga
+		blendfunc GL_ONE GL_ONE
+		tcGen environment
+                rgbGen identity
+	}
+}
+
+
+
+////////////  goblet maxx env. ////
+
+models/mapobjects/goblet/gob1
+{
+	cull none
+
+	{
+		map models/mapobjects/goblet/gob1.tga
+		blendFunc GL_ONE GL_ZERO
+//		rgbGen vertex
+		rgbGen lightingDiffuse		// (SA) any objects external to the map (players/weapons/keys/etc) should use
+									// rgbGen lightingDiffuse.  No other rgbGen should be expected to work in 
+									// all situations.
+	}
+	{
+		map textures/effects/wdfx.tga
+		blendFunc GL_ONE_MINUS_DST_ALPHA GL_ONE 
+		tcGen environment
+	}
+//	{
+	//	map $lightmap
+	//	blendFunc GL_DST_COLOR GL_ONE_MINUS_DST_ALPHA
+	//	rgbGen identity
+//	}
+}
+//////////  mp40 maxx ///////////
+
+
+//models/weapons2/mp40/gun11
+//{
+//	cull none
+//
+//	{
+//		map models/weapons2/mp40/gun11.tga
+	//	blendFunc GL_ONE GL_ZERO
+//		rgbGen vertex
+//		rgbGen lightingDiffuse		// (SA) any objects external to the map (//players/weapons/keys/etc) should use
+///									// rgbGen lightingDiffuse.  No //other rgbGen should be expected to work in 
+									// all situations.
+//	}
+//	{
+	//	map textures/effects/chrome1.tga
+	//	blendFunc GL_ONE_MINUS_DST_ALPHA GL_ONE
+ 	//	tcGen environment
+	//	tcmod scale 4 4
+//		rgbGen vertex
+//	}
+//}
+
+//models/weapons2/mp40/gun11
+//{
+//	{
+//		map models/weapons2/mp40/gun11.tga
+//		blendFunc GL_ONE GL_ZERO
+//		rgbGen lightingdiffuse
+//	}
+//	{
+//		map textures/effects/tinfx4.tga
+//		blendFunc GL_ONE_MINUS_DST_ALPHA GL_ONE
+//		tcMod Scale 3 3 
+//		tcGen environment
+///	}
+//
+//}
+
+/// venom maxx ///
+
+models/weapons2/venom/venum1
+{
+
+//	{
+//		map models/weapons2/venom/venum1.tga
+//		alphaFunc GE128
+//		rgbGen lightingdiffuse
+//	}
+	{
+		map models/weapons2/venom/venum1aa.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen lightingdiffuse
+	}
+
+	{
+		map textures/effects/tinfx.tga
+		blendFunc GL_ONE_MINUS_DST_ALPHA GL_ONE
+		tcMod Scale 3 3 
+		tcGen environment
+	}
+
+
+}
+
+/// grenade maxx ///
+
+//models/ammo/grenade
+//{
+//	{
+//		map models/ammo/grenade.tga
+//		rgbGen lightingdiffuse
+//	}
+//	{
+//		map textures/effects/tinfx4.tga
+//		blendFunc GL_ONE_MINUS_DST_ALPHA GL_ONE
+//		tcMod Scale 3 3 
+//		tcGen environment
+//	}
+
+//}
+
+
+////////   debri maxx ///
+
+textures/town_wall/town_c38a1
+{
+	cull none
+
+	{
+		map textures/town_wall/town_c38a1.tga
+//		rgbGen vertex
+		rgbGen lightingDiffuse		// (SA) any objects external to the map (players/weapons/keys/etc) should use
+									// rgbGen lightingDiffuse.  No other rgbGen should be expected to work in 
+									// all situations.
+	}
+
+}
+
+////////// chandelier maxx ////////////
+
+models/mapobjects/chandelier/metal_m01
+{
+	cull none
+
+	{
+		map models/mapobjects/chandelier/metal_m01.tga
+		rgbGen vertex
+	}
+
+}
+
+models/mapobjects/chandelier/candle_m01
+{
+	cull none
+
+	{
+		map models/mapobjects/chandelier/candle_m01.tga
+		rgbGen vertex
+	}
+
+}
+
+ /// gun test maxx /////
+
+models/weapons2/handtest/gun11
+{
+	cull none
+
+	{
+		map models/weapons2/handtest/gun11.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen identity
+	}
+	{
+		map textures/effects/tinfx.tga
+		blendFunc GL_ONE_MINUS_DST_ALPHA GL_ONE 
+		tcGen environment
+	}
+	{
+	//	map $lightmap
+	//	blendFunc GL_DST_COLOR GL_ONE_MINUS_DST_ALPHA
+	//	rgbGen identity
+	}
+}
+
+
+
+	///  maxx quake3 skel ///
+
+bbmodels\mapobjects\skel\skel
+{
+    cull disable
+    surfaceparm alphashadow
+        {
+           	map models/mapobjects/skel/skel.tga
+           	alphaFunc GE128
+		depthWrite
+		rgbGen vertex
+        }
+}
+
+
+models/mapobjects/skel/skel
+{
+    cull disable
+    surfaceparm alphashadow
+
+        {
+        	map models/mapobjects/skel/skel.tga
+        	alphaFunc GE128
+		depthWrite
+		rgbGen vertex
+//		rgbgen lightingdiffuse
+        }
+}
+
+models/mapobjects/skel/skel2
+{
+    cull disable
+    surfaceparm alphashadow
+
+        {
+        	map models/mapobjects/skel/skel.tga
+        	alphaFunc GE128
+			depthWrite
+        }
+}
+
+
+models/mapobjects/miltary_trim/bags1_s
+
+{
+	{
+		map models/mapobjects/miltary_trim/bags1_s.tga
+		rgbGen vertex	
+	}
+
+}
+
+
+
+
+models/mapobjects/vehicles/wagon/metal_m05
+
+{
+	{
+		map models/mapobjects/vehicles/wagon/metal_m05.tga
+		rgbGen vertex	
+	}
+
+}
+
+models/mapobjects/vehicles/halftrack3
+
+{
+	{
+		map models/mapobjects/vehicles/halftrack3.tga
+		rgbGen vertex	
+	}
+
+}
+
+models/mapobjects/vehicles/wagon/wag_side
+
+
+{
+	{
+		map models/mapobjects/vehicles/wagon/wag_side.tga
+		rgbGen vertex	
+	}
+
+}
+
+models/mapobjects/vehicles/wagon/wag_whl
+{
+	cull twosided
+	{
+		map models/mapobjects/vehicles/wagon/wag_whl.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen vertex
+
+	}
+}
+
+models/mapobjects/vehicles/heinkel
+{
+	// cull twosided
+	{
+		map models/mapobjects/vehicles/heinkel.tga
+		blendfunc GL_ONE_MINUS_SRC_ALPHA gl_src_alpha
+	//	alphaFunc GE128
+		depthWrite
+		rgbGen vertex
+
+	}
+}
+
+models/mapobjects/vehicles/heinkel_b
+{
+	 cull twosided
+	{
+		map models/mapobjects/vehicles/heinkel_b.tga
+	//	blendfunc GL_ONE_MINUS_SRC_ALPHA gl_src_alpha
+		alphaFunc GE128
+		depthWrite
+		rgbGen vertex
+
+	}
+}
+
+models/mapobjects/light/bel_lamp2
+{
+	cull twosided
+	{
+		map models/mapobjects/light/bel_lamp2.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen vertex
+
+	}
+}
+models/mapobjects/light/bel_lampb
+{
+  
+	surfaceparm nomarks
+	q3map_lightimage textures/lightimage/amber.tga
+	q3map_surfaceLight 10000
+	light 1	
+	
+  	{
+		map models/mapobjects/light/bel_lamp.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen vertex
+	}
+	{
+		map models/mapobjects/light/bel_lamp.blend.tga
+		blendfunc GL_ONE GL_ONE
+	}
+
+	
+
+}
+models/mapobjects/light/bel_lampm
+{
+  
+	surfaceparm nomarks
+	q3map_lightimage textures/lightimage/amber.tga
+	q3map_surfaceLight 7000
+	light 1
+
+  	{
+		map models/mapobjects/light/bel_lamp.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen vertex
+		
+	}
+	{
+		map models/mapobjects/light/bel_lamp.blend.tga
+		blendfunc GL_ONE GL_ONE
+	}
+
+	
+
+}
+models/mapobjects/light/bel_lamp
+{
+  
+	surfaceparm nomarks
+	q3map_lightimage textures/lightimage/amber.tga
+	q3map_surfaceLight 5000	
+	light 1
+	
+  	{
+		map models/mapobjects/light/bel_lamp.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen vertex
+	}
+	{
+		map models/mapobjects/light/bel_lamp.blend.tga
+		blendfunc GL_ONE GL_ONE
+	}
+
+	
+
+}
+
+models/mapobjects/lamps/bel_lamp2k
+{
+  
+	surfaceparm nomarks
+	q3map_lightimage textures/lightimage/amber.tga
+	q3map_surfaceLight 1000	
+	light 1
+	
+  	{
+		map models/mapobjects/light/bel_lamp.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen vertex
+	}
+	{
+		map models/mapobjects/light/bel_lamp.blend.tga
+		blendfunc GL_ONE GL_ONE
+	}
+
+	
+
+}
+
+models/mapobjects/light/camplt_out
+{
+	{
+		map models/mapobjects/light/camplt_out.tga
+		rgbGen vertex	
+	}
+
+}
+
+models/mapobjects/light/camplt_in
+{
+  
+	surfaceparm nomarks
+	q3map_lightimage textures/lightimage/camplt_in.tga
+	q3map_surfacelight 7000
+	q3map_lightrgb 0.80 0.72 0.60
+	light 1
+  	{
+		map models/mapobjects/light/camplt_in.tga
+		blendFunc GL_ONE GL_ZERO
+	}
+	{
+		map models/mapobjects/light/camplt_in.blend.tga
+		blendfunc GL_ONE GL_ONE
+	}
+
+	
+
+}
+
+
+
+models/mapobjects/light/cage_lightna
+{
+	cull twosided
+	{
+		map models/mapobjects/light/cage_lightna.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen vertex
+
+	}
+}
+
+models/mapobjects/light/cage_lightn
+{
+	surfaceparm nomarks
+	q3map_lightimage textures/lightimage/cage_lightn.tga
+	q3map_surfacelight 7000
+	q3map_lightrgb 0.80 0.72 0.60
+	light 1
+	
+// cagelight white
+	
+	{
+		map models/mapobjects/light/cage_lightn.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen vertex
+	}
+	{
+		map models/mapobjects/light/cage_light.blendn.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+
+models/mapobjects/light/cage_light12k
+{
+	surfaceparm nomarks
+	q3map_lightimage textures/lightimage/cagelight_a.tga
+	q3map_surfacelight 12000
+	q3map_lightrgb 0.80 0.72 0.60
+	light 1
+	
+// cagelight white
+	
+	{
+		map models/mapobjects/light/cagelight_a.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen vertex
+	}
+	{
+		map models/mapobjects/light/cagelight.blenda.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+
+models/mapobjects/light/cage_light9k
+{
+	surfaceparm nomarks
+	q3map_lightimage textures/lightimage/cagelight_a.tga
+	q3map_surfacelight 9000
+	q3map_lightrgb 0.80 0.72 0.60
+	light 1
+	
+// cagelight white
+	
+	{
+		map models/mapobjects/light/cagelight_a.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen vertex
+	}
+	{
+		map models/mapobjects/light/cagelight.blenda.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+
+models/mapobjects/light/cage_light7k
+{
+	surfaceparm nomarks
+	q3map_lightimage textures/lightimage/cagelight_a.tga
+	q3map_surfacelight 7000
+	q3map_lightrgb 0.80 0.72 0.60
+	light 1
+	
+// cagelight white
+	
+	{
+		map models/mapobjects/light/cagelight_a.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen vertex
+	}
+	{
+		map models/mapobjects/light/cagelight.blenda.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+
+models/mapobjects/light/cage_light5k
+{
+	surfaceparm nomarks
+	q3map_lightimage textures/lightimage/cagelight_a.tga
+	q3map_surfacelight 5000
+	q3map_lightrgb 0.80 0.72 0.60
+	light 1
+	
+// cagelight white
+	
+	{
+		map models/mapobjects/light/cagelight_a.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen vertex
+	}
+	{
+		map models/mapobjects/light/cagelight.blenda.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+
+models/mapobjects/light/cage_light4k
+{
+	surfaceparm nomarks
+	q3map_lightimage textures/lightimage/cagelight_a.tga
+	q3map_surfacelight 4000
+	q3map_lightrgb 0.80 0.72 0.60
+	light 1
+	
+// cagelight white
+	
+	{
+		map models/mapobjects/light/cagelight_a.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen vertex
+	}
+	{
+		map models/mapobjects/light/cagelight.blenda.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+
+models/mapobjects/light/cage_light3k
+{
+	surfaceparm nomarks
+	q3map_lightimage textures/lightimage/cagelight_a.tga
+	q3map_surfacelight 3000
+	q3map_lightrgb 0.80 0.72 0.60
+	light 1
+	
+// cagelight white
+	
+	{
+		map models/mapobjects/light/cagelight_a.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen vertex
+	}
+	{
+		map models/mapobjects/light/cagelight.blenda.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+
+models/mapobjects/light/cage_light2k
+{
+	surfaceparm nomarks
+	q3map_lightimage textures/lightimage/cagelight_a.tga
+	q3map_surfacelight 2000
+	q3map_lightrgb 0.80 0.72 0.60
+	light 1
+	
+// cagelight white
+	
+	{
+		map models/mapobjects/light/cagelight_a.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen vertex
+	}
+	{
+		map models/mapobjects/light/cagelight.blenda.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+
+models/mapobjects/light/cage_light1k
+{
+	surfaceparm nomarks
+	q3map_lightimage textures/lightimage/cagelight_a.tga
+	q3map_surfacelight 1000
+	q3map_lightrgb 0.80 0.72 0.60
+	light 1
+	
+// cagelight white
+	
+	{
+		map models/mapobjects/light/cagelight_a.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen vertex
+	}
+	{
+		map models/mapobjects/light/cagelight.blenda.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+
+
+
+models/mapobjects/light/cagelight_a
+{
+	surfaceparm nomarks
+	q3map_lightimage textures/lightimage/cagelight_a.tga
+	q3map_surfacelight 7000
+	q3map_lightrgb 0.80 0.72 0.60
+	light 1
+	
+// cagelight white
+	
+	{
+		map models/mapobjects/light/cagelight_a.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen vertex
+	}
+	{
+		map models/mapobjects/light/cagelight.blenda.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+
+models/mapobjects/light/cagelight_r
+{
+	surfaceparm nomarks
+	q3map_lightimage textures/lightimage/cagelight_r.tga
+	q3map_surfacelight 7000
+	q3map_lightrgb 1.0 0.1 0.1
+	light 1
+	
+// cagelight white
+	
+	{
+		map models/mapobjects/light/cagelight_r.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen vertex
+	}
+	{
+		map models/mapobjects/light/cagelight.blendr.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+
+models/mapobjects/light/cagelight
+{
+	surfaceparm nomarks
+	q3map_lightimage textures/lightimage/cagelight_r.tga
+	q3map_surfacelight 7000
+	light 1
+	
+// cagelight white
+	
+	{
+		map models/mapobjects/light/cagelight.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen vertex
+	}
+	{
+		map models/mapobjects/light/cagelight.blend.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+
+models/mapobjects/light/light_m4
+{
+	surfaceparm nomarks
+	q3map_lightimage textures/lightimage/light_m4.tga
+	q3map_surfacelight 5000
+	light 1
+	
+	{
+		map models/mapobjects/light/light_m4.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen vertex
+	}
+	{
+		map textures/lights/light_m4.blend.tga
+		blendfunc GL_ONE GL_ONE
+	}
+
+}
+models/mapobjects/light/pendant1k
+{
+	surfaceparm nomarks
+	q3map_lightimage textures/lightimage/pendant.tga
+	q3map_surfacelight 5000
+	light 1
+
+	nofog
+	{
+		fog off
+		map models/mapobjects/light/pendant.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen vertex
+	}
+	{
+		fog on
+		map models/mapobjects/light/pendant.blend.tga
+		blendfunc GL_ONE GL_ONE
+	}
+
+}
+
+models/mapobjects/light/pendant
+{
+	surfaceparm nomarks
+	q3map_lightimage textures/lightimage/pendant.tga
+	q3map_surfacelight 5000
+	light 1
+	
+	{
+		map models/mapobjects/light/pendant.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen vertex
+	}
+	{
+		map models/mapobjects/light/pendant.blend.tga
+		blendfunc GL_ONE GL_ONE
+	}
+
+}
+
+
+models/players/ranger/wrack
+{
+      
+        {
+		map $whiteimage
+		rgbGen lightingDiffuse
+	}
+	{
+        	map models/players/ranger/wrack.tga
+		blendFunc GL_DST_COLOR GL_SRC_ALPHA
+		rgbGen identity
+		alphaGen lightingSpecular
+	}
+          
+}
+models/players/visor/gorre
+{    
+         {
+                  map textures/sfx/firewallb.tga
+                //map models/players/visor/gorre_fx.tga
+                // tcGen environment
+                blendFunc GL_ONE GL_ZERO
+                tcmod scale 3 3
+                tcMod turb 0 .5 0 .7
+                 tcMod scroll .05 -.05
+                //tcmod rotate 360
+                rgbGen identity
+	}  
+         {
+                  map textures/sfx/firewallb.tga
+                blendFunc GL_ONE GL_ONE
+                tcmod scale 3 3
+                tcMod turb 0 .2 0 .1
+                 tcMod scroll 1 -1
+                //tcmod rotate 360
+                rgbGen identity
+	}            
+        {
+		map models/players/visor/gorre.tga
+                blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		rgbGen lightingDiffuse
+	}
+}
+models/powerups/armor/newred
+{
+      
+        {
+		map $whiteimage
+		rgbGen lightingDiffuse
+	}
+	{
+        	map models/powerups/armor/newred.tga
+		blendFunc GL_DST_COLOR GL_SRC_ALPHA
+		rgbGen identity
+		alphaGen lightingSpecular
+	}
+          
+}
+models/powerups/armor/newyellow
+{
+      
+        {
+		map $whiteimage
+		rgbGen lightingDiffuse
+	}
+	{
+        	map models/powerups/armor/newyellow.tga
+		blendFunc GL_DST_COLOR GL_SRC_ALPHA
+		rgbGen identity
+		alphaGen lightingSpecular
+	}
+          
+}
+models/players/doom/f_phobos
+{    
+ 
+         {
+		map textures/effects/tinfx.tga
+                tcGen environment
+                blendFunc GL_ONE GL_ZERO              
+                rgbGen lightingDiffuse
+	}   
+         {
+                map models/players/doom/phobos_fx.tga
+                blendFunc GL_ONE GL_ONE
+                tcmod scale 1 1
+                tcMod scroll 2 -2
+                tcmod rotate 179
+                rgbGen identity
+	}    
+        {
+		map models/players/doom/f_phobos.tga
+                blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		rgbGen lightingDiffuse
+	}
+}
+models/players/doom/phobos
+{    
+         {
+                map models/players/doom/phobos_fx.tga
+                blendFunc GL_ONE GL_ZERO
+                tcmod scale 7 7
+                tcMod scroll 5 -5
+                tcmod rotate 360
+                rgbGen identity
+	}
+        {
+		map textures/effects/tinfx2.tga
+                tcGen environment
+                blendFunc GL_ONE GL_ONE              
+                rgbGen lightingDiffuse
+	}   
+        {
+		map models/players/doom/phobos.tga
+                blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		 rgbGen lightingDiffuse
+	}
+}
+textures/effects/bat
+{
+	qer_editorimage textures/effects/bat.tga
+    deformVertexes wave 10 sin 0 3 0 3
+    deformVertexes move 500 0 0   sawtooth 0 5 0 .1
+    deformVertexes move 0 0 7  sin 0 5 0 .5
+    cull disable
+   
+        {
+			map textures/effects/bat.tga
+			alphaFunc GE128
+			depthWrite
+			rgbGen identity
+        }
+
+
+}
+models/mapobjects/bat/bat
+{
+	qer_editorimage models/mapobjects/bat/bat.tga
+    deformVertexes wave 10 sin 0 3 0 3
+    deformVertexes move 500 0 0   sawtooth 0 5 0 .1
+    deformVertexes move 0 0 7  sin 0 5 0 .5
+    cull disable
+   
+        {
+                map models/mapobjects/bat/bat.tga
+                alphaFunc GE128
+		depthWrite
+		rgbGen identity
+        }
+
+
+}
+models/mapobjects/meteor
+{
+         deformVertexes move 0 0 10  sin 0 5 0 0.1
+        deformVertexes move 2 2 0   sin 0 9 0 0.05
+       
+    
+        {
+                map models/mapobjects/meteor.tga
+                rgbGen vertex
+                tcMod scale 4.90 2.234        
+	}
+
+
+}
+models/mapobjects/corpse/torso
+{    
+  deformVertexes wave 100 sin 0 .2 0 .2
+         {
+		map textures/liquids/proto_grueldark.tga
+                //tcGen environment
+                blendFunc GL_ONE GL_ZERO
+                tcmod scale 4 4
+                tcMod scroll 0 -.09
+                tcMod turb 0 0.05 0 .05
+                //rgbGen identity
+	}
+        //{
+	//	map textures/liquids/proto_grueldark.tga
+        //        //tcGen environment
+        //        blendFunc GL_ONE GL_ONE
+        //        tcmod scale 2 2
+        //        tcMod scroll 0 -.09
+       	//         tcMod turb 0 0.07 0 .08
+       	//         //rgbGen identity
+	//}       
+        {
+		map models/mapobjects/corpse/torso.tga
+                blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		rgbGen vertex
+	}
+}
+models/mapobjects/corpse/chain
+{
+    cull disable
+    
+        {
+                map models/mapobjects/corpse/chain.tga
+                alphaFunc GE128
+		depthWrite
+		rgbGen vertex
+        }
+
+
+}
+models/mapobjects/corpse/spine
+{
+    cull disable
+    
+        {
+                map models/mapobjects/corpse/spine.tga
+                alphaFunc GE128
+		depthWrite
+		rgbGen vertex
+        }
+
+
+}
+models/mapobjects/corpse/intestine
+{
+    
+    cull disable
+    
+        {
+                map models/mapobjects/corpse/intestine.tga
+                alphaFunc GE128
+		depthWrite
+		rgbGen vertex
+        }
+
+
+}
+models/mapobjects/corpse/intestine2
+{
+    cull disable
+    deformVertexes wave 100 sin 0 .6 0 .2
+    // surfaceparm	trans
+        {
+                map models/mapobjects/corpse/intestine2.tga
+                alphaFunc GE128
+		depthWrite
+		rgbGen vertex
+        }
+
+
+}
+models/players/lucy/h_femnoid
+{
+      cull none
+          
+        {
+                map models/players/lucy/h_femnoid.tga
+                depthWrite
+                rgbGen lightingDiffuse
+              
+        }
+        {
+		 
+		//map textures/effects/envmapcirc3.tga
+               
+                map models/mapobjects/bitch/hologirl2.tga
+                 tcgen environment
+                tcMod scroll -6 -.2
+                tcMod scale 1 1
+		blendFunc GL_ONE GL_ONE
+		 rgbGen identity
+                // rgbGen vertex
+                 rgbGen lightingDiffuse
+	}    
+		
+}
+models/players/lucy/femnoid
+{
+         cull none
+        
+        {
+                map models/players/lucy/femnoid.tga
+                alphaFunc GE128
+		depthWrite
+		//rgbGen identity
+                rgbGen lightingDiffuse
+              
+        }	
+        {
+		 
+		//map textures/effects/envmapcirc3.tga
+               
+                map models/mapobjects/bitch/hologirl2.tga
+                 tcgen environment
+                tcMod scroll -6 -.2
+                tcMod scale 1 1
+		blendFunc GL_ONE GL_ONE
+		//rgbGen identity
+                //rgbGen vertex
+                rgbGen lightingDiffuse
+	}    
+        
+}
+
+models/mapobjects/lamps/bot_wing2
+{
+    //deformVertexes wave 100   sin 0 .5 0 .5
+    //deformVertexes move 0 0 1   triangle 0 20 0 1
+    deformVertexes move 0 0 2   sin 0 5 0 0.3
+    deformVertexes move .6 .8 0   sin 0 9 0 0.1
+     deformVertexes wave 100   sin 0 .5 0 .5
+    cull disable
+    
+        {
+                map models/mapobjects/lamps/bot_wing2.tga
+                alphaFunc GE128
+		depthWrite
+		rgbGen vertex
+        }
+
+
+}
+models/mapobjects/lamps/bot_lamp2b
+{ 
+     cull disable
+     deformVertexes move 0 0 2   sin 0 5 0 0.3
+     deformVertexes move .6 .8 0   sin 0 9 0 0.1
+        {
+                map models/mapobjects/lamps/bot_lamp2b.tga
+                alphaFunc GE128
+		depthWrite
+		rgbGen vertex
+        }
+
+
+}
+models/mapobjects/lamps/bot_light
+{
+      cull disable
+      q3map_surfacelight	200
+      deformVertexes move 0 0 2   sin 0 5 0 0.3
+      deformVertexes move .6 .8 0   sin 0 9 0 0.1
+        {
+                map models/mapobjects/lamps/bot_light.tga
+		rgbGen identity
+        }
+
+
+}
+
+
+//*********************************
+
+      // corks model test ////
+//********************************
+	//
+	//
+models/mapobjects/characters/test2/body
+{
+	{
+		map models/mapobjects/characters/test2/body.tga
+		rgbGen vertex
+	}
+
+}
+
+
+models/mapobjects/characters/test2/head
+{
+	{
+		map models/mapobjects/characters/test2/head.tga
+		rgbGen vertex
+	}
+
+}
+
+models/mapobjects/characters/test/head
+{
+	{
+		map models/mapobjects/characters/test/head.tga
+		rgbGen vertex	
+	}
+
+}
+
+              
+models/mapobjects/characters/test/legs
+{
+	{
+		map models/mapobjects/characters/test/legs.tga
+		rgbGen vertex
+	}
+
+}
+
+models/mapobjects/lop/head
+{
+	{
+		map models/mapobjects/lop/head.tga
+		rgbGen vertex	
+	}
+
+}
+
+
+
+
+//**************//
+///bodyparts///
+//**************//
+
+
+
+models/mapobjects/bodyparts/bpblood
+{		
+     	surfaceparm alphashadow
+	cull twosided
+	{
+		map models/mapobjects/bodyparts/bpblood.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		rgbGen vertex
+	}
+
+}
+models/mapobjects/bodyparts/bpblood2
+{		
+     	surfaceparm alphashadow
+	cull twosided
+	{
+		map models/mapobjects/bodyparts/bpblood2.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		rgbGen vertex
+	}
+
+}
+
+models/mapobjects/bodyparts/bp2
+{
+	//deformVertexes wave 10 sin 0 2 0 .2
+	cull twosided
+
+	{
+            map models/mapobjects/bodyparts/bp2.tga
+		alphaFunc LT128
+		depthWrite
+		rgbGen vertex
+	}
+}
+models/mapobjects/bodyparts/skin1
+{
+	//deformVertexes wave 10 sin 0 2 0 .2
+	cull twosided
+
+	{
+            map models/mapobjects/bodyparts/skin1.tga
+		alphaFunc LT128
+		depthWrite
+		rgbGen vertex
+	}
+}
+
+models/mapobjects/bodyparts/naziarm
+{
+	//deformVertexes wave 10 sin 0 2 0 .2
+	cull twosided
+
+	{
+            map models/mapobjects/bodyparts/naziarm.tga
+		alphaFunc LT128
+		depthWrite
+		rgbGen vertex
+	}
+}
+models/mapobjects/bodyparts/hel_body1
+{
+	
+	cull twosided
+
+	{
+            map models/mapobjects/bodyparts/hel_body1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/mapobjects/zemph/drz_glass1
+{
+	
+	{
+            map models/mapobjects/zemph/drz_glass1.tga
+		blendfunc blend
+		rgbGen lightingdiffuse
+	}
+}
+
+
+
+models/mapobjects/zemph/drz_head4_blink
+{
+	
+	{
+            map models/mapobjects/zemph/drz_head4_blink.tga
+		rgbGen lightingdiffuse
+	}
+}
+models/mapobjects/zemph/drz_xbody1
+{
+	
+	cull twosided
+
+	{
+            map models/mapobjects/zemph/drz_xbody1.tga
+		rgbGen lightingdiffuse
+	}
+}
+
+models/mapobjects/zemph/drz_xlegs1
+{
+	
+
+	{
+            map models/mapobjects/zemph/drz_xlegs1.tga
+		rgbGen lightingdiffuse
+	}
+}
+
+//************************//
+//test//
+//************************//
+
+
+models/mapobjects/test4/naziarm
+{
+	//deformVertexes wave 10 sin 0 2 0 .2
+	cull twosided
+
+	{
+            map models/mapobjects/test4/naziarm.tga
+		alphaFunc LT128
+		depthWrite
+		rgbGen vertex
+	}
+}
+
+
+
+
+models/mapobjects/test4/bp2
+{
+	//deformVertexes wave 10 sin 0 2 0 .2
+	cull twosided
+
+	{
+            map models/mapobjects/test4/bp2.tga
+		alphaFunc LT128
+		depthWrite
+		rgbGen vertex
+	}
+}
+models/mapobjects/test4/skin1
+{
+	//deformVertexes wave 10 sin 0 2 0 .2
+	cull twosided
+
+	{
+            map models/mapobjects/test4/skin1.tga
+		alphaFunc LT128
+		depthWrite
+		rgbGen vertex
+	}
+}
+models/mapobjects/test4/bpblood
+{		
+       //qer_trans 0.50
+      //deformVertexes wave 10 sin 0 2 0 .2
+	surfaceparm alphashadow
+	cull twosided
+	{
+		map models/mapobjects/test4/bpblood.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		rgbGen vertex
+	}
+
+}
+//{
+//	//deformVertexes wave 10 sin 0 2 0 .2
+//	cull twosided
+//
+//	{
+//           map models/mapobjects/test4/bpblood.tga
+//		alphaFunc LT128
+//		depthWrite
+//		rgbGen vertex
+//	}
+//}
+
+
+
+
+
+
+
+
+
+
+
+
+
+///zom///
+
+//models/players/zombie/zom_head1
+//{      
+//        {
+//		map models/players/zombie/zomeye.tga
+//               tcmod rotate 350
+//	//	tcmod stretch scale 1 .4 0 .1
+//
+//        	tcmod scroll 1 .1
+//	//	tcmod scale 2 2
+//		tcmod turb 1 .5 0 .5
+ //               blendFunc GL_ONE GL_ZERO
+//	//	blendFunc blend
+//		rgbGen wave sin .5 .5 0 .5
+//		rgbGen identity
+///	} 
+//       {
+//       	map models/players/zombie/zom_head1.tga
+//		blendFunc blend
+//		rgbGen lightingdiffuse
+//	}
+//}
+
+
+//models/players/zombie/zom_body1
+//{
+//	cull twosided
+//	surfaceparm	trans
+//	{
+//		map models/players/zombie/zom_body1.tga
+//	//	blendFunc add
+//		alphaFunc GE128
+//		depthWrite
+//		rgbGen lightingDiffuse
+//		alphaGen vertex
+//	}
+//	
+//	
+//}
+models/players/zombie/slag_body1
+{
+	cull twosided
+	surfaceparm	trans
+	{
+		map models/players/zombie/slag_body1.tga
+	//	blendFunc add
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+		alphaGen vertex
+	}
+	
+	
+}
+
+
+models/players/zombie/zom_legs1
+{
+	cull twosided
+	surfaceparm	trans
+	{
+		map models/players/zombie/zom_legs1.tga
+	//	blendFunc add
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+		alphaGen vertex
+	}
+	
+	
+}
+
+models/players/zombie/slag_legs1
+{
+	cull twosided
+	surfaceparm	trans
+	{
+		map models/players/zombie/slag_legs1.tga
+	//	blendFunc add
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+		alphaGen vertex
+	}
+	
+	
+}
+
+models/players/zombie/zom_head1
+{
+	cull twosided
+	surfaceparm	trans
+	{
+		map models/players/zombie/zom_head1.tga
+	//	blendFunc add
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+		alphaGen vertex
+	}
+	
+	
+}
+
+models/players/zombie/slag_head1
+{
+	cull twosided
+	surfaceparm	trans
+	{
+		map models/players/zombie/slag_head1.tga
+	//	blendFunc add
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+		alphaGen vertex
+	}
+	
+	
+}
+
+///zom///
+models/mapobjects/test3/zom_body1
+{
+	cull twosided
+	{
+            map models/mapobjects/test3/zom_body1.tga
+///		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		alphaFunc LT128
+		depthWrite
+		rgbGen vertex
+
+	}
+}
+models/mapobjects/test3/zom_body
+{
+	cull twosided
+	{
+            map models/mapobjects/test3/zom_body.tga
+///		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		alphaFunc LT128
+		depthWrite
+		rgbGen vertex
+
+	}
+}
+
+models/mapobjects/test3/zom_engine
+{      
+        {
+		map textures/effects/regenmap3.tga
+                tcmod rotate 350
+		tcmod stretch scale 1 .4 0 .1
+
+                // tcmod scroll 3 1
+	//	tcmod scale 2 2
+	//	tcmod stretch 1 .5 0 2
+                blendFunc GL_ONE GL_ZERO
+		rgbGen wave sin 1 .6 0 .5
+	} 
+        {
+        	map models/mapobjects/test3/zom_engine.tga
+		blendFunc blend
+		rgbGen vertex
+	}
+}
+
+
+
+///undead2///
+models/mapobjects/undead/und_body1
+{
+	cull twosided
+	{
+            map models/mapobjects/undead/und_body1.tga
+///		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		alphaFunc LT128
+		depthWrite
+		rgbGen vertex
+
+	}
+}
+
+models/mapobjects/undead/und_leg1
+{
+	cull twosided
+	{
+            map models/mapobjects/undead/und_leg1.tga
+///		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		alphaFunc LT128
+		depthWrite
+		rgbGen vertex
+
+	}
+}
+
+models/mapobjects/test3/u_head1
+{
+	cull none
+
+	{
+            map models/mapobjects/test3/u_head1.tga
+///		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		alphaFunc LT128
+		depthWrite
+		rgbGen vertex
+
+	}
+}
+
+
+///undead///
+///models/mapobjects/test3/u_body1
+//{
+///	cull none
+//
+//	{
+//            map models/mapobjects/test3/u_body1.tga
+///		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+//		alphaFunc LT128
+//		depthWrite
+//		rgbGen vertex
+//
+//	}
+//}
+
+models/mapobjects/test3/u_legs1
+{
+	cull none
+
+	{
+            map models/mapobjects/test3/u_legs1.tga
+///		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		alphaFunc LT128
+		depthWrite
+		rgbGen vertex
+
+	}
+}
+
+//models/mapobjects/test3/u_head1
+//{
+//	cull none
+//
+//	{
+//            map models/mapobjects/test3/u_head1.tga
+///		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+//		alphaFunc LT128
+//		depthWrite
+//		rgbGen vertex
+//
+//	}
+//}
+
+
+////amer////
+
+
+
+models/mapobjects/test/r_body1
+{
+	{
+		map models/mapobjects/test/r_body1.tga
+		rgbGen vertex	
+	}
+
+}
+
+models/mapobjects/test/r_head1
+{
+	{
+		map models/mapobjects/test/r_head1.tga
+		rgbGen vertex	
+	}
+
+}
+
+models/mapobjects/test/r_legs1
+{
+	{
+		map models/mapobjects/test/r_legs1.tga
+		rgbGen vertex	
+	}
+
+}
+
+models/mapobjects/test/bp
+{
+	{
+		map models/mapobjects/test/bp.tga
+		rgbGen vertex	
+	}
+
+}
+
+models/mapobjects/test/r_belt1
+{
+	{
+		map models/mapobjects/test/r_belt1.tga
+		rgbGen vertex	
+	}
+
+}
+
+
+////elite gard////
+
+
+
+models/mapobjects/test/eg_body
+{
+	{
+		map models/mapobjects/test/eg_body.tga
+		rgbGen vertex	
+	}
+
+}
+
+
+models/mapobjects/test/eg_head
+{
+	{
+		map models/mapobjects/test/eg_head.tga
+		rgbGen vertex	
+	}
+
+}
+
+models/mapobjects/test/eg_legs
+{
+	{
+		map models/mapobjects/test/eg_legs.tga
+		rgbGen vertex	
+	}
+
+}
+
+/////////brokclone////////
+
+models/mapobjects/test3/c_glass2
+{
+	cull twosided
+        {
+		map models/mapobjects/test3/c_glass2.tga
+		blendFunc GL_ONE GL_SRC_ALPHA
+		rgbGen identity
+	}
+	//{
+	//	map textures/effects/envmapdim.tga
+	//	tcGen environment
+	//	blendfunc GL_ONE GL_ONE
+	//	rgbGen vertex
+	{
+		map $lightmap
+		blendFunc GL_DST_COLOR GL_ONE_MINUS_DST_ALPHA
+		rgbGen identity
+	}
+
+	//{ 
+	//	map models/mapobjects/test3/c_ice1.tga
+	//	blendFunc GL_ONE GL_SRC_ALPHA
+	//	blendFunc blend
+	//	rgbgen diffuse
+	//	tcmod scale -1 -1
+	//	tcmod scroll .0 -0.5
+	//}
+
+}
+
+
+
+////////clonetub//////
+
+models/mapobjects/test3/c_glass1
+{
+
+    q3map_surfacelight 600
+    light 1
+
+
+     {
+		map models/mapobjects/test3/c_glass1.tga
+		blendFunc GL_ONE GL_SRC_ALPHA
+		rgbGen identity
+	}
+	//{
+	//	map textures/effects/envmapdim.tga
+	//	tcGen environment
+	//	blendfunc GL_ONE GL_ONE
+	//	rgbGen vertex
+	{
+		map $lightmap
+		blendFunc GL_DST_COLOR GL_ONE_MINUS_DST_ALPHA
+		rgbGen identity
+	}
+
+	//{ 
+	//	map models/mapobjects/test3/c_ice1.tga
+	//	blendFunc GL_ONE GL_SRC_ALPHA
+	//	blendFunc blend
+	//	rgbgen diffuse
+	//	tcmod scale -1 -1
+	//	tcmod scroll .0 -0.5
+	//}
+
+}
+
+
+models/mapobjects/test3/c_water1
+{
+   		deformVertexes wave 64 sin .25 .25 0 .5
+  	//	deformVertexes wave 100 sin 0 .2 0 .2
+
+
+
+        
+		{ 
+			map models/mapobjects/test3/c_bibbles.tga
+			blendFunc GL_dst_color GL_one
+			rgbgen identity
+			tcmod scale -1 -1
+			tcmod scroll .0 -0.5
+		}
+		{ 
+			map models/mapobjects/test3/c_water2.tga
+			blendFunc GL_dst_color GL_one
+		//	nolightmap
+			rgbgen identity
+			tcmod scale 1 1
+			tcmod scroll .025 .025
+		}
+
+	
+		{
+			map $lightmap
+			blendFunc GL_dst_color GL_zero
+			rgbgen identity		
+		}
+	
+	
+
+	// 		END
+	//}
+
+}
+
+models/mapobjects/test3/c_bod1
+
+
+{
+        cull none 
+		//sort additive	// alphaFunc with a later blend pass doesn't
+						// make its own sort properly
+        	deformVertexes move 0 0 .7  sin 0 5 0 0.1 
+    		deformVertexes wave 100 sin 0 .2 0 .2
+
+
+       // //{
+	//	map models/mapobjects/test3/c_bod1.tga
+	//	blendFunc GL_ONE GL_SRC_ALPHA
+	//	rgbGen identity
+	//}
+	{
+                map models/mapobjects/test3/c_bod1.tga
+                // blendfunc gl_src_alpha gl_one_minus_src_alpha
+                alphaFunc GE128
+                depthWrite
+                rgbGen identity
+               
+        }
+
+	{
+                map models/mapobjects/test3/hologirl2.tga
+                //tcgen environment
+                tcgen base
+		tcMod scroll -6 -.2
+                tcMod scale 1 1
+		blendFunc GL_ONE GL_ONE
+		rgbGen identity
+               //rgbGen vertex
+                //rgbGen lightingDiffuse
+	}    
+        
+}
+
+models/mapobjects/test3/c_tube
+
+{
+	{
+		map textures/effects/regenmap4.tga
+                tcmod rotate 350
+	//	tcmod stretch scale 1 .4 0 .1
+
+                // tcmod scroll 3 1
+	//	tcmod scale 2 2
+	//	tcmod stretch 1 .5 0 2
+                blendFunc GL_ONE GL_ZERO
+		rgbGen wave sin 1 .8 0 2
+	}
+	{
+                map models/mapobjects/test3/c_tube.tga
+                blendfunc blend
+                rgbGen vertex
+               
+        }
+
+ 
+
+}
+
+
+//knight//
+models/mapobjects/knight/knt
+
+//{
+//	{
+//		map textures/effects/tinfx.tga
+//		blendFunc GL_ONE_MINUS_DST_ALPHA GL_ONE
+//		rgbGen identity
+//		tcMod scale 1.5 1.5
+//		tcGen environment 
+//	}
+//	
+//	{
+//		map models/mapobjects/knight/knt.tga
+//		blendfunc gl_one gl_ZERO
+//		rgbGen vertex
+//	}
+//	{
+//		map $lightmap
+//		rgbGen identity
+//		blendfunc filter
+//
+//	}
+//}
+	
+{
+	{
+		map textures/effects/tinfx.tga
+		blendfunc blend
+		rgbGen identity
+		tcGen environment 
+	}
+	{
+		map models/mapobjects/knight/knt.tga
+		blendfunc blend
+		rgbGen identity
+	}
+	{
+		map $lightmap
+		rgbGen identity
+		blendfunc filter
+	}
+}
+
+
+
+
+
+
+
+
+//// 
+/////venom sol/////
+
+
+
+models/characters/venom/v_head1
+//models/mapobjects/test3/v_head1
+{
+	{
+		map models/characters/venom/v_head1.tga	
+	//	map models/mapobjects/test3/v_head1.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen lightingdiffuse
+	//	rgbGen vertex
+
+	}
+	{
+		map textures/effects/tinfx.tga
+		blendFunc GL_ONE_MINUS_DST_ALPHA GL_ONE
+		tcmod scale 2 2
+		tcGen environment
+		rgbgen lightingdiffuse
+	}
+	//{
+	//	map $lightmap
+	//	blendFunc GL_DST_COLOR GL_ONE_MINUS_DST_ALPHA
+	//	rgbGen identity
+	//}
+}
+
+models/mapobjects/test3/v_body1
+{
+	{
+		map models/mapobjects/test3/v_body1.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen identity
+	}
+	{
+		map textures/effects/tinfx.tga
+		blendFunc GL_ONE_MINUS_DST_ALPHA GL_ONE
+		tcmod scale 2 2
+		tcGen environment
+	}
+	{
+		map $lightmap
+		blendFunc GL_DST_COLOR GL_ONE_MINUS_DST_ALPHA
+		rgbGen vertex
+	}
+}
+
+models/mapobjects/test3/v_legs1
+{
+	{
+		map models/mapobjects/test3/v_legs1.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen identity
+	}
+	{
+		map textures/effects/tinfx.tga
+		blendFunc GL_ONE_MINUS_DST_ALPHA GL_ONE
+		tcmod scale 2 2
+		tcGen environment
+	}
+	{
+		map $lightmap
+		blendFunc GL_DST_COLOR GL_ONE_MINUS_DST_ALPHA
+		rgbGen vertex
+	}
+}
+
+
+models/mapobjects/test/v_body1
+{
+	{
+		map models/mapobjects/test/v_body1.tga
+		rgbGen vertex	
+	}
+
+}
+
+
+models/mapobjects/test/v_legs1
+{
+	{
+		map models/mapobjects/test/v_legs1.tga
+		rgbGen vertex	
+	}
+
+}
+
+
+
+///models/players/venom/v_head1
+//{
+//	{
+//		map textures/effects/tinfx.tga
+//		blendfunc GL_ONE GL_ZERO
+//		tcMod turb 0 0.015 0 0.025
+//		rgbGen diffuse
+//		tcGen environment
+//	}
+//
+//	{
+//		map models/players/venom/v_head1.tga
+//		blendFunc GL_ONE_MINUS_SRC_ALPHA GL_SRC_ALPHA
+//		rgbGen diffuse	
+//		alphaGen lightingSpecular
+//	}
+//
+//}
+
+//models/mapobjects/test/v_head1
+//{
+//	{
+//		map textures/effects/tinfx.tga
+//		blendfunc GL_ONE GL_ZERO
+//		tcMod turb 0 0.015 0 0.025
+//		rgbGen vertex
+//		tcGen environment
+//	}
+//
+//	{
+//		map models/mapobjects/test/v_head1.tga
+//		blendFunc GL_ONE_MINUS_SRC_ALPHA GL_SRC_ALPHA
+//		rgbGen vertex	
+//		alphaGen lightingSpecular
+//	}
+//
+//}
+//{
+//	{
+//		map models/mapobjects/test/v_head1.tga
+//		rgbGen vertex	
+//	}
+//}
+
+models/mapobjects/test/v_bp1
+{
+	{
+		map $whiteimage
+//		rgbGen lightingDiffuse
+		rgbGen vertex
+	}
+	{
+		map models/mapobjects/test/v_bp1.tga
+		blendFunc GL_DST_COLOR GL_SRC_ALPHA
+		rgbGen identity
+		alphaGen lightingSpecular
+	}
+}
+
+
+models/mapobjects/test3/v_bp1
+
+{      
+        {
+		map textures/effects/org.tga
+                tcmod rotate 350
+	//	tcmod stretch scale 1 .4 0 .1
+
+                // tcmod scroll 3 1
+	//	tcmod scale 2 2
+	//	tcmod stretch 1 .5 0 2
+                blendFunc GL_ONE GL_ZERO
+		rgbGen wave sin 1 .6 0 .5
+	} 
+        {
+        	map models/mapobjects/test3/v_bp1.tga
+		blendFunc blend
+		rgbGen vertex
+	}
+}
+
+
+
+models/mapobjects/test/v_belt1
+{
+	{
+		map models/mapobjects/test/v_belt1.tga
+		rgbGen vertex	
+	}
+
+}
+
+
+models/mapobjects/test/vgun
+{
+	{
+		map models/mapobjects/test/vgun.tga
+		rgbGen vertex	
+	}
+
+}
+
+
+
+models/mapobjects/test/eye1
+{
+	{
+		map models/mapobjects/test/eye1.tga
+		rgbGen vertex	
+	}
+	{
+		map models/mapobjects/test/venom_gogs_fx.tga	
+		blendfunc GL_ONE GL_ONE
+		tcMod scroll 1.2 9.3
+		
+	}
+}
+
+models/players/venom/eye1
+{
+	{
+		map models/players/venom/eye1.tga
+		rgbGen vertex	
+	}
+	{
+		map models/players/venom/venom_gogs_fx.tga	
+		blendfunc GL_ONE GL_ONE
+		tcMod scroll 1.2 9.3
+		
+	}
+}
+
+
+////trenchcoat///////
+models/players/infantry/t_legs1
+
+{
+	cull twosided
+	{
+		map models/players/infantry/t_legs1.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen lightingdiffuse
+	//	rgbGen identity
+	}
+
+}
+
+	
+
+
+////loper///
+models/players/loper/elec1_bak
+{
+	cull twosided
+	{
+		map models/players/loper/elec1.tga
+		blendFunc GL_ONE GL_ONE
+		rgbGen identity
+	}
+
+}
+
+models/players/loper/elec1
+{
+	cull twosided
+	{
+//		blendFunc blend
+		blendFunc add
+		animMap 13 models/players/loper/elec1.tga models/players/loper/elec2.tga models/players/loper/elec3.tga 
+	//	rgbGen wave sin 1 .6 0 .5
+		rgbGen identity
+
+	}
+	
+
+}
+
+
+
+////lowertest//////
+
+models/mapobjects/test/elec1
+{
+	cull twosided
+	{
+//		blendFunc blend
+		blendFunc add
+		animMap 15 models/mapobjects/test/elec1.tga models/mapobjects/test/elec2.tga models/mapobjects/test/elec3.tga
+		//rgbGen wave sin 1 .6 0 .5
+	}
+}
+
+
+
+
+
+
+models/players/loper/lop_lower1
+{      
+        {
+		map models/players/loper/spark.tga
+                tcmod rotate 350
+		tcmod scale -1 -1
+		blendFunc GL_ONE GL_ZERO
+		rgbGen identity
+	} 
+        {
+        	map models/players/loper/lop_lower1.tga
+		blendFunc blend
+		rgbGen lightingdiffuse
+	}
+}
+models/players/loper/lop_head1
+{
+	cull twosided
+	{
+		map models/players/loper/lop_head1.tga
+		alphaFunc GE128
+		rgbGen lightingdiffuse
+
+	}
+
+}
+
+models/mapobjects/test/lophead
+{
+	{
+		map models/mapobjects/test/lophead.tga
+		rgbGen vertex	
+	}
+
+}
+
+models/mapobjects/test/lopbody
+{
+	{
+		map models/mapobjects/test/lopbody.tga
+		rgbGen vertex	
+	}
+
+}
+
+models/mapobjects/test/loplower
+{
+	{
+		map models/mapobjects/test/loplower.tga
+		rgbGen vertex	
+	}
+
+}
+
+//models/mapobjects/lop/elec1
+//{
+//	deformVertexes wave 10 sin 0 2 0 .2
+//	cull twosided
+//
+//	{
+//		map models/mapobjects/tree/elec1.tga
+//		blendfunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+//		alphaFunc GT0
+//		depthWrite
+//		rgbGen vertex	
+//	}
+//}
+
+/////cintest///
+models/mapobjects/shadtest/cin
+{    
+ 
+        {
+		map models/mapobjects/shadtest/chrome1.tga
+                tcGen environment
+                blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA              
+                rgbGen lightingDiffuse
+
+	 }   
+         {      map models/players/venom/eye1.tga  
+//             	blendFunc GL_ONE GL_ONE 
+             	blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		tcmod scale 1 1
+                tcMod scroll 2 -2
+               	tcmod rotate 179
+                rgbGen lightingDiffuse
+	}    
+        {
+		map models/mapobjects/shadtest/cin.tga
+//                blendFunc GL_ZERO GL_ONE_MINUS_SRC_COLOR
+//		rgbGen exactVertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA		
+		alphaFunc GE128
+		depthWrite
+		rgbGen vertex
+
+	}
+}
+
+
+
+
+// maxx tree test ////
+	//GL_ONE_MINUS_SRC_ALPHA
+
+	//
+	//
+
+models/mapobjects/tree/branch3a
+{
+	surfaceparm alphashadow
+
+
+	deformVertexes wave 194 sin 0 2 0 .1
+	deformVertexes wave 30 sin 0 1 0 .3
+	deformVertexes wave 194 sin 0 1 0 .4
+
+	cull twosided
+
+	{
+            map models/mapobjects/tree/branch3.tga
+
+
+		alphaFunc GE128
+		depthWrite
+		rgbGen vertex
+
+	}
+}
+
+
+models/mapobjects/tree/branch4
+{
+	surfaceparm alphashadow
+
+
+	deformVertexes wave 194 sin 0 2 0 .1
+	deformVertexes wave 30 sin 0 1 0 .3
+	deformVertexes wave 194 sin 0 1 0 .4
+
+	cull twosided
+
+	{
+            map models/mapobjects/tree/branch4.tga
+
+
+		alphaFunc GE128
+		depthWrite
+		rgbGen vertex
+
+	}
+}
+
+
+////c test////
+models/mapobjects/test/tree
+{
+	surfaceparm alphashadow
+
+
+	deformVertexes wave 194 sin 0 2 0 .1
+	deformVertexes wave 30 sin 0 1 0 .3
+	deformVertexes wave 194 sin 0 1 0 .4
+
+	cull twosided
+
+	{
+            map models/mapobjects/test/tree.tga
+
+
+		alphaFunc GE128
+		depthWrite
+		rgbGen vertex
+
+	}
+}
+
+models/mapobjects/tree/branch5
+{
+	surfaceparm alphashadow
+
+
+	deformVertexes wave 194 sin 0 2 0 .1
+	deformVertexes wave 30 sin 0 1 0 .3
+	deformVertexes wave 194 sin 0 1 0 .4
+
+	cull twosided
+
+	{
+            map models/mapobjects/tree/branch5.tga
+
+
+		alphaFunc GE128
+		depthWrite
+		rgbGen vertex
+
+	}
+}
+
+
+models/mapobjects/tree/branch6
+{
+	surfaceparm alphashadow
+
+
+	deformVertexes wave 194 sin 0 2 0 .1
+	deformVertexes wave 30 sin 0 1 0 .3
+	deformVertexes wave 194 sin 0 1 0 .4
+
+	cull twosided
+
+	{
+            map models/mapobjects/tree/branch6.tga
+
+
+		alphaFunc GE128
+		depthWrite
+		rgbGen vertex
+
+	}
+}
+
+models/mapobjects/tree/pine3
+{
+	surfaceparm alphashadow
+
+
+	deformVertexes wave 194 sin 0 2 0 .1
+	deformVertexes wave 30 sin 0 1 0 .3
+	deformVertexes wave 194 sin 0 1 0 .4
+
+	cull twosided
+
+	{
+            map models/mapobjects/tree/pine3.tga
+
+
+		alphaFunc GE128
+		depthWrite
+		rgbGen identity
+
+	}
+}
+
+models/mapobjects/tree/branch8
+{
+	surfaceparm alphashadow
+
+
+	deformVertexes wave 194 sin 0 2 0 .1
+	deformVertexes wave 30 sin 0 1 0 .3
+	deformVertexes wave 194 sin 0 1 0 .4
+
+	cull twosided
+
+	{
+            map models/mapobjects/tree/branch8.tga
+
+
+		alphaFunc GE128
+		depthWrite
+		rgbGen vertex
+
+	}
+}
+
+
+models/mapobjects/tree/trunck3
+{
+	{
+		map models/mapobjects/tree/trunck3.tga
+		rgbGen identity	
+	}
+
+}
+
+
+
+//
+// this is the current trunk on the tree (SA)
+//
+models/mapobjects/tree/trunck2
+{
+	{
+		map models/mapobjects/tree/trunck2.tga
+		rgbGen vertex	
+	}
+
+}
+//
+//     ////maxx truck test/////
+//
+
+models/mapobjects/vehicles/truckside4
+
+
+{
+
+	cull twosided
+
+	{
+            map models/mapobjects/vehicles/truckside4.tga
+		alphaFunc GE128
+		depthWrite
+//		rgbGen vertex
+//		rgbGen lightingdiffuse
+		rgbGen identity
+	}
+}
+
+/// jason mauser texture temp ///
+
+models/mapobjects/nazi/mauser
+{
+	{
+		map models/mapobjects/weapons/mauser.tga
+		rgbGen vertex	
+	}
+
+}
+
+
+//
+//     ////maxx scale nazi test soldier/////
+//
+models/mapobjects/nazi/temphead
+{
+	{
+		map models/mapobjects/nazi/temphead.tga
+		rgbGen vertex	
+	}
+
+}
+
+models/mapobjects/nazi/tempupper
+{
+	{
+		map models/mapobjects/nazi/tempupper.tga
+		rgbGen vertex	
+	}
+
+}
+
+models/mapobjects/nazi/templower
+{
+	{
+		map models/mapobjects/nazi/templower.tga
+		rgbGen vertex	
+	}
+
+}
+
+models/mapobjects/nazi/sten
+{
+	{
+		map models/mapobjects/nazi/sten.tga
+		rgbGen vertex	
+	}
+
+}
+
+
+///
+///
+///
+models/mapobjects/lamps/beam
+{
+        surfaceparm trans	
+        surfaceparm nomarks	
+        surfaceparm nonsolid
+	surfaceparm nolightmap
+        deformVertexes move 0 0 2   sin 0 5 0 0.3
+        deformVertexes move .6 .8 0   sin 0 9 0 0.1
+	cull none
+        //nopicmip
+	{
+		map models/mapobjects/lamps/beam.tga
+                tcMod Scroll .3 0
+                blendFunc GL_ONE GL_ONE
+        }
+        {
+		map models/mapobjects/lamps/beam.tga
+                tcMod Scroll -.3 0
+                blendFunc GL_ONE GL_ONE
+        }
+     
+}
+
+///////////////////////////////////
+/// Start of Floating Skull Bot  //
+///////////////////////////////////
+
+models/mapobjects/lamps/bot_flare
+{
+        deformVertexes autoSprite
+        deformVertexes move 0 0 3   sin 0 5 0 0.1
+        deformVertexes move 2 2 0   sin 0 9 0 0.05
+        surfaceparm	trans
+	surfaceparm nomarks
+	surfaceparm nolightmap
+	cull none
+    
+        {
+                clampmap models/mapobjects/lamps/bot_flare.tga
+                blendFunc GL_ONE GL_ONE
+                tcMod rotate 20
+                
+                
+        }
+
+
+}
+
+models/mapobjects/lamps/bot_flare2
+{
+        deformVertexes move 0 0 3   sin 0 5 0 0.1
+        deformVertexes move 2 2 0   sin 0 9 0 0.05
+        deformVertexes wave 100 sin 0 1 0 9
+        surfaceparm	trans
+	surfaceparm nomarks
+	surfaceparm nolightmap
+	cull none
+    
+        {
+                map models/mapobjects/lamps/bot_flare2.tga
+                blendFunc GL_ONE GL_ONE
+                
+        }
+
+
+}
+
+models/mapobjects/lamps/bot_lamp
+{
+        deformVertexes move 0 0 3   sin 0 5 0 0.1
+        deformVertexes move 2 2 0   sin 0 9 0 0.05
+    
+        {
+                map models/mapobjects/lamps/bot_lamp.tga
+                rgbGen vertex
+                
+        }
+
+
+}
+models/mapobjects/lamps/bot_lamp2
+{
+        deformVertexes move 0 0 3   sin 0 5 0 0.1
+        deformVertexes move 2 2 0   sin 0 9 0 0.05
+    
+        {
+                map models/mapobjects/lamps/bot_lamp2.tga
+                rgbGen vertex
+                
+        }
+
+
+}
+models/mapobjects/lamps/bot_wing
+{
+    deformVertexes move 0 0 3   sin 0 5 0 0.1
+    deformVertexes move 2 2 0   sin 0 9 0 0.05
+    deformVertexes wave 100   sin 0 .5 0 .5
+    cull disable
+    
+        {
+                map models/mapobjects/lamps/bot_wing.tga
+                alphaFunc GE128
+		depthWrite
+		rgbGen vertex
+        }
+
+
+}
+models/mapobjects/gratelamp/gratetorch
+{
+    cull disable
+    
+        {
+                map models/mapobjects/gratelamp/gratetorch.tga
+                alphaFunc GE128
+		depthWrite
+		rgbGen vertex
+        }
+
+
+}
+models/mapobjects/gratelamp/gratetorch2b
+{
+    cull disable
+    
+        {
+                map models/mapobjects/gratelamp/gratetorch2b.tga
+                alphaFunc GE128
+		depthWrite
+		rgbGen vertex
+        }
+
+
+}
+models/mapobjects/chain/chain3
+{
+        {
+		map $whiteimage
+		rgbGen identity
+	}
+	{
+		map models/mapobjects/chain/chain3.tga
+		blendFunc GL_DST_COLOR GL_SRC_ALPHA
+		rgbGen identity
+		alphaGen lightingSpecular
+	}
+        {
+		map models/mapobjects/chain/chain3.tga
+		//blendFunc GL_ONE GL_ONE
+                blendFunc GL_DST_COLOR GL_ZERO
+		rgbGen identity
+	}
+       
+       
+}
+
+models/flags/flagbits
+{
+               cull none
+	      // deformVertexes wave 100 sin 0 5 0 .7
+	 {
+                map models/flags/flagbits.tga
+                //blendfunc gl_src_alpha gl_one_minus_src_alpha
+                alphaFunc GE128
+                rgbGen lightingDiffuse
+                depthWrite
+        }
+
+
+}
+models/flags/r_flag2
+{
+      
+	//deformVertexes wave 100 sin 4 3 0 0.3
+        deformVertexes wave 30 sin 0 3 0 .8
+        deformVertexes wave 194 sin 0 3 0 .4
+        deformVertexes wave 300 sin 0 4 0 .1
+        cull none
+        
+        {
+		map models/flags/r_flag2.tga
+		 rgbGen lightingDiffuse
+	}
+        {
+		map textures/effects/blueflagmap.tga
+                tcGen environment
+                tcmod scale 9 3
+                tcmod scroll .1 .7
+                
+                blendFunc GL_ONE GL_ONE
+                 rgbGen lightingDiffuse
+	}
+        {
+		map models/flags/r_flag2.tga
+                blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	        rgbGen lightingDiffuse
+	}
+}
+models/flags/b_flag2
+{
+      
+	//deformVertexes wave 100 sin 4 3 0 0.3
+        deformVertexes wave 194 sin 0 3 0 .4
+        cull none
+        
+        {
+		map models/flags/b_flag2.tga
+		 rgbGen lightingDiffuse
+	}
+        {
+		map textures/effects/redflagmap.tga
+                tcGen environment
+                tcmod scale 9 3
+                tcmod scroll .1 .7
+                
+                blendFunc GL_ONE GL_ONE
+                 rgbGen lightingDiffuse
+	}
+        {
+		map models/flags/b_flag2.tga
+                blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	        rgbGen lightingDiffuse
+	}
+}
+models/flags/flag_red
+{
+               cull none
+	       deformVertexes wave 90 sin 1 5.6 1 .4
+               deformVertexes wave 100 sin 1 2 1 .9
+               deformVertexes wave 50 sin 1 .5 1 1
+	 {
+                map models/flags/flag_red.tga
+                //blendfunc gl_src_alpha gl_one_minus_src_alpha
+                //alphaFunc GE128
+                blendFunc GL_ONE GL_ONE
+                rgbGen lightingDiffuse
+                depthWrite
+        }
+
+
+}
+models/mapobjects/bitch/hologirl
+{
+        cull none 
+		//sort additive	// alphaFunc with a later blend pass doesn't
+						// make its own sort properly
+         deformVertexes move 0 0 .7  sin 0 5 0 0.2
+      
+      
+        {
+                map models/mapobjects/bitch/hologirl.tga
+                // blendfunc gl_src_alpha gl_one_minus_src_alpha
+                alphaFunc GE128
+                depthWrite
+                rgbGen vertex
+               
+        }
+        {
+		 
+		//map textures/effects/envmapcirc3.tga
+               
+                map models/mapobjects/bitch/hologirl2.tga
+                 tcgen environment
+                tcMod scroll -6 -.2
+                tcMod scale 1 1
+		blendFunc GL_ONE GL_ONE
+		rgbGen identity
+                //rgbGen vertex
+	}    
+		
+
+}
+models/mapobjects/bitch/bitch02
+{
+	cull none
+	
+	{
+		Map models/mapobjects/bitch/bitch02.tga
+		blendFunc GL_ONE GL_ONE
+                tcGen environment
+                tcMod scroll 0 0.3
+	}	
+      
+      
+	
+}
+models/mapobjects/barrel/barrel2
+{
+	
+	{
+		Map models/mapobjects/barrel/barrel2.tga
+                rgbgen vertex
+               
+	}	
+        {
+		clampmap models/mapobjects/barrel/barrel2fx.tga
+		blendFunc GL_ONE GL_ONE
+               // rgbgen wave triangle 1 1.4 0 9.5
+                tcMod rotate 403
+	}	
+        {
+		clampmap models/mapobjects/barrel/barrel2fx.tga
+		blendFunc GL_ONE GL_ONE
+               // rgbgen wave triangle 1 1 0 8.7
+                tcMod rotate -100
+	}	
+	
+}
+models/weaphits/electric
+{
+	cull none
+	
+	{
+		clampmap models/weaphits/electric.tga
+		blendFunc GL_ONE GL_ONE
+                rgbgen wave triangle .8 2 0 9
+                tcMod rotate 360
+	}	
+        {
+		clampmap models/weaphits/electric.tga
+		blendFunc GL_ONE GL_ONE
+                rgbgen wave triangle 1 1.4 0 9.5
+                tcMod rotate -202
+	}	
+	
+}
+models/mapobjects/flares/electric
+{
+	
+
+	q3map_surfacelight	200
+
+	surfaceparm	trans
+	surfaceparm nomarks
+	surfaceparm nolightmap
+	cull none
+	
+	{
+		clampmap models/mapobjects/flares/electric.tga
+		blendFunc GL_ONE GL_ONE
+                rgbgen wave triangle .8 2 0 9
+                tcMod rotate 360
+	}	
+        {
+		clampmap models/mapobjects/flares/electric.tga
+		blendFunc GL_ONE GL_ONE
+                rgbgen wave triangle 1 1.4 0 9.5
+                tcMod rotate -202
+	}	
+	
+}
+models/players/anarki/anarki_board
+
+{
+        {
+                map models/players/anarki/anarki_board.tga
+                rgbGen vertex
+        }
+        {
+		
+		map models/players/anarki/anarki_board2.tga
+		tcGen environment
+                tcmod scroll 1 0
+		rgbGen lightingDiffuse
+		blendfunc gl_ONE gl_ONE 		
+	}
+}
+
+//models/players/anarki/anarki_g
+//
+//{
+//        {
+//                map models/players/anarki/anarki_g.tga
+//                rgbGen vertex
+//        }
+//        {
+//		
+//		map models/players/anarki/anarki_g2.tga
+//		rgbGen lightingDiffuse
+//                rgbGen wave triangle 0 1 0 .5
+//		blendfunc gl_ONE gl_ONE 		
+//	   }
+//}
+//
+models/mapobjects/wallhead/femhead
+
+{
+        deformVertexes wave 100 sin 0 .7 0 .2
+        //deformVertexes wave 100 sin 0 1 1 .1
+        cull disable
+
+        {
+                map models/mapobjects/wallhead/femhead3.tga
+                rgbGen vertex
+        }
+	{
+	//animMap 0.5 models/mapobjects/wallhead/femhead4.tga 	//models/mapobjects/wallhead/femhead2.tga
+                map models/mapobjects/wallhead/femhead4.tga
+		blendFunc	GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		alphaGen	wave sin 0 1 1 .1
+                 // alphaGen	wave triangle 0 .7 0 .2
+                rgbGen vertex
+	}	
+	
+}
+models/mapobjects/wallhead/wallhead_eye
+
+{
+       
+       
+        {
+                animMap 0.2 models/mapobjects/wallhead/wallhead_eye.tga 		models/mapobjects/wallhead/wallhead_eye2.tga 
+                rgbGen vertex
+        }
+	
+
+}
+models/mapobjects/wallhead/wallhead
+
+{
+       
+       
+        {
+             map models/mapobjects/wallhead/wallhead.tga
+             rgbGen vertex
+        }
+	
+}
+//models/mapobjects/wallhead/femhead
+//{
+//   deformVertexes wave 100 sin 0 .7 0 .2
+//   cull disable
+//    
+//          
+//        {
+//                map models/mapobjects/wallhead/femhead2.tga
+//                rgbGen vertex
+//        }
+//        {
+//                map models/mapobjects/wallhead/femhead.tga
+//                Blendfunc GL_ONE GL_ONE
+//                rgbGen vertex
+//                rgbGen wave triangle 0 1 0 .05
+//        }
+// 
+//}
+
+//models/mapobjects/wallhead/tongue
+//{
+//	{
+//		//rgbGen lightingDiffuse
+//		map $whiteimage
+//                rgbGen vertex
+//	}
+//	{
+//		map models/mapobjects/wallhead/tongue.tga
+//		blendFunc GL_DST_COLOR GL_SRC_ALPHA
+//		rgbGen identity
+//		alphaGen lightingSpecular
+//	}
+//}
+
+models/players/mynx/sonja_shiny
+{
+        {
+             map models/players/mynx/sonja_shiny.tga
+             rgbGen lightingDiffuse
+	}
+         {
+		map textures/effects/tinfx2.tga
+		tcGen environment
+		//blendFunc GL_DST_COLOR GL_ZERO
+		blendFunc GL_ONE GL_ONE
+                rgbGen lightingDiffuse
+	}
+	
+        
+}
+models/players/razor/malaki
+{
+      
+        {
+		map $whiteimage
+		rgbGen lightingDiffuse
+	}
+        //{
+	//	map textures/effects/tinfx.tga
+        //        tcGen environment
+        //        blendFunc GL_ONE GL_ONE
+        //        rgbGen lightingDiffuse
+	//}
+	{
+        	map models/players/razor/malaki.tga
+		blendFunc GL_DST_COLOR GL_SRC_ALPHA
+		rgbGen identity
+		alphaGen lightingSpecular
+	}
+          
+}
+models/mapobjects/scoreboard/s_name
+{
+	sort additive
+	cull disable
+    deformVertexes text0
+	{
+		map gfx/2d/bigchars.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		rgbGen identity
+	}
+}
+
+
+models/mapobjects/scoreboard/s_score
+{
+	sort additive
+	cull disable
+    deformVertexes text1
+	{
+		map gfx/2d/bigchars.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		rgbGen identity
+	}
+}
+
+
+//models/weapons2/lightning/crackle1
+//{
+//	sort additive
+//	cull disable
+//	
+//	{
+//		animMap 15 models/weapons2/lightning/crackle1.tga models/weapons2/lightning/crackle2.tga models/weapons2/lightning/crackle3.tga models/weapons2/lightning/crackle4.tga models/weapons2/lightning/crackle5.tga models/weapons2/lightning/crackle6.tga models/weapons2/lightning/crackle7.tga models/weapons2/lightning/crackle8.tga
+//		blendFunc GL_ONE GL_ONE
+//	}
+//		
+//}
+
+models/weapons2/lightning/button
+{
+        {
+		map models/weapons2/lightning/button.tga
+		blendFunc GL_ONE GL_ONE
+		rgbGen wave sin 1 1 0 1		
+	}
+	
+}
+
+models/weapons2/lightning/glass
+{
+        {
+		map models/weapons2/lightning/glass.tga
+	}
+	{
+		map textures/effects/envmapdim.tga
+		tcGen environment
+		blendfunc GL_ONE GL_ONE
+		rgbGen lightingDiffuse
+	}
+}
+models/weapons2/lightning/trail
+{
+	{
+		map models/weapons2/lightning/trail.tga
+		tcMod scroll 3.1 1
+                rgbgen wave triangle 1 2 0 7
+		blendfunc GL_ONE GL_ONE
+	}
+        {
+		map models/weapons2/lightning/trail.tga
+		tcMod scroll -1.7 1
+                rgbgen wave triangle 1 1.1 0 5.1
+		blendfunc GL_ONE GL_ONE
+	}
+}
+models/weapons2/lightning/trail2
+{
+	{
+		map models/weapons2/lightning/trail2.tga
+		tcMod scroll 3.1 1
+                rgbgen wave triangle 1 2 0 7
+		blendfunc GL_ONE GL_ONE
+	}
+        {
+		map models/weapons2/lightning/trail2.tga
+		tcMod scroll -1.7 1
+                rgbgen wave triangle 1 1.1 0 5.1
+		blendfunc GL_ONE GL_ONE
+	}
+}
+
+models/weapons2/lightning/trail1
+{
+	sort additive
+	cull disable
+	
+	{
+		animMap 15 models/weapons2/lightning/trail1.tga models/weapons2/lightning/trail2.tga models/weapons2/lightning/trail3.tga models/weapons2/lightning/trail4.tga
+		blendFunc GL_ONE GL_ONE
+		rgbGen vertex				
+	}
+	
+}
+
+models/weapons2/lightning/ball1
+{
+	sort additive
+	cull disable
+	
+	{
+		animMap 15 models/weapons2/lightning/ball1.tga models/weapons2/lightning/ball2.tga
+		blendFunc GL_ONE GL_ONE
+		rgbGen vertex				
+	}
+	
+}
+
+models/mapobjects/slamp/slamp3
+{
+    deformVertexes autoSprite2
+    surfaceparm	trans
+	surfaceparm nomarks
+	surfaceparm nolightmap
+	cull none
+   q3map_surfacelight	100
+    
+        {
+                map models/mapobjects/slamp/slamp3.tga
+                blendFunc GL_ONE GL_ONE
+                
+        }
+
+
+}
+models/mapobjects/slamp/slamp2
+{
+    cull disable
+    surfaceparm	trans
+	surfaceparm nomarks
+	surfaceparm nolightmap
+    
+        {
+                map models/mapobjects/slamp/slamp2.tga
+                blendFunc GL_ONE GL_ONE
+        }
+        {
+		map textures/effects/envmapdimb.tga
+		tcGen environment
+		blendfunc GL_ONE GL_ONE
+	        //rgbGen lightingDiffuse
+	}
+
+
+}
+
+models/mapobjects/lightning/white/white1
+{
+	deformVertexes wave 100 sin 0 1 0 5
+        q3map_surfacelight	3000
+
+	surfaceparm	trans
+	surfaceparm nomarks
+	surfaceparm nolightmap
+	cull none
+	
+	{
+		animMap 15 models/mapobjects/lightning/white/white1.tga models/mapobjects/lightning/white/white2.tga models/mapobjects/lightning/white/white3.tga models/mapobjects/lightning/white/white4.tga models/mapobjects/lightning/white/white5.tga models/mapobjects/lightning/white/white6.tga models/mapobjects/lightning/white/white7.tga models/mapobjects/lightning/white/white8.tga
+		blendFunc GL_ONE GL_ONE
+		rgbGen vertex				
+	}
+	
+}
+
+models/mapobjects/lightning/red/red01
+{
+	deformVertexes wave 100 sin 0 1 0 5
+        q3map_surfacelight	3000
+
+	surfaceparm	trans
+	surfaceparm nomarks
+	surfaceparm nolightmap
+	cull none
+	
+	{
+		animMap 15 models/mapobjects/lightning/red/red01.tga models/mapobjects/lightning/red/red02.tga models/mapobjects/lightning/red/red03.tga models/mapobjects/lightning/red/red04.tga models/mapobjects/lightning/red/red05.tga models/mapobjects/lightning/red/red06.tga models/mapobjects/lightning/red/red07.tga models/mapobjects/lightning/red/red08.tga
+		blendFunc GL_ONE GL_ONE
+		rgbGen vertex				
+	}
+	
+}
+
+models/mapobjects/lightning/yel/yel01
+{
+	deformVertexes wave 100 sin 0 1 0 5
+        q3map_surfacelight	3000
+
+	surfaceparm	trans
+	surfaceparm nomarks
+	surfaceparm nolightmap
+	cull none
+	
+	{
+		animMap 15 models/mapobjects/lightning/yel/yel01.tga models/mapobjects/lightning/yel/yel02.tga models/mapobjects/lightning/yel/yel03.tga models/mapobjects/lightning/yel/yel04.tga models/mapobjects/lightning/yel/yel05.tga models/mapobjects/lightning/yel/yel06.tga models/mapobjects/lightning/yel/yel07.tga models/mapobjects/lightning/yel/yel08.tga
+		blendFunc GL_ONE GL_ONE
+		rgbGen vertex				
+	}
+	
+}
+
+models/mapobjects/lightning/blu/blu01
+{
+	deformVertexes wave 100 sin 0 1 0 5
+        q3map_surfacelight	3000
+
+	surfaceparm	trans
+	surfaceparm nomarks
+	surfaceparm nolightmap
+	cull none
+	
+	{
+		animMap 15 models/mapobjects/lightning/blu/blu01.tga models/mapobjects/lightning/blu/blu02.tga models/mapobjects/lightning/blu/blu03.tga models/mapobjects/lightning/blu/blu04.tga models/mapobjects/lightning/blu/blu05.tga models/mapobjects/lightning/blu/blu06.tga models/mapobjects/lightning/blu/blu07.tga models/mapobjects/lightning/blu/blu08.tga
+		blendFunc GL_ONE GL_ONE
+		rgbGen vertex				
+	}
+	
+}
+
+models/mapobjects/pitted_rust_ps
+{
+     cull disable
+     
+        {
+                map models/mapobjects/pitted_rust_ps.tga
+                rgbGen vertex
+        }
+
+
+}
+
+models/mapobjects/signs/bioh
+{
+     cull disable
+     
+        {
+                map models/mapobjects/signs/bioh.tga
+                rgbGen vertex
+        }
+
+
+}
+models/mapobjects/gratelamp/gratelamp
+{
+    cull disable
+    
+        {
+                map models/mapobjects/gratelamp/gratelamp.tga
+                alphaFunc GE128
+		depthWrite
+		rgbGen vertex
+        }
+
+
+}
+models/mapobjects/gratelamp/gratelamp_flare
+{
+	cull none
+	{
+		map models/mapobjects/gratelamp/gratelamp_flare.tga
+		blendFunc GL_ONE GL_ONE
+		rgbGen vertex
+	}
+
+//	deformVertexes autoSprite
+//
+//	q3map_surfacelight	300
+//
+//	surfaceparm	trans
+//	surfaceparm nomarks
+//	surfaceparm nolightmap
+//	cull none
+//	
+//	{
+//		map models/mapobjects/gratelamp/gratelamp_flare.tga
+//		blendFunc GL_ONE GL_ONE
+//	}	
+	
+}
+
+models/weapons2/grenadel/ring
+{
+	
+	{
+		map models/weapons2/grenadel/ring.tga
+        }
+
+        {
+                map textures/effects/envmapdim.tga
+		tcGen environment
+		blendFunc GL_ONE GL_ONE
+                //rgbGen identity
+        }
+}
+models/mapobjects/chain/chain
+{
+     cull disable
+        {
+                map models/mapobjects/chain/chain.tga
+                alphaFunc GE128
+		depthWrite
+		//rgbGen vertex
+        }
+
+
+}
+models/mapobjects/chain/chain2
+{
+     cull disable
+    deformVertexes autoSprite2
+        {
+                map models/mapobjects/chain/chain2.tga
+                alphaFunc GE128
+		depthWrite
+		rgbGen vertex
+        }
+
+
+}
+models/mapobjects/chain/chain2_end
+{
+     cull disable
+    deformVertexes autoSprite2
+        {
+                map models/mapobjects/chain/chain2_end.tga
+                alphaFunc GE128
+		depthWrite
+		rgbGen vertex
+        }
+
+
+}
+models/mapobjects/tree/branch
+{
+     cull disable
+     deformVertexes wave 100 sin 0 .1 0 .2
+      surfaceparm	trans
+        {
+                map models/mapobjects/tree/branch.tga
+                alphaFunc GE128
+		depthWrite
+		//rgbGen identity
+                //rgbGen lightingDiffuse
+                rgbGen vertex
+        }
+
+
+}
+models/players/orbb/orbb_tail
+{
+	
+	{
+		map models/players/orbb/orbb_tail.tga
+		blendFunc GL_ONE GL_ONE
+                tcmod scroll 0 .5
+		rgbGen wave sin .5 .25 0 .5		
+	}
+}
+models/players/orbb/orbb_tail_blue
+{
+	
+	{
+		map models/players/orbb/orbb_tail_blue.tga
+		blendFunc GL_ONE GL_ONE
+                tcmod scroll 0 .5
+		rgbGen wave sin .5 .25 0 .5		
+	}
+}
+models/players/orbb/orbb_light
+{
+	{
+		map models/players/orbb/orbb_light.tga
+		rgbGen wave sin 1 1 0 1
+		
+	}
+}
+models/players/orbb/orbb_light_blue
+{
+	{
+		map models/players/orbb/orbb_light_blue.tga
+		rgbGen wave sin 1 1 0 1
+		
+	}
+}
+models/players/orbb/orbb_h2
+{
+	
+	{
+		map models/players/orbb/orbb_h2.tga
+                rgbGen lightingDiffuse
+        }
+
+        {
+                map textures/effects/tinfx2.tga
+		tcGen environment
+		blendFunc GL_ONE GL_ONE
+                rgbGen lightingDiffuse
+        }
+      
+}
+
+models/players/orbb/red_h
+{
+	
+	{
+		map models/players/orbb/red_h.tga
+                rgbGen lightingDiffuse
+        }
+
+        {
+                clampmap models/players/orbb/red_hfx.tga
+		tcMod rotate 256 
+		blendFunc GL_ONE GL_ONE
+        }
+       
+}
+models/players/orbb/blue_h
+{
+	
+	{
+		map models/players/orbb/blue_h.tga
+                rgbGen lightingDiffuse
+        }
+
+        {
+                clampmap models/players/orbb/blue_hfx.tga
+		tcMod rotate 256 
+		blendFunc GL_ONE GL_ONE
+        }
+       
+}
+models/mapobjects/teleporter/transparency2
+{
+   cull disable
+            
+        {
+                map models/mapobjects/teleporter/transparency2.tga
+                blendfunc GL_ONE GL_ONE
+                tcMod scroll .1 .2
+        }
+
+}
+
+models/flags/b_flag
+{
+               cull disable
+	       deformVertexes wave 100 sin 0 3 0 .7
+		   
+        {
+               map models/flags/b_flag.tga
+              
+        }
+
+
+}
+
+models/flags/r_flag
+{
+               cull disable
+	       deformVertexes wave 100 sin 0 3 0 .7
+		   
+        {
+               map models/flags/r_flag.tga
+              
+        }
+
+
+}
+models/flags/pole
+{
+	  
+        {
+             map models/flags/skull.tga
+		tcGen environment
+		rgbGen lightingDiffuse	
+                
+        }
+
+
+}
+models/flags/skull
+{
+	  
+        {
+             map models/flags/skull.tga
+		//tcGen environment
+		rgbGen lightingDiffuse	
+                
+        }
+
+
+}
+models/players/hunter/hunter_f
+{
+     deformVertexes wave 100 sin 0 .3 0 .2
+     cull disable
+        {
+                map models/players/hunter/hunter_f.tga
+                //blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+                //alphaFunc GT0
+                alphaFunc GE128
+		depthWrite
+		rgbGen identity
+        }
+
+
+}
+
+models/players/uriel/uriel_wing
+{
+     deformVertexes wave 100 sin 0 1 0 .2
+
+        {
+                map models/players/uriel/uriel_wing.tga
+                //blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+                //alphaFunc GT0
+                alphaFunc GE128
+		depthWrite
+		rgbGen identity
+        }
+
+
+}
+models/players/uriel/uriel_h
+{
+        {
+     map	models/players/uriel/uriel_h.tga
+        }
+	{
+		map	models/players/uriel/uriel_h_glo.tga
+		blendfunc GL_ONE GL_ONE
+		rgbGen wave triangle .5 1 0 .1
+		
+	}
+}
+
+models/players/sleeg/torso
+{
+	{
+		map	models/players/sleeg/torso.tga
+		rgbGen vertex
+		
+	}
+	
+	{
+		map	models/players/sleeg/torso_glo.tga
+		blendfunc GL_ONE GL_ONE
+		rgbGen wave triangle .5 1 0 .4
+		
+	}
+}
+
+models/players/bitterman/g_bitterman
+{
+	{
+		map models/players/bitterman/g_bitterman.tga	
+                tcGen environment
+
+	}
+
+	
+}
+
+menu/ken/panel
+{
+   cull disable
+            
+        {
+                map menu/ken/panel.tga
+                blendfunc GL_ONE GL_ONE
+                
+        }
+        {
+                map menu/ken/panel_fx.tga
+                blendfunc GL_ONE GL_ONE
+                tcMod scroll 2.2 5.3
+                rgbGen wave triangle .5 .5 0 .2
+        }
+        {
+                map menu/ken/panel_fx.tga
+                blendfunc GL_ONE GL_ONE
+                tcMod scroll -3.5 -1.8
+                rgbGen wave triangle .7 .5 0 .5
+        }
+        {
+                map menu/ken/borders.tga
+                blendfunc GL_ONE GL_ONE
+                
+        }
+        {
+                map menu/ken/text.tga
+                blendfunc GL_ONE GL_ONE
+                
+        }
+
+}
+
+models/mapobjects/bitch/orb
+{
+	deformVertexes autoSprite
+
+	q3map_surfacelight	70
+
+	surfaceparm	trans
+	surfaceparm nomarks
+	surfaceparm nolightmap
+	cull none
+	
+	{
+		clampmap models/mapobjects/bitch/orb.tga
+		blendFunc GL_ONE GL_ONE
+                tcMod rotate 30
+	}	
+	
+}
+
+models/mapobjects/bitch/forearm
+{
+        {
+                map models/mapobjects/bitch/forearm.tga
+                rgbGen vertex  
+        }
+	{
+               map models/mapobjects/bitch/forearm01.tga
+               blendfunc GL_ONE GL_ONE
+               tcMod scroll 2.2 0
+             
+        }
+        {
+               map models/mapobjects/bitch/forearm02.tga
+               blendfunc GL_ONE GL_ONE
+               tcMod scroll -1.1 0
+             
+        }
+}
+
+models/players/parkr/parkr_head
+{
+	{
+		map textures/effects/envmap2.tga
+		tcGen environment	
+	}
+}
+
+models/players/parkr/parkr_chest
+{
+         {
+                map models/players/parkr/parkr_chest.tga
+        }
+	{
+		AnimMap 4 models/players/parkr/parkr_chest_red.tga models/players/parkr/parkr_chest_blu.tga
+	       blendfunc GL_ONE GL_ONE
+	}
+}
+models/mapobjects/teleporter/energy
+{
+   cull disable
+   
+               
+       {
+               map models/mapobjects/teleporter/energy.tga
+               blendfunc GL_ONE GL_ONE
+               tcMod scroll 2.2 1.3
+               rgbGen wave inversesawtooth -.3 1.3 0 1.3
+             
+       }
+	{    
+		map models/mapobjects/teleporter/energy2.tga
+		blendfunc GL_ONE GL_ONE
+		tcMod scroll -1 .5
+		rgbGen wave inversesawtooth -.2 1.2 0 .5
+              
+	}
+	{    
+                map models/mapobjects/teleporter/energy3.tga
+                blendfunc GL_ONE GL_ONE
+                tcMod scroll 3 0
+		rgbGen wave triangle 1 1 0 5.3
+              
+	}
+
+}
+
+models/mapobjects/teleporter/widget
+{
+   cull disable
+            
+        {
+                map models/mapobjects/teleporter/widget.tga
+                blendfunc GL_ONE GL_ONE
+                
+        }
+        {
+                map models/mapobjects/teleporter/transparency2.tga
+                blendfunc GL_ONE GL_ONE
+                tcMod scroll -.1 -.2
+        }
+
+}
+
+models/mapobjects/teleporter/transparency
+{
+   cull disable
+            
+        {
+                map models/mapobjects/teleporter/transparency.tga
+                blendfunc GL_ONE GL_ONE
+                 
+        }
+        {
+                map models/mapobjects/teleporter/transparency2.tga
+                blendfunc GL_ONE GL_ONE
+                tcMod scroll .1 .2
+        }
+
+}
+
+models/mapobjects/teleporter/teleporter_edge
+{
+         
+
+        {
+          map models/mapobjects/teleporter/teleporter_edge.tga 
+          rgbGen vertex  
+        }  
+        {
+                map models/mapobjects/teleporter/teleporter_edge2.tga
+                blendfunc GL_ONE GL_ONE
+                rgbgen wave inversesawtooth 0 1 .2 1.5
+        }
+    
+}
+
+models/mapobjects/jesus/jesuswall
+{
+   deformVertexes wave 100 sin 0 .2 0 .2
+               
+        {
+                map models/mapobjects/jesus/jesuswall.tga
+                rgbGen vertex
+        }
+
+
+}
+
+models/mapobjects/hand
+{
+   deformVertexes wave 100 sin 0 .3 0 .2
+               
+        {
+                map models/mapobjects/hand.tga
+                rgbGen vertex
+        }
+
+
+}
+
+models/mapobjects/corpse/corpse
+{
+   deformVertexes wave 100 sin 0 .2 0 .2
+               
+        {
+                map models/mapobjects/corpse/corpse.tga
+                rgbGen vertex
+        }
+        
+
+}
+models/mapobjects/skull/ribcage
+{
+	sort underwater
+        cull disable      
+        {
+                map models/mapobjects/skull/ribcage.tga
+                // blendfunc gl_src_alpha gl_one_minus_src_alpha
+                alphaFunc GE128
+                rgbGen vertex
+        }
+
+
+}
+
+models/mapobjects/baph/baphomet
+{
+  
+   deformVertexes wave 100 sin 0 .3 0 .2
+	{
+		map models/mapobjects/baph/baphomet.tga
+		 rgbGen vertex
+	}
+	
+	{
+		map models/mapobjects/baph/baphomet_glo.tga
+		blendfunc GL_ONE GL_ONE
+		rgbGen wave triangle .1 1 0 .2
+		
+	}
+}
+//models/mapobjects/flag/banner_eg1
+//{
+//               cull disable
+//               surfaceparm nolightmap
+//	       deformVertexes wave 100 sin 0 8 0 8
+//		   sort banner
+//        {
+//                map models/mapobjects/flag/banner_eg1.tga
+//                // blendfunc gl_src_alpha gl_one_minus_src_alpha
+//                alphaFunc GE128
+//                rgbGen vertex
+//        }
+//
+//
+//}
+models/mapobjects/flag/banner_strgg
+{
+        cull disable
+        surfaceparm nolightmap
+        surfaceparm alphashadow
+
+	    deformVertexes wave 100 sin 0 3 0 .7
+		sort banner
+        {
+                map models/mapobjects/flag/banner_strgg.tga
+                 blendfunc gl_src_alpha gl_one_minus_src_alpha
+                alphaFunc GE128
+                rgbGen vertex
+        }
+
+
+}
+models/mapobjects/flag/banner02
+{
+               cull disable
+               surfaceparm nolightmap
+	       deformVertexes wave 100 sin 0 2 0 .7
+		  
+        {
+                map models/mapobjects/flag/banner02.tga
+              
+        }
+
+
+}
+
+models/mapobjects/weeds/weed02
+{
+	sort underwater
+               cull disable
+               surfaceparm nolightmap
+	       deformVertexes wave 100 sin 0 2 0 .7
+        {
+                map models/mapobjects/weeds/weed02.tga
+                blendfunc gl_src_alpha gl_one_minus_src_alpha
+        }
+
+
+}
+models/mapobjects/weeds/weed01
+{
+	sort additive
+               cull disable
+               surfaceparm nolightmap
+	       deformVertexes wave 100 sin 0 2 0 .7
+        {
+                map models/mapobjects/weeds/weed01.tga
+                blendfunc gl_src_alpha gl_one_minus_src_alpha
+        }
+
+
+}
+
+models/mapobjects/portal_2/portal_3_edge
+{
+        {
+                map models/mapobjects/portal_2/portal_3_edge.tga
+                rgbGen vertex
+        }
+
+	{
+		map models/mapobjects/portal_2/portal_3_edge_glo.tga
+		blendFunc GL_ONE GL_ONE
+		tcMod scroll 9.7 .5
+	}
+
+}
+
+models/players/razor/razor_gogs
+{
+	{
+		map models/players/razor/razor_gogs.tga	
+                tcGen environment
+
+	}
+
+	
+	{
+		map	models/players/razor/razor_gogs_fx.tga	
+		blendfunc GL_ONE GL_ONE
+		tcMod scroll 1.2 9.3
+		
+	}
+}
+
+models/players/slash/slashskate
+{
+	sort additive
+	cull disable
+	{
+		map models/players/slash/slashskate.tga
+		blendFunc GL_ONE GL_ONE
+		
+	}
+}
+
+
+models/mapobjects/colua0/colua0_lght
+{
+	surfaceparm	trans
+	{
+		map textures/effects/envmap2.tga
+		tcGen environment
+		blendFunc GL_ONE GL_ONE
+	}
+}
+models/mapobjects/colua0/colua0_flare
+{
+	deformVertexes autoSprite
+
+	q3map_surfacelight	1000
+
+	surfaceparm	trans
+	surfaceparm nomarks
+	surfaceparm nolightmap
+	cull none
+	
+	{
+		Map models/mapobjects/colua0/colua0_flare.tga
+		blendFunc GL_ONE GL_ONE
+	}	
+	
+}
+models/mapobjects/kmlamp_white
+{
+	
+	surfaceparm	trans
+	{
+		map textures/effects/envmap2.tga
+		tcGen environment
+		blendFunc GL_ONE GL_ONE
+	}
+}
+
+models/mapobjects/lamps/flare03
+{
+	deformVertexes autoSprite
+
+	q3map_surfacelight 200	
+
+	surfaceparm	trans
+	surfaceparm nomarks
+	surfaceparm nolightmap
+	cull none
+	
+	{
+		Map models/mapobjects/lamps/flare03.tga
+		blendFunc GL_ONE GL_ONE
+	}	
+	
+}
+
+//models/weapons2/chainsaw/f_chainsaw
+//{
+//	sort nearest
+//	cull back
+//	{
+//		map	models/weapons2/chainsaw/f_chainsaw.tga
+//		blendfunc GL_ONE GL_ONE_MINUS_SRC_COLOR
+//
+//	}
+//}
+
+models/players/sarge/cigar
+{
+	{
+		map	models/players/sarge/cigar.tga
+		
+		
+	}
+	
+	{
+		map	models/players/sarge/cigar.glow.tga
+		blendfunc GL_ONE GL_ONE
+		rgbGen wave triangle .5 1 0 .2
+		
+	}
+}
+//
+// powerups
+//
+//
+// ammo
+//
+models/powerups/ammo/ammo_rail1
+{
+	{
+		map models/powerups/ammo/ammo_rail1.tga
+		rgbGen lightingDiffuse
+	}
+	{
+		map models/powerups/ammo/ammo_rail1.glow.tga
+		blendfunc GL_ONE GL_ONE
+		rgbGen wave sin 0.75 0.25 0 1
+	}
+}
+models/powerups/ammo/ammo_rail2
+{
+	{
+		map models/powerups/ammo/ammo_rail2.tga
+		rgbGen lightingDiffuse
+	}
+	{
+		map models/powerups/ammo/ammo_rail2.glow.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+models/powerups/ammo/bfgammo1
+{
+	{
+		map models/powerups/ammo/bfgammo1.tga
+		rgbGen lightingDiffuse
+	}
+	{
+		map models/powerups/ammo/bfgammo1.glow.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+models/powerups/ammo/bfgammo2
+{
+	{
+		map models/powerups/ammo/bfgammo2.tga
+		rgbGen lightingDiffuse
+	}
+	{
+		map models/powerups/ammo/bfgammo2.glow.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+models/powerups/ammo/bounammo1
+{
+	{
+		map models/powerups/ammo/bounammo1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/powerups/ammo/bounammo2
+{
+	{
+		map models/powerups/ammo/bounammo2.tga
+		rgbGen lightingDiffuse
+	}
+	{
+		map models/powerups/ammo/bounammo2.glow.tga
+		blendfunc GL_ONE GL_ONE
+		rgbGen lightingDiffuse
+	}
+}
+models/powerups/ammo/flamammo1
+{
+	{
+		map models/powerups/ammo/flamammo1.tga
+		rgbGen lightingDiffuse
+	}
+}
+models/powerups/ammo/flamammo2
+{
+	{
+		map models/powerups/ammo/flamammo2.tga
+		rgbGen lightingDiffuse
+	}
+	{
+		map models/powerups/ammo/flamammo2.glow.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+models/powerups/ammo/grenammo1
+{
+	{
+		map models/powerups/ammo/grenammo1.tga
+		rgbGen lightingDiffuse
+	}
+	{
+		map models/powerups/ammo/grenammo1.glow.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+models/ammo/grenade_bak
+{
+        {
+                map models/ammo/grenade.tga
+        }
+	{
+		AnimMap 7 models/ammo/grenade_r.tga models/ammo/grenade_g.tga
+	       blendfunc GL_ONE GL_ONE
+	}
+}
+models/powerups/ammo/grenammo2
+{
+	{
+		map models/powerups/ammo/grenammo2.tga
+		rgbGen lightingDiffuse
+	}
+	{
+		map models/powerups/ammo/grenammo2.glow.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+models/powerups/ammo/lighammo1
+{
+	{
+		map models/powerups/ammo/lighammo1.tga
+		rgbGen lightingDiffuse
+	}
+	{
+		map models/powerups/ammo/lighammo1.glow.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+models/powerups/ammo/lighammo2
+{
+	{
+		map models/powerups/ammo/lighammo2.tga
+		rgbGen lightingDiffuse
+	}
+	{
+		map models/powerups/ammo/lighammo2.glow.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+models/powerups/ammo/machammo1
+{
+	{
+		map models/powerups/ammo/machammo1.tga
+		rgbGen lightingDiffuse
+	}
+	{
+		map models/powerups/ammo/machammo1.glow.tga
+		blendfunc GL_ONE GL_ONE
+		rgbGen identity
+	}
+}
+models/powerups/ammo/machammo2
+{
+	{
+		map models/powerups/ammo/machammo2.tga
+		rgbGen lightingDiffuse
+	}
+	{
+		map models/powerups/ammo/machammo2.glow.tga
+		blendfunc GL_ONE GL_ONE
+		rgbGen identity
+	}
+}
+models/powerups/ammo/plasammo1
+{
+	{
+		map models/powerups/ammo/plasammo1.tga
+		rgbGen lightingDiffuse
+	}
+	{
+		map models/powerups/ammo/plasammo1.glow.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+models/powerups/ammo/plasammo2
+{
+	{
+		map models/powerups/ammo/plasammo2.tga
+		rgbGen lightingDiffuse
+	}
+	{
+		map models/powerups/ammo/plasammo2.glow.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+models/powerups/ammo/railammo1
+{
+	{
+		map models/powerups/ammo/railammo1.tga
+		rgbGen lightingDiffuse
+	}
+	{
+		map models/powerups/ammo/railammo1.glow.tga
+		blendfunc GL_ONE GL_ONE
+		rgbGen wave sin 0.75 0.25 0 1
+	}
+}
+models/powerups/ammo/railammo2
+{
+	{
+		map models/powerups/ammo/railammo2.tga
+		rgbGen lightingDiffuse
+	}
+	{
+		map models/powerups/ammo/railammo2.glow.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+models/powerups/ammo/rockammo1
+{
+	{
+		map models/powerups/ammo/rockammo1.tga
+		rgbGen lightingDiffuse
+	}
+	{
+		map models/powerups/ammo/rockammo1.glow.tga
+		blendfunc GL_ONE GL_ONE
+		rgbGen identity
+	}
+}
+models/powerups/ammo/rockammo2
+{
+	{
+		map models/powerups/ammo/rockammo2.tga
+		rgbGen lightingDiffuse
+	}
+	{
+		map models/powerups/ammo/rockammo2.glow.tga
+		blendfunc GL_ONE GL_ONE
+		rgbGen identity
+	}
+}
+models/powerups/ammo/shotammo1
+{
+	{
+		map models/powerups/ammo/shotammo1.tga
+		rgbGen lightingDiffuse
+	}
+	{
+		map models/powerups/ammo/shotammo1.glow.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+models/powerups/ammo/shotammo2
+{
+	{
+		map models/powerups/ammo/shotammo2.tga
+		rgbGen lightingDiffuse
+	}
+	{
+		map models/powerups/ammo/shotammo2.glow.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+
+//
+// health
+//
+models/powerups/health/yellow
+{
+	
+	{
+		map models/powerups/health/yellow.tga
+		rgbGen wave sin .5 .25 0 .5
+		blendfunc GL_ONE GL_ONE
+		
+	}
+}
+models/powerups/health/yellow_sphere
+{
+	{
+		map textures/effects/envmap2.tga
+		tcGen environment
+		blendfunc GL_ONE GL_ONE
+	}
+}
+models/powerups/health/red
+{	
+	
+	{
+		map models/powerups/health/red.tga
+		rgbGen wave sin .5 .25 0 .5
+		blendfunc GL_ONE GL_ONE
+		
+	}
+}
+models/powerups/health/red_sphere
+{
+	{
+		map textures/effects/envmap2.tga
+		tcGen environment
+		blendfunc GL_ONE GL_ONE
+	}
+}
+models/powerups/health/green
+{
+	
+	{
+		map models/powerups/health/green.tga
+		rgbGen wave sin .5 .25 0 .5
+		blendfunc GL_ONE GL_ONE
+		
+	}
+}
+models/powerups/health/green_sphere
+{
+	{
+		map textures/effects/envmap2.tga
+		tcGen environment
+		blendfunc GL_ONE GL_ONE
+	}
+}
+models/powerups/health/blue
+{
+	{
+		map models/powerups/health/blue.tga
+		rgbGen wave sin .5 .25 0 .5
+		
+	}
+}
+models/powerups/health/blue_sphere
+{
+	{
+		map textures/effects/envmap2.tga
+		tcGen environment
+		blendfunc GL_ONE GL_ONE
+	}
+}
+
+
+//
+// mapobjects
+//
+models/powerups/armor/energy_red1
+{
+
+	{
+		map models/powerups/armor/energy_red1.tga 
+		blendFunc GL_ONE GL_ONE
+		tcMod scroll 1 1.3
+	}
+
+}
+
+models/powerups/armor/energy_yel1
+{
+
+	{
+		animmap 5 models/powerups/armor/energy_yel1.tga models/powerups/armor/energy_yel2.tga
+		blendFunc GL_ONE GL_ONE
+		tcMod scroll 1 1.2
+	}
+
+}
+
+models/powerups/armor/energy_grn1
+{
+
+	{
+		animmap 5 models/powerups/armor/energy_grn1.tga models/powerups/armor/energy_grn1.tga
+		blendFunc GL_ONE GL_ONE
+		tcMod scroll 1 1.1
+	}
+
+}
+
+models/mapobjects/lamplight_ys
+{
+	{	
+		map models/mapobjects/lamplight_ys.tga
+		blendfunc GL_ONE GL_ONE
+		
+	}
+}
+
+
+models/mapobjects/lamplight_y
+{
+	q3map_surfacelight 10000
+	light 1
+	{
+		map models/mapobjects/lamplight_y.tga
+		blendfunc GL_ONE GL_ONE
+		
+	}
+}
+
+models/mapobjects/arenalogo
+{
+	deformVertexes wave 100 sin 0.25 0 0 0
+	{
+		map textures/effects/quadmap.tga
+		blendfunc GL_ONE GL_ONE
+		tcGen environment
+		tcMod turb 0 1 0 0.2
+	}
+}
+
+//
+// weapon hits
+//
+ring1
+{
+	sort additive
+	{
+		map models/weaphits/ring02_1.tga
+		rgbGen oneMinusEntity
+		blendfunc GL_ONE GL_ONE
+	}
+	{
+		map models/weaphits/ring02_2.tga
+		rgbGen entity
+		blendfunc GL_ONE GL_ONE
+	}
+	cull disable
+}
+ring2
+{
+	sort additive
+	{
+		map models/weaphits/ring02_2.tga
+		rgbGen oneMinusEntity
+		blendfunc GL_ONE GL_ONE
+	}
+	{
+		map models/weaphits/ring02_3.tga
+		rgbGen entity
+		blendfunc GL_ONE GL_ONE
+	}
+	cull disable
+}
+ring3
+{
+	sort additive
+	{
+		map models/weaphits/ring02_3.tga
+		rgbGen oneMinusEntity
+		blendfunc GL_ONE GL_ONE
+	}
+	{
+		map models/weaphits/ring02_4.tga
+		rgbGen entity
+		blendfunc GL_ONE GL_ONE
+	}
+	cull disable
+
+}
+ring4
+{
+	sort additive
+	{
+		map models/weaphits/ring02_4.tga
+		rgbGen oneMinusEntity
+		blendfunc GL_ONE GL_ONE
+	}
+	cull disable
+}
+
+// bullet flashes
+
+bullet1
+{
+	sort additive
+	cull disable
+	{
+		map models/weaphits/bullet1.tga
+		rgbGen oneMinusEntity
+		blendfunc GL_ONE GL_ONE
+	}
+	{
+		map models/weaphits/bullet2.tga
+		rgbGen entity
+		blendfunc GL_ONE GL_ONE
+	}
+}
+bullet2
+{
+	sort additive
+	cull disable
+	{
+		map models/weaphits/bullet2.tga
+		rgbGen oneMinusEntity
+		blendfunc GL_ONE GL_ONE
+	}
+	{
+		map models/weaphits/bullet3.tga
+		rgbGen entity
+		blendfunc GL_ONE GL_ONE
+	}
+}
+bullet3
+{
+	sort additive
+	cull disable
+	{
+		map models/weaphits/bullet3.tga
+		rgbGen oneminusentity
+		blendfunc GL_ONE GL_ONE
+	}
+}
+
+
+blood1
+{
+	{
+		map models/weaphits/blood201.tga
+		blendfunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	cull disable
+}
+blood2
+{
+	{
+		map models/weaphits/blood202.tga
+		blendfunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	cull disable
+}
+blood3
+{
+	{
+		map models/weaphits/blood203.tga
+		blendfunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	cull disable
+}
+blood4
+{
+	{
+		map models/weaphits/blood204.tga
+		blendfunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	cull disable
+}
+blood5
+{
+	{
+		map models/weaphits/blood205.tga
+		blendfunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	cull disable
+}
+
+
+
+//
+// weapons
+//
+//models/weapons2/machinegun/f_machinegun
+//{
+//	nofog
+//	sort additive
+//	cull disable
+//	{
+//		map	models/weapons2/machinegun/f_machinegun.tga
+////		blendfunc GL_ONE GL_ONE
+//	}
+//}
+
+models/weapons2/machinegun/f_machinegun
+{
+	nofog
+	sort additive
+	cull disable
+	{
+		animMap 2 models/weapons2/machinegun/f_machinegun.tga models/weapons2/machinegun/f_machinegun1.tga	
+	blendfunc GL_ONE GL_ONE
+	}
+}
+
+
+
+
+
+models/weapons2/railgun/f_railgun2
+{
+	sort additive
+	cull disable
+	{
+		map	models/weapons2/railgun/f_railgun2.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+
+
+
+models/weapons2/railgun/railgun2
+{
+	sort additive
+	cull disable
+	{
+		map	models/weapons2/railgun/railgun2.glow.tga
+		blendfunc GL_ONE GL_ONE
+		rgbGen entity	// identity
+	}
+}
+
+models/weapons2/railgun/railgun3
+{
+	{
+		map	models/weapons2/railgun/railgun3.tga
+		rgbGen lightingDiffuse				
+	}
+
+	{
+		map	models/weapons2/railgun/railgun3.glow.tga
+		blendfunc GL_ONE GL_ONE
+		rgbGen entity	// identity
+	}
+}
+
+models/weapons2/railgun/railgun4
+{
+	{
+		map models/weapons2/railgun/railgun4.tga
+		tcMod scroll 0 1
+		rgbGen entity	// identity
+	}
+
+}
+
+models/weapons2/shotgun/f_shotgun
+{
+	sort additive
+	cull disable
+	{
+		map	models/weapons2/shotgun/f_shotgun.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+
+models/weapons2/shotgun/shotgun_laser
+{
+	
+	{
+		map	models/weapons2/shotgun/shotgun_laser.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+models/weapons2/shotgun/barrel
+{
+	
+	{
+		map	models/weapons2/shotgun/barrel.tga
+        }
+        {
+                map textures/effects/envmap2.tga
+		tcGen environment
+		blendFunc GL_ONE GL_ONE
+                rgbGen vertex
+        }
+}
+
+
+
+models/weapons2/bfg/f_bfg
+{
+	sort additive
+	cull disable
+	{
+		clampmap	models/weapons2/bfg/f_bfg.tga
+		blendfunc GL_ONE GL_ONE
+                // rgbgen wave triangle 1 5.1 1 7
+                tcmod rotate 317
+                
+	}
+        {
+		clampmap	models/weapons2/bfg/f_bfg2.tga
+		blendfunc GL_ONE GL_ONE
+                tcmod rotate -511
+	}
+}
+
+
+models/weapons2/grenadel/f_grenadel
+{
+	sort additive
+	cull disable
+	{
+		map	models/weapons2/grenadel/f_grenadel.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+//models/weapons2/lightning/f_lightning
+//{
+//	sort additive
+//	cull disable
+//	{
+//		map models/weapons2/lightning/f_lightning.tga
+//		blendfunc GL_ONE GL_ONE
+//	}
+//}
+sprites/plasma1
+{
+	cull disable
+	{
+		clampmap sprites/plasmaa.tga
+		blendfunc GL_ONE GL_ONE
+                tcMod rotate 931
+	}
+}
+models/ammo/rocket/rockfls1
+{
+	cull disable
+	{
+		map models/ammo/rocket/rockfls1.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+models/ammo/rocket/rockfls2
+{
+	cull disable
+	{
+		map models/ammo/rocket/rockfls2.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+models/ammo/rocket/rockflar
+{
+	cull disable
+	{
+		map models/ammo/rocket/rockflar.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+
+sprites/plasma2
+{
+	cull disable
+	{
+		map sprites/plasma2.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+models/weapons2/plasma/f_plasma
+{
+	cull disable
+	sort additive
+	{
+		map models/weapons2/plasma/f_plasma.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+models/weapons2/flamethrower/f_flamethrower
+{
+	cull disable
+	sort additive
+	{
+		map models/weapons2/flamethrower/f_flamethrower.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+models/weapons2/grapple/f_grapple
+{
+	cull disable
+	sort additive
+	{
+		map models/weapons2/grapple/f_grapple.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+models/weapons2/rocketl/f_rocketl
+{
+	cull disable
+	sort additive
+	{
+		map models/weapons2/rocketl/f_rocketl.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+
+models/weapons2/gauntlet/gauntlet3
+{
+	
+	cull disable
+	sort additive
+	{
+              // map models/weapons2/gauntlet/gauntlet3.tga
+               AnimMap 10 models/weapons2/gauntlet/gauntlet3.tga models/weapons2/gauntlet/gauntlet4.tga
+	       blendfunc GL_ONE GL_ONE
+	}
+}
+
+// this one can go away eventually
+models/weapons2/rocketl/rocketl14
+{
+	cull disable
+	sort additive
+	{
+		map models/weapons2/rocketl/f_rocketl.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+
+//
+// players
+//
+models/players/tankjr/tankjr
+{
+        {
+		map $whiteimage
+		rgbGen lightingDiffuse
+	}
+	{
+        	map models/players/tankjr/tankjr.tga
+		blendFunc GL_DST_COLOR GL_SRC_ALPHA
+		rgbGen identity
+		alphaGen lightingSpecular
+	}
+}
+//models/players/visorhead
+//{
+//	{
+//		map $whiteimage
+//		rgbGen lightingDiffuse
+//	}
+//	{
+//		map models/players/visor/visorhead.tga
+//		rgbGen identity
+//		alphaGen lightingSpecular
+//		blendFunc GL_DST_COLOR GL_SRC_ALPHA
+//	}
+//}
+//models/players/visor/visortorso2
+//{
+//	{
+//		map $whiteimage
+//		rgbGen lightingDiffuse
+//	}
+//	{
+//		map models/players/visor/visortorso2.tga
+//		rgbGen identity
+//		alphaGen lightingSpecular
+//		blendFunc GL_DST_COLOR GL_SRC_ALPHA
+//	}
+//}
+
+models/players/doom/f_doom
+{
+	{
+		map models/players/doom/f_doom.tga			
+	}
+	{
+		
+		map models/players/doom/fx_doom.tga
+		tcGen environment
+		rgbGen lightingDiffuse
+		blendfunc gl_ONE gl_ONE 		
+	}
+}
+models/players/doom/f_doom
+{
+	{
+		map models/players/doom/f_doom.tga	
+                rgbGen lightingDiffuse		
+	}
+        {
+		
+		map models/players/doom/doom_fx.tga
+		tcGen environment
+		rgbGen lightingDiffuse
+		blendfunc gl_ONE gl_ONE 		
+	}
+	
+}
+
+models/players/xian/xianfacf
+{
+	{
+		map $whiteimage
+		rgbGen lightingDiffuse
+	}
+	{
+		map models/players/medium/xian/xianfacf.tga
+		rgbGen identity
+		alphaGen lightingSpecular
+		blendFunc GL_DST_COLOR GL_SRC_ALPHA
+	}
+}
+models/brandon/braneye
+{
+	{
+		map $whiteimage
+		rgbGen lightingDiffuse
+	}
+	{
+		map models/players/light/brandon/braneye.tga
+		rgbGen identity
+		alphaGen lightingSpecular
+		blendFunc GL_DST_COLOR GL_SRC_ALPHA
+	}
+	{
+		map models/players/light/brandon/braneye.glow.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+models/players/brandon/branhat
+{
+	{
+		map models/players/light/brandon/branhat.tga
+	}
+	{
+		map models/players/light/brandon/branhat.glow.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+
+//
+// weapons
+//
+
+models/weapons2/plasma/plasma_glass
+{
+	{
+		map textures/effects/envmap.tga
+		tcGen environment
+		blendfunc GL_ONE GL_ONE
+		rgbGen lightingDiffuse
+	}
+}
+models/weapons2/plasma/plasma_glo
+{
+	{
+		map models/weapons2/plasma/plasma_glo.tga
+		tcMod scroll 0 1
+		rgbGen identity
+	}
+}
+
+////////////////////////////
+/// Lightning gun Shader ///
+////////////////////////////
+models/weapons2/lightning/ball
+{
+   deformVertexes autoSprite
+        {
+		map models/weapons2/lightning/ball.tga
+		blendfunc GL_ONE GL_ONE
+                rgbgen wave triangle 1 2 0 7
+                tcMod rotate 360
+	}
+        {
+		map models/weapons2/lightning/ball.tga
+		blendfunc GL_ONE GL_ONE
+                rgbgen wave triangle 1 5 1 3
+                tcMod rotate -200
+	}
+	
+}
+
+//
+//
+// instant: as seen on the powerups themselves
+//
+
+models/powerups/instant/scan
+{
+	{
+		map models/powerups/instant/scan.tga
+	}
+	{
+		map textures/effects/envmapdim.tga
+		blendfunc GL_ONE GL_ONE
+		tcGen environment
+	}
+}
+models/powerups/instant/quad
+{
+	{
+		map gfx/colors/darkblue.tga
+	}
+	{
+		map textures/effects/envmap.tga
+		tcGen environment
+//		blendFunc GL_DST_COLOR GL_ZERO
+		blendFunc GL_ONE GL_ONE
+	}
+}
+models/powerups/instant/enviro
+{
+	{
+		map models/powerups/instant/enviro.tga
+	}
+	{
+		map textures/effects/envmapdim.tga
+		blendfunc GL_ONE GL_ONE
+		tcGen environment
+	}
+}
+models/powerups/instant/flight
+{
+	{
+		map models/powerups/instant/flight.tga
+	}
+	{
+		map textures/effects/envmapdim.tga
+		blendfunc GL_ONE GL_ONE
+		tcGen environment
+	}
+}
+models/powerups/instant/haste
+{
+	{
+		map models/powerups/instant/haste.tga
+	}
+	{
+		map textures/effects/envmapdim.tga
+		blendfunc GL_ONE GL_ONE
+		tcGen environment
+	}
+}
+models/powerups/instant/invis
+{
+	{
+		map textures/effects/envmapdim.tga
+		blendfunc GL_ONE GL_ONE
+		tcGen environment
+	}
+}
+models/powerups/instant/regen
+{
+	{
+		map models/powerups/instant/regen.tga
+	}
+	{
+		map textures/effects/envmapdim.tga
+		tcGen environment
+		blendfunc GL_ONE GL_ONE
+	}
+}
+
+//
+// holdable powerups
+//
+
+models/powerups/holdable/medkit_base
+{
+	{
+		map textures/effects/envmap.tga
+		tcgen environment
+	}
+	
+}
+
+models/powerups/holdable/medkit_sphere
+{
+	{
+		map textures/effects/envmapdim.tga
+		tcgen environment
+		blendfunc GL_ONE GL_ONE
+	}
+	
+}
+
+models/powerups/holdable/medkit_fluid
+{
+	sort additive
+	cull back
+	{
+		map models/powerups/holdable/medkit_fluid.tga
+		tcMod scroll 0 2
+		blendfunc GL_ONE GL_ONE
+	}
+	
+}
+
+models/powerups/holdable/teleport_base
+{
+	{
+		map textures/effects/envmap.tga
+		tcgen environment
+	}
+	
+}
+
+models/powerups/holdable/teleport_sphere
+{
+	{
+		map textures/effects/envmapdim.tga
+		tcgen environment
+		blendfunc GL_ONE GL_ONE
+	}
+	
+}
+
+models/powerups/holdable/teleport_fluid
+{
+	sort additive
+	cull back
+	{
+		map models/powerups/holdable/teleport_fluid.tga
+		tcMod scroll 0 2
+		blendfunc GL_ONE GL_ONE
+	}
+	
+}
+
+
+////// maxx test stim ////
+models/mapobjects/clonetube/cl_door1
+{      
+
+		q3map_surfacelight 600
+    		light 1
+
+
+
+	//cull twosided
+	//{
+	//	map models/mapobjects/clonetube/chrome1.tga
+	//	map models/mapobjects/clonetube/GUNFX.tga
+	//	blendfunc gl_one_minus_dst_color gl_zero
+	//	blendfunc blend
+	//	tcmod scale 2 2
+	//	rgbGen identity
+	//	tcGen environment 
+	//}
+	{ 
+		map models/mapobjects/clonetube/c_water2.tga
+		blendFunc add
+		rgbgen vertex
+		tcmod scale 1 1
+		tcmod scroll .025 .025
+	}
+
+        {
+		map models/mapobjects/clonetube/c_glass1.tga
+		blendFunc GL_ONE GL_SRC_ALPHA
+		rgbGen identity
+	}
+
+	{
+		map models/mapobjects/clonetube/cl_door1.tga
+		blendFunc blend      	
+		rgbGen vertex
+	}
+
+	
+
+
+
+}
+
+models/mapobjects/clonetube/clone1
+{      
+	cull twosided
+
+       
+
+	{
+		map models/mapobjects/clonetube/c_water2.tga
+           tcmod rotate 350
+	      rgbGen wave sin 1 .8 0 2
+		rgbGen identity
+
+	}
+	{
+		map models/mapobjects/clonetube/clone1.tga
+		blendFunc blend      	
+		rgbGen vertex
+	}
+
+
+
+
+
+}
+
+models/mapobjects/test/sop_body1
+{      
+        {
+		map textures/effects/regenmap3.tga
+                tcmod rotate 350
+		tcmod stretch scale 1 .4 0 .1
+
+                // tcmod scroll 3 1
+	//	tcmod scale 2 2
+	//	tcmod stretch 1 .5 0 2
+                blendFunc GL_ONE GL_ZERO
+		rgbGen wave sin 1 .6 0 .5
+	} 
+        {
+        	map models/mapobjects/test/sop_body1.tga
+		blendFunc blend
+		rgbGen vertex
+	}
+}
+models/players/protosoldier/proto_armor1
+{      
+	cull twosided
+        
+	{
+		map models/players/protosoldier/proto_armor1.tga
+		rgbGen lightingdiffuse
+	}
+}
+
+models/mapobjects/generator/genface
+{      
+	cull twosided
+        
+	{
+		map models/mapobjects/generator/sun.tga
+		rgbGen identity
+		tcMod rotate 360
+		rgbgen wave triangle 0 1 0 7
+	//	tcMod scroll 1 0
+	}
+	{
+		map models/mapobjects/generator/genface.tga
+		blendfunc blend
+		rgbGen vertex
+	}
+}
+
+models/mapobjects/generator/gen1
+{      
+	cull twosided
+        
+	{
+		map textures/effects/regenmap3.tga
+		rgbGen identity
+		tcMod rotate 360
+		tcMod scroll 1 0
+	}
+	{
+		map models/mapobjects/generator/gen1.tga
+		blendfunc blend
+		rgbGen vertex
+	}
+}
+models/mapobjects/generator/elec1
+{      
+	cull twosided
+        
+	
+	{
+		map models/mapobjects/generator/elec1.tga
+		blendFunc GL_ONE GL_ONE
+                rgbgen wave triangle .8 2 0 7
+                tcMod scroll 0 1
+	}
+	{
+		map models/mapobjects/generator/elec1.tga
+		blendFunc GL_ONE GL_ONE
+               rgbgen wave triangle 1 1.4 0 5
+                tcMod scale  -1 1
+                tcMod scroll 0 1
+	}	
+        {
+		map models/mapobjects/generator/elec1.tga
+		blendFunc GL_ONE GL_ONE
+                rgbgen wave triangle 1 1.4 0 6.3
+                tcMod scale  -1 1
+                tcMod scroll 2 1
+	}	
+        {
+		map models/mapobjects/generator/elec1.tga
+		blendFunc GL_ONE GL_ONE
+                rgbgen wave triangle 1 1.4 0 7.7
+                tcMod scroll -1.3 1
+	}	
+}
+
+
+models/mapobjects/test3/engine
+{      
+        {
+		map textures/effects/regenmap3.tga
+                tcmod rotate 350
+		tcmod stretch scale 1 .4 0 .1
+
+                // tcmod scroll 3 1
+	//	tcmod scale 2 2
+	//	tcmod stretch 1 .5 0 2
+                blendFunc GL_ONE GL_ZERO
+		rgbGen wave sin 1 .6 0 .5
+	} 
+        {
+        	map models/mapobjects/test3/engine.tga
+		blendFunc blend
+		rgbGen vertex
+	}
+}
+
+models/mapobjects/test3/temp2
+{      
+        {
+		map textures/effects/regenmap3.tga
+                tcmod rotate 350
+                // tcmod scroll 3 1
+	//	tcmod scale 2 2
+	//	tcmod stretch 1 .5 0 2
+                blendFunc GL_ONE GL_ZERO
+		rgbGen wave sin 1 .6 0 .5
+	} 
+        {
+        	map models/mapobjects/test3/temp2.tga
+		blendFunc blend
+		rgbGen vertex
+	}
+}
+models/mapobjects/test3/temp4
+{      
+        {
+		map textures/effects/regenmap3.tga
+                tcmod rotate 350
+                // tcmod scroll 3 1
+	//	tcmod scale 2 2
+	//	tcmod stretch 1 .5 0 2
+                blendFunc GL_ONE GL_ZERO
+		rgbGen wave sin 1 .6 0 .5
+	} 
+        {
+        	map models/mapobjects/test3/temp4.tga
+		blendFunc blend
+		rgbGen vertex
+	}
+}
+
+
+models/mapobjects/test3/temp
+{      
+        {
+		map textures/effects/regenmap3.tga
+                tcmod rotate 350
+                // tcmod scroll 3 1
+	//	tcmod scale 2 2
+	//	tcmod stretch 1 .5 0 2
+                blendFunc GL_ONE GL_ZERO
+		rgbGen wave sin 1 .6 0 .5
+	} 
+        {
+        	map models/mapobjects/test3/temp.tga
+		blendFunc blend
+		rgbGen vertex
+	}
+}
+
+
+//models/players/xaero/xaero_a
+//{      
+//        {
+//		map textures/effects/envmapbfg.tga
+//                tcmod rotate 350
+//                tcmod scroll 3 1
+//                blendFunc GL_ONE GL_ZERO
+//		rgbGen identity
+///	} 
+//        {
+//        	map models/players/xaero/xaero_a.tga
+//		blendFunc blend
+//		rgbGen lightingdiffuse
+//	}
+//}
+
+models/mapobjects/light/sconce
+{
+	cull none
+	{
+		map models/mapobjects/light/sconce.tga
+		alphaFunc GE128
+	//	blendFunc blend
+//		depthWrite
+		rgbGen lightingdiffuse
+	}
+}
+
+models/mapobjects/light/sconcel
+{
+	cull twosided
+	surfaceparm nomarks
+	q3map_lightimage textures/lightimage/sconcel.tga 
+	q3map_surfacelight 5000
+	light 1
+	{
+		map models/mapobjects/light/sconcel.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen identity
+	}
+
+}
+	
+models/mapobjects/light/sconce2
+{
+	//cull twosided
+	surfaceparm nomarks
+	q3map_lightimage textures/lightimage/sconce2.tga
+	q3map_surfacelight 5000
+	light 1
+	{
+		map models/mapobjects/light/sconce2.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen identity
+	}
+
+}
+
+////// maxx airplane propeller ////////////
+
+models/mapobjects/vehicles/propeller1
+{
+     cull disable
+//   surfaceparm alphashadow
+
+        {
+        	map models/mapobjects/vehicles/propeller1.tga
+        	
+			blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+			// depthWrite
+			alphaFunc GT0
+			rgbGen lightingdiffuse
+        }
+}
+
+
+models/mapobjects/miltary_trim/metal_m05
+{
+	surfaceparm playerclip
+	cull disable
+	{
+		map models/mapobjects/miltary_trim/metal_m05.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen vertex
+	}
+}
+
+models/mapobjects/miltary_trim/metal_m05a
+{
+	surfaceparm playerclip
+	cull disable
+	{
+		map models/mapobjects/miltary_trim/metal_m05.tga
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingdiffuse
+	}
+}
+
+models/weapons2/tesla/zap_scroll2b
+{
+        q3map_surfacelight	1000
+        surfaceparm	trans
+	surfaceparm nomarks
+	surfaceparm nolightmap
+//	qer_editorimage models/weapons2/tesla/zap_scroll.tga
+	cull none
+	
+	{
+		map models/weapons2/tesla/zap_scroll.tga
+		blendFunc GL_ONE GL_ONE
+                rgbgen wave triangle .8 2 0 7
+                tcMod scroll 0 1.2
+	}	
+        {
+		map models/weapons2/tesla/zap_scroll.tga
+		blendFunc GL_ONE GL_ONE
+                rgbgen wave triangle 1 1.4 0 5
+                tcMod scale  -1 1
+                tcMod scroll 0 1.2
+	}	
+        {
+		map models/weapons2/tesla/zap_scroll2a.tga
+		blendFunc GL_ONE GL_ONE
+                rgbgen wave triangle 1 1.4 0 6.3
+                tcMod scale  -1 1
+                tcMod scroll 2 1.2
+	}	
+        {
+		map models/weapons2/tesla/zap_scroll2a.tga
+		blendFunc GL_ONE GL_ONE
+                rgbgen wave triangle 1 1.4 0 7.7
+                tcMod scroll -1.3 1.2
+	}	
+}
+
+
+models\mapobjects\vehicles\luv2
+{
+	surfaceparm metalsteps
+	{
+		map $lightmap
+		rgbGen identity
+	}
+	{
+		map models\mapobjects\vehicles\luv2.tga
+		blendFunc GL_DST_COLOR GL_ZERO
+		rgbGen identity
+	}
+}
+
+models\mapobjects\vehicles\train1
+{
+	surfaceparm metalsteps
+	{
+		map $lightmap
+		rgbGen identity
+	}
+	{
+		map models\mapobjects\vehicles\train1.tga
+		blendFunc GL_DST_COLOR GL_ZERO
+		rgbGen identity
+	}
+}
+
+models\mapobjects\vehicles\natter
+{
+
+	{
+		map models/mapobjects/vehicles/natter.tga
+		rgbGen vertex 
+
+	}
+
+}
+
+textures/props/freeze_glass
+{
+   		deformVertexes wave 64 sin .25 .25 0 .5
+  	//	deformVertexes wave 100 sin 0 .2 0 .2
+
+    q3map_surfacelight 600
+    light 1
+
+
+        
+		{ 
+			map textures/props/freeze_cloud.tga
+			blendFunc GL_dst_color GL_one
+		//	rgbgen identity
+			tcmod scale -2 -2
+			tcmod scroll .0 -0.20
+		}
+		{ 
+			map textures/props/freeze_glass.tga
+			blendFunc GL_dst_color GL_one
+		//	nolightmap
+		//	rgbgen identity
+			tcmod scale 1 1
+			tcmod scroll .05 .025
+		}
+
+	
+		{
+			map $lightmap
+			blendFunc GL_dst_color GL_zero
+			rgbgen identity		
+		}
+	
+	
+
+	// 		END
+	//}
+
+}
+
+/////////////////// jet shadow /////////////////////////
+
+models/mapobjects/vehicles/jet_shadow
+{
+	{
+		
+	map models/mapobjects/vehicles/jet_shadow.tga
+	blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+//	blendFunc blend
+//	rgbGen vertex
+	rgbGen identity
+	}
+
+ }
+
+models/mapobjects/vehicles/truck_shadow
+{
+	{
+		
+	map models/mapobjects/vehicles/truck_shadow.tga
+	blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+//	blendFunc blend
+//	rgbGen vertex
+	rgbGen identity
+	}
+
+ }
+
+
+///////////////////// maxx ////////////////////
+
+
+
+models/mapobjects/furniture/xsink
+{
+	{
+		map models/mapobjects/furniture/xsink.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen vertex
+	}
+	{
+		map textures/effects/tinfx.tga
+		blendFunc GL_ONE_MINUS_DST_ALPHA GL_ONE
+		tcMod Scale .3 .3  
+		tcGen environment
+	}
+//	{
+//		map $lightmap
+//		blendFunc GL_DST_COLOR GL_ONE_MINUS_DST_ALPHA
+//		rgbGen identity
+//	}
+}
+
+
+models/mapobjects/furniture/xsink_fac
+{
+
+    {  
+      map models/mapobjects/furniture/xsink_fac.tga
+	 blendFunc blend
+      depthWrite
+      rgbGen vertex
+
+    }
+}
+
+
+/////////////////////////// dr.z_goggles ////////////
+
+models/players/drz/drz_glass
+{
+	{
+		map models/players/drz/drz_glass.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen lightingdiffuse
+	}
+	{
+		map models/players/drz/escape_env.tga
+		blendFunc GL_ONE_MINUS_DST_ALPHA GL_ONE
+		tcMod Scale 2 2   
+		tcGen environment
+	}
+}
+
+
+
+
+models/mapobjects/vehicles/sub5
+{
+	surfaceparm metalsteps
+
+	{
+		map models/mapobjects/vehicles/sub5.tga
+		rgbGen lightingdiffuse
+	}
+}
+
+
+models/mapobjects/vehicles/sub5s
+{
+	surfaceparm metalsteps
+
+	{
+		map models/mapobjects/vehicles/sub5s.tga
+//		blendFunc GL_DST_COLOR GL_ZERO
+		rgbGen vertex
+	}
+}
+
+
+models\mapobjects\flag\flag_ui_american
+
+{
+	cull twosided
+	{	
+
+		map models/mapobjects/flag/flag_ui_american.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		rgbGen identity	
+	}
+
+}
+models\mapobjects\flag\flag_ui_nazi
+
+{
+	{
+		map models/mapobjects/flag/flag_ui_nazi.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		rgbGen identity	
+	}
+
+}
+
+models\mapobjects\flag\bannerflag2
+
+{
+	cull twosided
+	{	
+
+		map models/mapobjects/flag/bannerflag2.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		rgbGen identity	
+	}
+
+}
+
+
+models\mapobjects\bjui\bj_body1
+{
+
+	{
+		map models/mapobjects/bjui/bj_body1.tga
+//		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		rgbGen identity	
+	}
+
+}
+
+models\mapobjects\bjui\bj_head1
+{
+//cull front		// (SA) no such thing
+	{
+		map models/mapobjects/bjui/bj_head1.tga
+//		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		rgbGen identity	
+	}
+
+}
+
+models/mapobjects/tree/tree_vil1
+{
+	surfaceparm alphashadow
+	deformVertexes wave 194 sin 0 2 0 .1
+	deformVertexes wave 30 sin 0 1 0 .3
+	deformVertexes wave 194 sin 0 1 0 .4
+	cull twosided
+
+
+	{
+		map models/mapobjects/tree/tree_vil1.tga
+		alphaFunc GE128
+		rgbGen vertex
+	}
+
+}
+
+models/mapobjects/tree/branch_slp1
+{
+	surfaceparm alphashadow
+//	deformVertexes wave 194 sin 0 2 0 .1
+//	deformVertexes wave 30 sin 0 1 0 .3
+//	deformVertexes wave 194 sin 0 1 0 .4
+	cull twosided
+
+
+	{
+		map models/mapobjects/tree/branch_slp1.tga
+		alphaFunc GE128
+		rgbGen vertex
+	}
+
+}
+
+models/mapobjects/tree/branch_slp2
+{
+	surfaceparm alphashadow
+//	deformVertexes wave 194 sin 0 2 0 .1
+//	deformVertexes wave 30 sin 0 1 0 .3
+//	deformVertexes wave 194 sin 0 1 0 .4
+	cull twosided
+
+
+	{
+		map models/mapobjects/tree/branch_slp2.tga
+		alphaFunc GE128
+		rgbGen vertex
+	}
+
+}
+
+models/mapobjects/tree/trunck_2a
+{
+	surfaceparm alphashadow
+	cull twosided
+
+
+	{
+		map models/mapobjects/tree/trunck_2a.tga
+//		alphaFunc GE128
+		rgbGen vertex
+	}
+
+}
+
+models/mapobjects/tree/branch_vil1
+{
+	surfaceparm alphashadow
+//	deformVertexes wave 194 sin 0 2 0 .1
+//	deformVertexes wave 30 sin 0 1 0 .3
+//	deformVertexes wave 194 sin 0 1 0 .4
+	cull twosided
+
+
+	{
+		map models/mapobjects/tree/branch_vil1.tga
+		alphaFunc GE128
+		rgbGen lightingdiffuse
+	}
+
+}
+
+models/mapobjects/tree/branch_vil1a
+{
+	surfaceparm alphashadow
+//	deformVertexes wave 194 sin 0 2 0 .1
+//	deformVertexes wave 30 sin 0 1 0 .3
+//	deformVertexes wave 194 sin 0 1 0 .4
+	cull twosided
+
+
+	{
+		map models/mapobjects/tree/branch_vil1a.tga
+		alphaFunc GE128
+		rgbGen lightingdiffuse
+	}
+
+}
+
+models/mapobjects/tree/branch_vil1_d
+{
+	surfaceparm alphashadow
+//	deformVertexes wave 194 sin 0 2 0 .1
+//	deformVertexes wave 30 sin 0 1 0 .3
+//	deformVertexes wave 194 sin 0 1 0 .4
+	cull twosided
+
+
+	{
+		map models/mapobjects/tree/branch_vil1.tga
+		alphaFunc GE128
+		rgbGen identity
+	}
+
+}
+
+models/mapobjects/tree/branch_vil1a_d
+{
+	surfaceparm alphashadow
+//	deformVertexes wave 194 sin 0 2 0 .1
+//	deformVertexes wave 30 sin 0 1 0 .3
+//	deformVertexes wave 194 sin 0 1 0 .4
+	cull twosided
+
+
+	{
+		map models/mapobjects/tree/branch_vil1a.tga
+		alphaFunc GE128
+		rgbGen identity
+	}
+
+}
+
+//models/mapobjects/vehicles/mercedes_1
+//{
+//
+//	{
+//		map models/mapobjects/vehicles/mercedes_1.tga
+//		blendFunc GL_ONE GL_ZERO
+///		rgbGen lightingdiffuse
+//	}
+///	{
+//		map textures/effects/tinfx.tga
+//		blendFunc GL_ONE_MINUS_DST_ALPHA GL_ONE 
+//		tcGen environment
+//	}
+//
+//}
+
+models/mapobjects/vehicles/mercedes_1
+
+{
+	{
+		map textures/effects/tinfx.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen lightingdiffuse
+		tcGen environment 
+	}
+	{
+		map models/mapobjects/vehicles/mercedes_1.TGA
+		blendfunc blend
+		rgbGen lightingdiffuse
+	}
+}
+
+models/mapobjects/vehicles/mercedes_1v
+
+{
+	{
+		map textures/effects/tinfx.tga
+		blendFunc GL_ONE GL_ZERO
+		rgbGen vertex
+		tcGen environment 
+	}
+	{
+		map models/mapobjects/vehicles/mercedes_1.TGA
+		blendfunc blend
+		rgbGen vertex
+	}
+}
+models/mapobjects/vehicles/car_shadow
+{
+	surfaceparm metalsteps		
+	cull twosided
+	{
+		map models/mapobjects/vehicles/car_shadow.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		rgbGen lightingdiffuse
+	}
+
+}
+
+models/mapobjects/vehicles/glass
+{
+	surfaceparm metalsteps		
+	cull twosided
+	{
+		map models/mapobjects/vehicles/glass.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		rgbGen lightingdiffuse
+	}
+
+}
+
+models/mapobjects/vehicles/glass2
+{
+	surfaceparm metalsteps		
+	cull twosided
+	{
+		map models/mapobjects/vehicles/glass.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		rgbGen lightingdiffuse
+	}
+
+}
+models/mapobjects/plants/flowers1
+{
+	surfaceparm alphashadow
+//	deformVertexes wave 194 sin 0 2 0 .1
+//	deformVertexes wave 30 sin 0 1 0 .3
+//	deformVertexes wave 194 sin 0 1 0 .4
+	cull twosided
+
+
+	{
+		map models/mapobjects/plants/flowers1.tga
+		alphaFunc GE128
+		rgbGen lightingdiffuse
+	}
+
+}
+
+models/mapobjects/plants/GRASS1
+{
+	surfaceparm alphashadow
+//	deformVertexes wave 194 sin 0 2 0 .1
+//	deformVertexes wave 30 sin 0 1 0 .3
+//	deformVertexes wave 194 sin 0 1 0 .4
+	cull twosided
+
+
+	{
+		map models/mapobjects/plants/GRASS1.tga
+	//	alphaFunc GE128
+		blendfunc blend
+		rgbGen lightingdiffuse
+	}
+
+}
+
+models/mapobjects/plants/GRASS1t
+{
+	surfaceparm alphashadow
+//	deformVertexes wave 194 sin 0 2 0 .1
+//	deformVertexes wave 30 sin 0 1 0 .3
+//	deformVertexes wave 194 sin 0 1 0 .4
+	cull twosided
+
+
+	{
+		map models/mapobjects/plants/GRASS1t.tga
+	//	alphaFunc GE128
+		blendfunc blend
+		rgbGen lightingdiffuse
+	}
+
+}
+
+models/mapobjects/plants/vine1
+{
+	surfaceparm alphashadow
+//	deformVertexes wave 194 sin 0 2 0 .1
+//	deformVertexes wave 30 sin 0 1 0 .3
+//	deformVertexes wave 194 sin 0 1 0 .4
+	cull twosided
+
+
+	{
+		map models/mapobjects/plants/vine1.tga
+	//	alphaFunc GE128
+		blendfunc blend
+		rgbGen lightingdiffuse
+	}
+
+}
+
+
+models/mapobjects/plants/dirt1
+{
+	surfaceparm alphashadow
+//	deformVertexes wave 194 sin 0 2 0 .1
+//	deformVertexes wave 30 sin 0 1 0 .3
+//	deformVertexes wave 194 sin 0 1 0 .4
+	cull twosided
+
+
+	{
+		map models/mapobjects/plants/dirt1.tga
+		rgbGen lightingdiffuse
+	}
+
+}
+models/mapobjects/plants/bushes1
+{
+	surfaceparm alphashadow
+//	deformVertexes wave 194 sin 0 2 0 .1
+//	deformVertexes wave 30 sin 0 1 0 .3
+//	deformVertexes wave 194 sin 0 1 0 .4
+	cull twosided
+
+
+	{
+		map models/mapobjects/plants/bushes1.tga
+		alphaFunc GE128
+//		rgbGen lightingdiffuse
+		rgbGen identity
+	}
+
+}
+models/mapobjects/plants/bushes2
+{
+	surfaceparm alphashadow
+//	deformVertexes wave 194 sin 0 2 0 .1
+//	deformVertexes wave 30 sin 0 1 0 .3
+//	deformVertexes wave 194 sin 0 1 0 .4
+	cull twosided
+
+
+	{
+		map models/mapobjects/plants/bushes2.tga
+		alphaFunc GE128
+		rgbGen lightingdiffuse
+//		rgbGen identity
+	}
+
+}
+
+models/mapobjects/plants/bushes3
+{
+	surfaceparm alphashadow
+//	deformVertexes wave 194 sin 0 2 0 .1
+//	deformVertexes wave 30 sin 0 1 0 .3
+//	deformVertexes wave 194 sin 0 1 0 .4
+	cull twosided
+
+
+	{
+		map models/mapobjects/plants/bushes3.tga
+		alphaFunc GE128
+//		rgbGen lightingdiffuse
+		rgbGen identity
+	}
+
+}
+models/mapobjects/plants/small_branch
+{
+	surfaceparm alphashadow
+	deformVertexes wave 194 sin 0 2 0 .1
+	deformVertexes wave 30 sin 0 1 0 .1
+	deformVertexes wave 194 sin 0 1 0 .1
+	cull twosided
+
+
+	{
+		map models/mapobjects/plants/small_branch.tga
+		alphaFunc GE128
+		rgbGen lightingdiffuse
+//		rgbGen identity
+	}
+
+}
+
+models/mapobjects/tree/trunck2l
+{
+	surfaceparm alphashadow
+//	deformVertexes wave 194 sin 0 2 0 .1
+//	deformVertexes wave 30 sin 0 1 0 .3
+//	deformVertexes wave 194 sin 0 1 0 .4
+	cull twosided
+
+
+	{
+		map models/mapobjects/tree/trunck2l.tga
+		rgbGen lightingdiffuse
+//		rgbGen identity
+	}
+
+}
+
+models/mapobjects/tree/trunck2al
+{
+
+	{
+		map models/mapobjects/tree/trunck2al.tga
+		rgbGen identity
+
+	}
+
+}
+
+models/mapobjects/tree/trunk_trn1
+{
+
+	{
+		map models/mapobjects/tree/trunk_trn1.tga
+		rgbGen identity
+
+	}
+
+}
+
+models/mapobjects/tree/trunk_trn2
+{
+
+	{
+		map models/mapobjects/tree/trunk_trn2.tga
+		rgbGen identity
+
+	}
+
+}
+
+models/mapobjects/plants/small_branch_t
+{
+	surfaceparm alphashadow
+//	deformVertexes wave 194 sin 0 2 0 .1
+	deformVertexes wave 30 sin 0 1 0 .1
+	deformVertexes wave 194 sin 0 1 0 .1
+	cull twosided
+
+
+	{
+		map models/mapobjects/plants/small_branch_t.tga
+		alphaFunc GE128
+//		rgbGen lightingdiffuse
+		rgbGen identity
+	}
+
+}
+
+models/mapobjects/tree/tree_vil2t
+{
+	surfaceparm alphashadow
+//	deformVertexes wave 194 sin 0 2 0 .1
+	deformVertexes wave 30 sin 0 1 0 .1
+	deformVertexes wave 194 sin 0 1 0 .1
+	cull twosided
+
+
+	{
+		map models/mapobjects/tree/tree_vil2t.tga
+		alphaFunc GE128
+//		rgbGen lightingdiffuse
+		rgbGen identity
+	}
+
+}
+
+models/mapobjects/tree/branch_vil1at
+{
+	surfaceparm alphashadow
+//	deformVertexes wave 194 sin 0 2 0 .1
+	deformVertexes wave 30 sin 0 1 0 .1
+	deformVertexes wave 194 sin 0 1 0 .1
+	cull twosided
+
+
+	{
+		map models/mapobjects/tree/branch_vil1at.tga
+		alphaFunc GE128
+//		rgbGen lightingdiffuse
+		rgbGen identity
+	}
+
+}
+
+
+models/mapobjects/tree/branch_vil1t
+{
+	surfaceparm alphashadow
+//	deformVertexes wave 194 sin 0 2 0 .1
+	deformVertexes wave 30 sin 0 1 0 .1
+	deformVertexes wave 194 sin 0 1 0 .1
+	cull twosided
+
+
+	{
+		map models/mapobjects/tree/branch_vil1t.tga
+		alphaFunc GE128
+//		rgbGen lightingdiffuse
+		rgbGen identity
+	}
+
+}
+
+models/powerups/holdable/glass_brandy
+{
+//	surfaceparm alphashadow
+//	cull twosided
+
+
+	{
+		map models/powerups/holdable/glass_brandy.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		rgbGen lightingdiffuse
+	}
+
+}
+
+
+models/weapons2/fg42/fg42_2
+{
+
+	{
+		map models/weapons2/fg42/fg42_2.tga
+		rgbGen lightingdiffuse
+	}
+}
+
+models/mapobjects/xlab_props/light
+{
+//    q3map_surfacelight 1000
+//    light 1
+//    surfaceparm nomarks
+    {
+        map $lightmap
+        rgbGen identity
+    }
+    {
+        map models/mapobjects/xlab_props/light.tga
+        blendFunc GL_DST_COLOR GL_ZERO
+        rgbGen identity
+    }
+    {
+        map models/mapobjects/xlab_props/light.tga
+        blendFunc GL_ONE GL_ONE
+    }
+}
+
+
+models/mapobjects/xlab_props/fwindow1
+
+{
+
+    q3map_surfacelight 5000
+    light 1
+    surfaceparm nomarks
+      {
+		map textures/props/fwindow1.tga
+		blendFunc GL_ONE GL_SRC_ALPHA
+		rgbGen identity
+	}
+
+	{
+		map $lightmap
+		blendFunc GL_DST_COLOR GL_ONE_MINUS_DST_ALPHA
+		rgbGen identity
+	}
+
+}
+
+models/mapobjects/snow_tree/stree_f1
+{
+	surfaceparm alphashadow
+	cull twosided
+
+
+	{
+		map models/mapobjects/snow_tree/stree_f1.tga
+//		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		alphaFunc GE128
+		rgbGen lightingdiffuse
+	}
+
+}
+
+
+models/mapobjects/snow_tree/stree_s1
+{
+	surfaceparm alphashadow
+	cull twosided
+
+
+	{
+		map models/mapobjects/snow_tree/stree_s1.tga
+//		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		alphaFunc GE128
+		rgbGen lightingdiffuse
+	}
+
+}
+
+models/mapobjects/door/xdoor_m01
+
+{
+	surfaceparm nomarks
+	{
+		map $lightmap
+		rgbGen identity
+	}
+	{
+		map textures/xlab_door/xdoor_m01.tga
+		blendFunc GL_DST_COLOR GL_ZERO
+		rgbGen identity
+	}
+}
+
+models/mapobjects/v2/v2
+{
+	{
+		map models/mapobjects/v2/v2.tga
+		rgbGen lightingdiffuse
+	}
+
+}
+
+models/mapobjects/v2/v2a
+
+{
+	surfaceparm nomarks
+
+	{
+		map models/mapobjects/v2/v2.tga
+//		blendFunc GL_DST_COLOR GL_ZERO
+		rgbGen vertex
+	}
+}
+
+models\mapobjects\furniture\chair1
+{
+	{
+		map models/mapobjects/furniture/chair1.tga
+		rgbGen lightingdiffuse
+	}
+
+}
+
+
+models/mapobjects/electronics/radar_01
+{      
+
+     	{
+		map models/mapobjects/electronics/radarsweep.tga
+		rgbGen identity
+		tcMod rotate 120
+	//	rgbgen wave triangle 0 1 0 7
+	//	tcMod scroll 1 0
+	}
+
+
+	{
+		map models/mapobjects/electronics/radarbeeps.tga
+		blendfunc blend
+		tcMod scroll .01 .001
+		rgbGen wave sin 1 .3 0 .25
+	}
+	{
+		map models/mapobjects/electronics/radar_01.tga
+		blendfunc blend
+		rgbGen vertex
+	}
+}
+
+models/mapobjects/light/chandlier3a
+{
+	nomipmaps
+	surfaceparm alphashadow
+	cull twosided
+
+
+	{
+		map models/mapobjects/light/chandlier3a.tga
+//		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		alphaFunc GE128
+		rgbGen lightingdiffuse
+	}
+
+}
+
+models/mapobjects/light/chandlier4
+{
+	nomipmaps
+	surfaceparm alphashadow
+	cull twosided
+
+
+	{
+		map models/mapobjects/light/chandlier4.tga
+//		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		alphaFunc GE128
+		rgbGen lightingdiffuse
+	}
+
+}
+
+models/mapobjects/light/chandlier4l
+{
+	{
+		map models/mapobjects/light/chandlier4l.tga
+		rgbGen lightingdiffuse
+	}
+
+}
+
+models/mapobjects/light/chandlier3
+{
+	{
+		map models/mapobjects/light/chandlier3.tga
+		rgbGen lightingdiffuse
+	}
+
+}
+
+models/weapons2/telsa/base_tesla4
+{      
+	cull twosided
+        
+	{
+		map models/weapons2/telsa/base_tesla4_l.tga
+		rgbGen identity
+		tcMod rotate 120
+		tcMod scroll 2 2
+	}
+	{
+		map models/weapons2/telsa/base_tesla4.tga
+		blendfunc blend
+		rgbGen vertex
+	}
+}
+
+models/mapobjects/ui/FLAME
+{
+	nopicmip
+	nomipmaps
+
+	{
+		map ui/assets/flame.tga
+	//	map models/mapobjects/ui/FLAME.tga
+	//	blendFunc GL_ONE_MINUS_SRC_ALPHA GL_SRC_ALPHA 
+		blendfunc blend
+		tcmod scale .4 .4
+		tcmod scroll 0 .08 
+		tcmod turb  .5 .02 0 .1
+		rgbGen identity
+	}
+	{
+		map ui/assets/flame.tga
+	//	blendFunc GL_ONE_MINUS_SRC_ALPHA GL_SRC_ALPHA 
+		blendfunc blend
+		tcmod scale .3 .3
+		tcmod scroll 0.001 .04 
+		tcmod turb  .5 .04 0 .1
+	}
+
+
+}
+
+
+models/mapobjects/telsagun/tesla1a
+{      
+	
+
+
+	{
+//		map models/weapons2/telsa/tesla1.tga
+		map textures/effects/regenmap3.tga
+		rgbGen identity
+		tcMod rotate 360
+		tcMod scroll 2 0
+	}
+	{
+		map models/mapobjects/telsagun/tesla1a.tga
+		blendfunc blend
+		rgbGen vertex
+	}
+
+        
+}
+
+models\mapobjects\furniture\grandfatherclock01
+ {
+
+    {  
+      map models/mapobjects/furniture/grandfatherclock01.tga
+      rgbGen identity
+    }
+ }
+
+models\mapobjects\letters\osa
+ {
+
+    {  
+      map models/mapobjects/letters/osa2.tga
+//	blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	alphafunc GT0
+      rgbGen identity
+    }
+ }
+
+
+models\mapobjects\barbwire\barb_wire
+{
+    surfaceparm metalsteps
+    nomipmaps
+    nopicmip
+    cull disable
+    {
+     map models/mapobjects/barbwire/barb_wire.tga
+     alphaFunc GE128
+     depthWrite
+     rgbGen identity
+
+    }
+}
+
+
+models/mapobjects/B-25/PROPELLER
+{
+	cull twosided
+	surfaceparm nomarks
+	{
+		map models/mapobjects/B-25/PROPELLER.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		rgbGen vertex
+		tcMod rotate 4000
+		alphaGen vertex
+	}
+}
+
+// textures/b-25/plane_ext1
+// {
+//	cull twosided
+//	surfaceparm nomarks
+//	{
+//		map textures/b-25/plane_ext1.tga
+//		rgbGen vertex
+//	}
+// }
+
+
+//  textures/b-25/plane_int5
+//  {
+//	cull twosided
+//	surfaceparm nomarks
+//	{
+//		map textures/b-25/plane_int5.tga
+//		rgbGen vertex
+//	}
+//  }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SP/media/scripts/particle.mtr b/SP/media/scripts/particle.mtr
new file mode 100644
index 0000000..5fe41a6
--- /dev/null
+++ b/SP/media/scripts/particle.mtr
@@ -0,0 +1,889 @@
+teslaDamageEffect
+{
+	{
+		map $whiteimage
+		blendFunc GL_DST_COLOR GL_ONE
+		rgbGen entity
+	}
+	{
+		map $whiteimage
+		blendFunc GL_DST_COLOR GL_ONE
+		rgbGen entity
+	}
+	{
+		map $whiteimage
+		blendFunc GL_DST_COLOR GL_ONE
+		rgbGen entity
+	}
+	{
+		map $whiteimage
+		blendFunc GL_DST_COLOR GL_ONE
+		rgbGen entity
+	}
+}
+
+teslaAltDamageEffect
+{
+	{
+		map $whiteimage
+		blendFunc GL_DST_COLOR GL_ONE
+		rgbGen entity
+	}
+	{
+		map $whiteimage
+		blendFunc GL_DST_COLOR GL_ONE
+		rgbGen entity
+	}
+}
+
+smokeParticle
+{
+	cull none
+	{
+		map sprites/smokepuff.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		alphaGen vertex
+	}
+}
+
+bulletParticleTrail
+{
+	cull none
+	entityMergable
+	{
+		map sprites/bullettrail.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		alphaGen vertex
+	}
+}
+
+loperGroundCharge
+{
+	allowCompress
+	cull none
+	polygonOffset
+	nofog
+	entityMergable
+	{
+		map sprites/loperGroundCharge.tga
+		blendFunc GL_SRC_ALPHA GL_ONE
+		rgbGen 	vertex
+		alphaGen vertex
+	}
+}
+
+sparkFlareParticle
+{
+	cull none
+	entityMergable
+	{
+		map gfx\misc\sunflare1.tga
+		blendFunc GL_SRC_ALPHA GL_ONE
+		rgbGen 	vertex
+		alphaGen vertex
+	}
+}
+
+sparkParticle
+{
+	cull none
+	entityMergable
+	{
+		map sprites/spark.tga
+		blendFunc GL_SRC_ALPHA GL_ONE
+		rgbGen 	vertex
+		alphaGen vertex
+	}
+}
+
+smokeTrail
+{
+	cull none
+	entityMergable
+	{
+		map sprites/smoketrail2.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		rgbGen 	vertex
+		alphaGen vertex
+	}
+}
+
+zombieSpiritTrail
+{
+	cull none
+	//entityMergable		// allow all the sprites to be merged together
+	{
+		map sprites/spirit_trail.tga
+		blendFunc GL_SRC_ALPHA GL_ONE
+		rgbGen		vertex
+		alphaGen	vertex
+	}
+}
+
+zombieSpiritSkull
+{
+	cull none
+	
+	
+
+	{
+		map models/mapobjects/skull/skull_spirit.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		rgbGen		identity
+		alphaGen	entity
+	}
+	
+}
+
+helgaSpiritTrail
+{
+	cull none
+	{
+		map sprites/spirit_trail.tga
+		blendFunc GL_SRC_ALPHA GL_ONE
+		rgbGen		vertex
+		alphaGen	vertex
+	}
+}
+
+helgaSpiritGhost
+{
+	cull none
+	surfaceparm nodlight
+	deformVertexes wave 100 sin 0.75 1.5 0 0.75
+	{
+		map models/players/beast/ghost.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	//	blendFunc blend
+	//	rgbGen		vertex
+		alphaGen	entity
+	}
+	
+}
+
+//--------------------------------------------------------------------
+// Zombie Death effects
+zombieDeathDust
+{
+	// expand the surface out from the model surface
+	deformVertexes wave 100 sin 1 0 0 0
+	// give it some character
+	deformVertexes wave 94 sin 0 1 0 1.2
+	cull none
+	{
+		map models/players/zombie/zom_body1.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		//tcGen environment
+		alphaGen normalzfade 0.7 -2.0 -0.5
+        //tcmod rotate 1200
+        //tcmod scroll 1 .2
+	}
+}
+
+zombieDeathWindTrail
+{
+	cull twosided
+	{
+		map sprites/zombie_dust.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		rgbGen vertex
+		alphaGen vertex
+	}
+}
+
+zombieBodyFade
+{
+	cull twosided
+	surfaceparm	trans
+	{
+		map models/players/zombie/zom_body1.tga
+		//blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+		alphaGen normalzfade 1.0 -1.0 -1000		// -1000 = zombie Hack
+	}
+}
+
+zombieHeadFade
+{
+	cull twosided
+	surfaceparm	trans
+	{
+		map models/players/zombie/zom_head1.tga
+		//blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		alphaFunc GE128
+		depthWrite
+		rgbGen lightingDiffuse
+		alphaGen normalzfade 1.0 -1.0 -1000		// -1000 = zombie Hack
+	}
+}
+
+// these used to be blendFunc add, but we made them alpha so they would fog better (the ablack.tga is an alpha version of the 8x8 black texture used when we need blend func anims like this)
+
+grenadeExplosion
+{
+	cull disable
+	{
+		animmap 7 gfx/colors/ablack.tga sprites/fire_sm_a.tga sprites/fire_sm_b.tga sprites/fire_sm_c.tga sprites/fire_sm_d.tga sprites/fire_sm_e.tga sprites/fire_sm_f.tga
+		rgbGen wave inversesawtooth 0 1 0 7
+		blendFunc GL_SRC_ALPHA GL_ONE
+	}
+	{
+		animmap 7  sprites/fire_sm_a.tga sprites/fire_sm_b.tga sprites/fire_sm_c.tga sprites/fire_sm_d.tga sprites/fire_sm_e.tga sprites/fire_sm_f.tga gfx/colors/ablack.tga
+		rgbGen wave sawtooth 0 1 0 7
+		blendFunc GL_SRC_ALPHA GL_ONE
+	}
+}
+
+
+rocketExplosion
+{
+	cull disable
+	{
+		animmap 7 gfx/colors/ablack.tga sprites/fire_sm_a.tga sprites/fire_sm_b.tga sprites/fire_sm_c.tga sprites/fire_sm_d.tga sprites/fire_sm_e.tga sprites/fire_sm_f.tga
+		rgbGen wave inversesawtooth 0 1 0 7
+		blendFunc GL_SRC_ALPHA GL_ONE
+	}
+	{
+		animmap 7  sprites/fire_sm_a.tga sprites/fire_sm_b.tga sprites/fire_sm_c.tga sprites/fire_sm_d.tga sprites/fire_sm_e.tga sprites/fire_sm_f.tga gfx/colors/ablack.tga
+		rgbGen wave sawtooth 0 1 0 7
+		blendFunc GL_SRC_ALPHA GL_ONE
+	}
+}
+
+// Ridah, temp only
+//flamethrowerHit
+//{
+//	cull disable
+//	{
+//		animmap 12 sprites/fire_sm_a.tga sprites/fire_sm_b.tga sprites/fire_sm_c.tga sprites/fire_sm_d.tga sprites/fire_sm_e.tga sprites/fire_sm_f.tga
+//		rgbGen wave inversesawtooth 0 1 0 12
+//		blendfunc GL_SRC_ALPHA GL_ONE
+//	}
+//	{
+//		animmap 12 sprites/fire_sm_b.tga sprites/fire_sm_c.tga sprites/fire_sm_d.tga sprites/fire_sm_e.tga sprites/fire_sm_f.tga gfx/colors/black.tga
+//		rgbGen wave sawtooth 0 1 0 12
+//		blendfunc GL_SRC_ALPHA GL_ONE
+//	}
+//}
+
+lightningBolt
+{
+	//nomipmap
+	nopicmip	// dont scale with texture details, since it looks bad
+	cull disable
+	nofog
+	entityMergable
+	{
+		map sprites\lightning.tga
+		blendfunc GL_SRC_ALPHA GL_ONE	// needs to be this or we get fog discoloration
+		rgbGen 	vertex
+		alphaGen vertex
+	}
+}
+
+lightningBoltGreen
+{
+	nopicmip	// dont scale with texture details, since it looks bad
+	cull disable
+	nofog
+	entityMergable
+	{
+		map sprites\lightninggreen.tga
+		blendfunc GL_SRC_ALPHA GL_ONE	// needs to be this or we get fog discoloration
+		rgbGen 	vertex
+		alphaGen vertex
+	}
+}
+
+lightningHitWall
+{
+	polygonOffset
+	{
+		map sprites/lightningGlow.tga
+		blendfunc GL_SRC_ALPHA GL_ONE	// needs to be this or we get fog discoloration
+		rgbGen 	vertex
+		alphaGen vertex
+	}
+}
+
+lightningWave
+{
+	nofog
+	polygonOffset
+	{
+		map sprites/lightningWave.tga
+		blendfunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_COLOR	// needs to be this or we get fog discoloration
+		rgbGen 	vertex
+		alphaGen vertex
+	}
+}
+
+flamethrowerBlueStream
+{
+//	nofog
+	cull none
+//	entityMergable
+	{
+		map sprites\fthrow_bluestream1.tga
+//		blendfunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_COLOR
+		blendfunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA	// needs to be this or we get fog discoloration
+		rgbGen 	vertex
+		alphaGen vertex
+	}
+}
+
+flamethrowerFireStream
+{
+	nofog
+	cull none
+	entityMergable
+	{
+		map sprites\fthrow_firestream2.tga
+		blendfunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_COLOR
+		rgbGen 	vertex
+		alphaGen vertex
+	}
+}
+
+// character on fire effect
+entityOnFire1
+{
+	allowCompress
+	// give it some character
+	deformVertexes wave 45 sin 0 10 0 -.6	// a negative frequency is for Z deformation based on normal
+	cull none
+	{	// flame top-side
+		animmapcomp 20 sprites/clnfire_lg/spr000.tga sprites/clnfire_lg/spr001.tga sprites/clnfire_lg/spr002.tga sprites/clnfire_lg/spr003.tga sprites/clnfire_lg/spr004.tga sprites/clnfire_lg/spr005.tga sprites/clnfire_lg/spr006.tga sprites/clnfire_lg/spr007.tga sprites/clnfire_lg/spr008.tga sprites/clnfire_lg/spr009.tga sprites/clnfire_lg/spr010.tga sprites/clnfire_lg/spr011.tga sprites/clnfire_lg/spr012.tga sprites/clnfire_lg/spr013.tga sprites/clnfire_lg/spr014.tga sprites/clnfire_lg/spr015.tga
+		animmapnocomp 20 sprites/clnfire/spr000.tga sprites/clnfire/spr001.tga sprites/clnfire/spr002.tga sprites/clnfire/spr003.tga sprites/clnfire/spr004.tga sprites/clnfire/spr005.tga sprites/clnfire/spr006.tga sprites/clnfire/spr007.tga sprites/clnfire/spr008.tga sprites/clnfire/spr009.tga sprites/clnfire/spr010.tga sprites/clnfire/spr011.tga sprites/clnfire/spr012.tga sprites/clnfire/spr013.tga sprites/clnfire/spr014.tga sprites/clnfire/spr015.tga
+		blendFunc GL_SRC_ALPHA GL_ONE
+		alphaGen normalzfade 1.0 -0.7 0.5
+	}
+}
+
+entityOnFire2
+{
+	allowCompress
+	{
+		animmapcomp 20 sprites/clnfire_lg/spr000.tga sprites/clnfire_lg/spr001.tga sprites/clnfire_lg/spr002.tga sprites/clnfire_lg/spr003.tga sprites/clnfire_lg/spr004.tga sprites/clnfire_lg/spr005.tga sprites/clnfire_lg/spr006.tga sprites/clnfire_lg/spr007.tga sprites/clnfire_lg/spr008.tga sprites/clnfire_lg/spr009.tga sprites/clnfire_lg/spr010.tga sprites/clnfire_lg/spr011.tga sprites/clnfire_lg/spr012.tga sprites/clnfire_lg/spr013.tga sprites/clnfire_lg/spr014.tga sprites/clnfire_lg/spr015.tga
+		animmapnocomp 20 sprites/clnfire/spr000.tga sprites/clnfire/spr001.tga sprites/clnfire/spr002.tga sprites/clnfire/spr003.tga sprites/clnfire/spr004.tga sprites/clnfire/spr005.tga sprites/clnfire/spr006.tga sprites/clnfire/spr007.tga sprites/clnfire/spr008.tga sprites/clnfire/spr009.tga sprites/clnfire/spr010.tga sprites/clnfire/spr011.tga sprites/clnfire/spr012.tga sprites/clnfire/spr013.tga sprites/clnfire/spr014.tga sprites/clnfire/spr015.tga
+		blendFunc GL_SRC_ALPHA GL_ONE
+		alphaGen normalzfade 1.0 -0.7 1.3
+	}
+	{	// blue under-side
+		map sprites/inferno_blue.tga
+		blendFunc GL_SRC_ALPHA GL_ONE
+		//tcGen environment
+		alphaGen normalzfade 1.0 -2.0 0.6
+		//tcmod rotate 12
+		//tcmod scroll 1 .2
+	}
+}
+
+sprites/smokeMap
+{
+	qer_editorimage sprites/smokeMap.tga
+	surfaceparm trans
+	surfaceparm nonsolid
+
+	allowCompress
+	// give it some character
+//	deformVertexes wave 0 sin 0 2 0 0	// a negative frequency is for Z deformation based on normal
+	deformVertexes wave 30 sin 0.6 1.4 0.6 0.42	// a negative frequency is for Z deformation based on normal
+	deformVertexes wave 25 sin 0 10 0 -0.6	// a negative frequency is for Z deformation based on normal
+	cull none
+	{	// water reflection
+		map sprites/smokeMap.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		alphaGen normalzfade 0.85 -0.9 0.9
+		//tcGen environment
+		tcmod scroll 0 -0.33
+		tcmod scale 4 1
+	}
+//	{	// water dripping
+//		map textures/liquids/water_m6.tga
+//		blendFunc GL_SRC_ALPHA GL_ONE
+//		alphaGen normalzfade 1.0 -0.8 0.5
+//		tcmod scroll 0 -0.3
+//	}
+	{	// water reflection
+		map sprites/smokeMap.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		alphaGen normalzfade 0.7 -0.9 0.9
+		//tcGen environment
+		tcmod scroll 0 -0.2
+		tcmod scale 5 1
+	}
+}
+
+dripWet2
+{
+	allowCompress
+	{	// water reflection
+		map sprites/smokeMap.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		alphaGen normalzfade 1.0 -0.8 0.5
+		//tcGen environment
+		tcmod scroll 0 -0.33
+	}
+//	{
+//		map sprites/smokeMap.tga
+//		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+//		alphaGen normalzfade 1.0 -0.7 0.5
+//		tcmod scroll 0 -0.4
+//	}
+}
+
+
+// Rafael - bats
+bats1
+{
+	cull none
+	entityMergable		// allow all the sprites to be merged together
+
+	{
+		map sprites/bats/bat1.tga
+		blendFunc GL_ZERO GL_ONE_MINUS_SRC_ALPHA
+		rgbGen		vertex
+		alphaGen	vertex
+	}
+}
+bats2
+{
+	cull none
+	entityMergable		// allow all the sprites to be merged together
+	{
+		map sprites/bats/bat2.tga
+		blendFunc GL_ZERO GL_ONE_MINUS_SRC_ALPHA
+		rgbGen		vertex
+		alphaGen	vertex
+	}
+}
+bats3
+{
+	cull none
+	entityMergable		// allow all the sprites to be merged together
+	{
+		map sprites/bats/bat3.tga
+		blendFunc GL_ZERO GL_ONE_MINUS_SRC_ALPHA
+		rgbGen		vertex
+		alphaGen	vertex
+	}
+}
+bats4
+{
+	cull none
+	entityMergable		// allow all the sprites to be merged together
+	{
+		map sprites/bats/bat4.tga
+		blendFunc GL_ZERO GL_ONE_MINUS_SRC_ALPHA
+		rgbGen		vertex
+		alphaGen	vertex
+	}
+}
+bats5
+{
+	cull none
+	entityMergable		// allow all the sprites to be merged together
+	{
+		map sprites/bats/bat5.tga
+		blendFunc GL_ZERO GL_ONE_MINUS_SRC_ALPHA
+		rgbGen		vertex
+		alphaGen	vertex
+	}
+}
+bats6
+{
+	cull none
+	entityMergable		// allow all the sprites to be merged together
+	{
+		map sprites/bats/bat6.tga
+		blendFunc GL_ZERO GL_ONE_MINUS_SRC_ALPHA
+		rgbGen		vertex
+		alphaGen	vertex
+	}
+}
+bats7
+{
+	cull none
+	entityMergable		// allow all the sprites to be merged together
+	{
+		map sprites/bats/bat7.tga
+		blendFunc GL_ZERO GL_ONE_MINUS_SRC_ALPHA
+		rgbGen		vertex
+		alphaGen	vertex
+	}
+}
+bats8
+{
+	cull none
+	entityMergable		// allow all the sprites to be merged together
+	{
+		map sprites/bats/bat8.tga
+		blendFunc GL_ZERO GL_ONE_MINUS_SRC_ALPHA
+		rgbGen		vertex
+		alphaGen	vertex
+	}
+}
+bats9
+{
+	cull none
+	entityMergable		// allow all the sprites to be merged together
+	{
+		map sprites/bats/bat9.tga
+		blendFunc GL_ZERO GL_ONE_MINUS_SRC_ALPHA
+		rgbGen		vertex
+		alphaGen	vertex
+	}
+}
+bats10
+{
+	cull none
+	entityMergable		// allow all the sprites to be merged together
+	{
+		map sprites/bats/bat10.tga
+		blendFunc GL_ZERO GL_ONE_MINUS_SRC_ALPHA
+		rgbGen		vertex
+		alphaGen	vertex
+	}
+}
+//done
+
+blood_dot1
+{
+	polygonOffset
+	{
+		map sprites/blood_dot1.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		rgbGen vertex
+		alphaGen vertex
+	}
+}
+blood_dot2
+{
+	polygonOffset
+	{
+		map sprites/blood_dot2.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		rgbGen vertex
+		alphaGen vertex
+	}
+}
+blood_dot3
+{
+	polygonOffset
+	{
+		map sprites/blood_dot3.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		rgbGen vertex
+		alphaGen vertex
+	}
+}
+blood_dot4
+{
+	polygonOffset
+	{
+		map sprites/blood_dot4.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		rgbGen vertex
+		alphaGen vertex
+	}
+}
+blood_dot5
+{
+	polygonOffset
+	{
+		map sprites/blood_dot5.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		rgbGen vertex
+		alphaGen vertex
+	}
+}
+
+// Flamethrower Nozzle
+nozzleFlame1
+{
+	nofog
+	cull none
+	{
+		map sprites\nozzle\noz001.tga
+		blendfunc GL_ONE GL_ONE_MINUS_SRC_COLOR
+//		blendfunc GL_ONE GL_ONE_MINUS_SRC_COLOR_MINUS_SRC_ALPHA
+		rgbGen 	vertex
+		alphaGen vertex
+	}
+}
+nozzleFlame2
+{
+	nofog
+	cull none
+	{
+		map sprites\nozzle\noz002.tga
+		blendfunc GL_ONE GL_ONE_MINUS_SRC_COLOR
+//		blendfunc GL_ONE GL_ONE_MINUS_SRC_COLOR_MINUS_SRC_ALPHA
+		rgbGen 	vertex
+		alphaGen vertex
+	}
+}
+nozzleFlame3
+{
+	nofog
+	cull none
+	{
+		map sprites\nozzle\noz003.tga
+		blendfunc GL_ONE GL_ONE_MINUS_SRC_COLOR
+//		blendfunc GL_ONE GL_ONE_MINUS_SRC_COLOR_MINUS_SRC_ALPHA
+		rgbGen 	vertex
+		alphaGen vertex
+	}
+}
+nozzleFlame4
+{
+	nofog
+	cull none
+	{
+		map sprites\nozzle\noz004.tga
+		blendfunc GL_ONE GL_ONE_MINUS_SRC_COLOR
+//		blendfunc GL_ONE GL_ONE_MINUS_SRC_COLOR_MINUS_SRC_ALPHA
+		rgbGen 	vertex
+		alphaGen vertex
+	}
+}
+nozzleFlame5
+{
+	nofog
+	cull none
+	{
+		map sprites\nozzle\noz005.tga
+		blendfunc GL_ONE GL_ONE_MINUS_SRC_COLOR
+//		blendfunc GL_ONE GL_ONE_MINUS_SRC_COLOR_MINUS_SRC_ALPHA
+		rgbGen 	vertex
+		alphaGen vertex
+	}
+}
+nozzleFlame6
+{
+	nofog
+	cull none
+	{
+		map sprites\nozzle\noz006.tga
+		blendfunc GL_ONE GL_ONE_MINUS_SRC_COLOR
+//		blendfunc GL_ONE GL_ONE_MINUS_SRC_COLOR_MINUS_SRC_ALPHA
+		rgbGen 	vertex
+		alphaGen vertex
+	}
+}
+nozzleFlame7
+{
+	nofog
+	cull none
+	{
+		map sprites\nozzle\noz007.tga
+		blendfunc GL_ONE GL_ONE_MINUS_SRC_COLOR
+//		blendfunc GL_ONE GL_ONE_MINUS_SRC_COLOR_MINUS_SRC_ALPHA
+		rgbGen 	vertex
+		alphaGen vertex
+	}
+}
+nozzleFlame8
+{
+	nofog
+	cull none
+	{
+		map sprites\nozzle\noz008.tga
+		blendfunc GL_ONE GL_ONE_MINUS_SRC_COLOR
+//		blendfunc GL_ONE GL_ONE_MINUS_SRC_COLOR_MINUS_SRC_ALPHA
+		rgbGen 	vertex
+		alphaGen vertex
+	}
+}
+
+sprites/percentdot
+{
+	nopicmip
+	nomipmaps
+	{
+		map sprites/percentdot.tga
+		blendfunc GL_ONE GL_ONE
+	}
+}
+
+viewFlashBlood
+{
+	sort	nearest
+	{
+		//map *white
+		map sprites/viewflash_red.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		//rgbGen identityLighting
+		alphaGen vertex
+	}
+}
+
+viewFadeBlack
+{
+	sort	nearest
+	{
+		map			*white
+		blendFunc GL_ZERO GL_ONE_MINUS_SRC_ALPHA
+		rgbGen wave square 0 0 0 0				// just solid black
+		alphaGen entity
+	}	
+}
+
+bloodTrail
+{
+	cull disable
+	{
+		map models/weaphits/blood204.tga
+		blendfunc blend
+	}
+}
+
+
+viewFlashFire
+{
+	sort	nearest
+	{
+		//map *white
+		animmap 20 sprites/inferno/inf0003.tga sprites/inferno/inf0004.tga sprites/inferno/inf0005.tga sprites/inferno/inf0006.tga sprites/inferno/inf0007.tga sprites/inferno/inf0008.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		//blendFunc GL_SRC_ALPHA GL_ONE
+		//rgbGen identityLighting
+		alphaGen vertex
+	}
+}
+
+bloodCloud
+{
+	cull none
+	entityMergable
+	{
+		map sprites/bloodCloud.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		rgbGen vertex
+		alphaGen vertex
+	}
+}
+
+// zombie dlight
+flamedlightshader
+{
+	{
+		map $dlight
+		blendfunc GL_DST_COLOR GL_ONE
+	}
+	{
+		map $dlight
+		blendfunc GL_DST_COLOR GL_ONE
+	}
+	{
+		map $dlight
+		blendfunc GL_DST_COLOR GL_ONE
+	}
+}
+
+viewTeslaDamageEffect
+{
+	nofog
+	cull disable
+	sort nearest
+	{
+		map $whiteimage
+		blendFunc GL_DST_COLOR GL_ONE
+		rgbGen entity
+	}
+	{
+		map $whiteimage
+		blendFunc GL_DST_COLOR GL_ONE
+		rgbGen entity
+	}
+	{
+		map $whiteimage
+		blendFunc GL_DST_COLOR GL_ONE
+		rgbGen entity
+	}
+	{
+		map $whiteimage
+		blendFunc GL_DST_COLOR GL_ONE
+		rgbGen entity
+	}
+}
+
+viewTeslaAltDamageEffect
+{
+	nofog
+	cull disable
+	sort nearest
+	{
+		map $whiteimage
+		blendFunc GL_DST_COLOR GL_ONE
+		rgbGen entity
+	}
+	{
+		map $whiteimage
+		blendFunc GL_DST_COLOR GL_ONE
+		rgbGen entity
+	}
+}
+
+sprites/aistate1
+{
+	{
+		map sprites/relaxed.tga
+		blendfunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+sprites/aistate2
+{
+	{
+		map sprites/query.tga
+		blendfunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+sprites/aistate3
+{
+	{
+		map sprites/alerted.tga
+		blendfunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+sprites/aistate4
+{
+	{
+		map sprites/combat.tga
+		blendfunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+// ===========================
+// Nerve Gun fire hitting grass/sand
+// ===========================
+dirt_splash
+{
+	cull none
+	entityMergable
+	{
+		map models/weaphits/sand_splash.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		rgbGen vertex
+		alphaGen vertex
+	}
+}
+
+water_splash
+{
+	cull none
+	entityMergable
+	{
+		map models/weaphits/water_splash.tga
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+		rgbGen vertex
+		alphaGen vertex
+	}
+}
diff --git a/SP/media/scripts/terrain.mtr b/SP/media/scripts/terrain.mtr
new file mode 100644
index 0000000..44a4df8
--- /dev/null
+++ b/SP/media/scripts/terrain.mtr
@@ -0,0 +1,4480 @@
+///////////////// terrain ////////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra1_0
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock9c.tga
+		rgbGen vertexLit
+		tcmod scale 0.125 0.125
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra1_1
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock12c.tga
+		rgbGen vertexLit
+		tcmod scale 0.125 0.125 
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra1_2
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock10c.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+
+}
+textures/terrain/mxterra1_0to1
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock9c.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.125 0.125 
+	}
+	{
+		map textures/stone/mxrock12c.tga
+		tcmod scale 0.125 0.125 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra1_0to2
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock9c.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.125 0.125
+	}
+	{
+		map textures/stone/mxrock10c.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra1_1to2
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock12c.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.125 0.125
+	}
+	{
+		map textures/stone/mxrock10c.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+///////////////// baseout ////////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra2_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0bo.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1
+	}
+}
+
+textures/terrain/mxterra2_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1 
+	}
+}
+
+textures/terrain/mxterra2_2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2bo.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra2_3
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3bo.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra2_4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra2_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0bo.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock1b.tga
+		tcmod scale 0.1 0.1
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra2_0to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0bo.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock2bo.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra2_0to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0bo.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock3bo.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra2_0to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0bo.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+textures/terrain/mxterra2_1to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock2bo.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra2_1to3
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock3bo.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra2_1to4
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra2_2to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2bo.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock3bo.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra2_2to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2bo.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+textures/terrain/mxterra2_3to4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3bo.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+///////////////// forest ////////////////////////
+/////////////////////////////////////////////////
+
+textures/terrain/mxterra3_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra3_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra3_2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2b.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra3_3
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra3_4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra3_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock1b.tga
+		tcmod scale 0.1 0.1
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra3_0to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock2b.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra3_0to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra3_0to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+
+textures/terrain/mxterra3_1to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock2b.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra3_1to3
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra3_1to4
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra3_2to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra3_2to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra3_3to4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3g.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+
+///////////////// sfm ////////////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra4_0
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxdebri0.tga
+		rgbGen vertexLit
+		tcmod scale 0.25 0.25
+	}
+}
+
+textures/terrain/mxterra4_1
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxdebri1.tga
+		rgbGen vertexLit
+		tcmod scale 0.25 0.25
+	}
+}
+
+textures/terrain/mxterra4_2
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxdebri2.tga
+		rgbGen vertexLit
+		tcmod scale 0.05 0.05 
+	}
+}
+
+textures/terrain/mxterra4_3
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxdebri3.tga
+		rgbGen vertexLit
+		tcmod scale 0.05 0.05 
+	}
+}
+
+textures/terrain/mxterra4_4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxdebri4.tga
+		rgbGen vertexLit
+		tcmod scale 0.05 0.05 
+	}
+}
+
+textures/terrain/mxterra4_0to1
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxdebri0.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.25 0.25
+	}
+	{
+		map textures/stone/mxdebri1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.25 0.25
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra4_0to2
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxdebri0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.25 0.25
+	}
+	{
+		map textures/stone/mxdebri2.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra4_0to3
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxdebri0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.25 0.25
+	}
+	{
+		map textures/stone/mxdebri3.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra4_0to4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxdebri0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.25 0.25
+	}
+	{
+		map textures/stone/mxdebri4.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+textures/terrain/mxterra4_1to2
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxdebri1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.25 0.25
+	}
+	{
+		map textures/stone/mxdebri2.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra4_1to3
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxdebri1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.25 0.25
+	}
+	{
+		map textures/stone/mxdebri3.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra4_1to4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxdebri1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.25 0.25
+	}
+	{
+		map textures/stone/mxdebri4.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra4_2to3
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxdebri2.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxdebri3.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra4_2to4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxdebri2.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxdebri4.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+textures/terrain/mxterra4_3to4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxdebri3.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxdebri4.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+///////////////// snow ///////////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra5_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow0.tga
+		rgbGen vertexLit
+		tcmod scale 0.05 0.05
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra5_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow1.tga
+		rgbGen vertexLit
+		tcmod scale 0.025 0.025
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra5_2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow2.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra5_3
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow3.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra5_4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra5_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow0.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxsnow1.tga
+		tcmod scale 0.025 0.025
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra5_0to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05
+	}
+	{
+		map textures/stone/mxsnow2.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra5_0to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05
+	}
+	{
+		map textures/stone/mxsnow3.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra5_0to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05
+	}
+	{
+		map textures/stone/mxsnow4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+
+}
+
+textures/terrain/mxterra5_1to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxsnow2.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra5_1to3
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxsnow3.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra5_1to4
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxsnow4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra5_2to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow2.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxsnow3.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra5_2to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow2.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxsnow4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+
+textures/terrain/mxterra5_3to4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow3.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxsnow4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+
+///////////////// beach //////////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra6_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsand0.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra6_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsand1.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra6_2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsand2.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+
+}
+
+textures/terrain/mxterra6_3
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsand3.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+
+}
+
+textures/terrain/mxterra6_4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsand4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+
+}
+
+textures/terrain/mxterra6_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsand0.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxsand1.tga
+		tcmod scale 0.1 0.1
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+
+}
+
+textures/terrain/mxterra6_0to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsand0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxsand2.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+
+}
+
+textures/terrain/mxterra6_0to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsand0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxsand3.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+
+}
+
+textures/terrain/mxterra6_0to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsand0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxsand4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra6_1to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsand1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxsand2.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra6_1to3
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsand1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxsand3.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra6_1to4
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsand1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxsand4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra6_2to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsand2.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxsand3.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+textures/terrain/mxterra6_2to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsand2.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxsand4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+
+textures/terrain/mxterra6_3to4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsand3.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxsand4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	{
+		map textures/skies2/clouds2.tga
+		blendfunc filter
+		tcmod scale 0.01 0.01
+		tcMod scroll -0.01 -0.05
+	}
+}
+
+
+///////////////// tram /////////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra7_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxxsnow0.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1
+	}	
+}
+
+textures/terrain/mxterra7_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxxsnow1.tga
+		rgbGen vertexLit
+		tcmod scale .025 .025 
+	}
+}
+
+textures/terrain/mxterra7_2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxxsnow2.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra7_3
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxxsnow3.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra7_4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxxsnow4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra7_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxxsnow0.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxxsnow1.tga
+		tcmod scale .05 .05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra7_0to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxxsnow0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxxsnow2.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra7_0to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxxsnow0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxxsnow3.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra7_0to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxxsnow0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxxsnow4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra7_1to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxxsnow1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale .025 .025  
+	}
+	{
+		map textures/stone/mxxsnow2.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra7_1to3
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxxsnow1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale .025 .025   
+	}
+	{
+		map textures/stone/mxxsnow3.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra7_1to4
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxxsnow1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale .025 .025 
+	}
+	{
+		map textures/stone/mxxsnow4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra7_2to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxxsnow2.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxxsnow3.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra7_2to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxxsnow2.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxxsnow4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra7_3to4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxxsnow3.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxxsnow4.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+///////////////// assault /////////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra8_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1
+	}
+}
+
+textures/terrain/mxterra8_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1 
+	}
+}
+
+textures/terrain/mxterra8_2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra8_3
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3_a.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra8_4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1aa.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra8_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock1.tga
+		tcmod scale 0.1 0.1
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra8_0to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock2.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra8_0to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock3_a.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra8_0to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock1aa.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra8_1to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock2.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra8_1to3
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock3_a.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra8_1to4
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock1aa.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra8_2to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock3_a.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra8_2to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock1aa.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra8_3to4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3_a.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock1aa.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+///////////////// village1 ///////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra9_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/snow/s_dirt_m03i_2.tga
+		rgbGen vertexLit
+		tcmod scale 0.3 0.3
+	}
+}
+
+textures/terrain/mxterra9_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/snow/s_floor_l_01.tga
+		rgbGen vertexLit
+		tcmod scale 0.3 0.3 
+	}
+}
+
+textures/terrain/mxterra9_2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/snow/s_grass_ml03b.tga
+		tcmod scale 0.3 0.3
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra9_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/snow/s_dirt_m03i_2.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.3 0.3 
+	}
+	{
+		map textures/snow/s_floor_l_01.tga
+		tcmod scale 0.3 0.3
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra9_0to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/snow/s_dirt_m03i_2.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.3 0.3
+	}
+	{
+		map textures/snow/s_grass_ml03b.tga
+		tcmod scale 0.3 0.3 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra9_1to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/snow/s_floor_l_01.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.3 0.3 
+	}
+	{
+		map textures/snow/s_grass_ml03b.tga
+		tcmod scale 0.3 0.3 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+///////////////// training ///////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra10_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0t.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1
+	}
+
+}
+
+textures/terrain/mxterra10_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1 
+	}
+
+}
+
+textures/terrain/mxterra10_2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2t.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+	
+
+}
+
+textures/terrain/mxterra10_3
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+
+
+}
+
+textures/terrain/mxterra10_4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock4c.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+	}
+
+
+}
+
+textures/terrain/mxterra10_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0t.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock1b.tga
+		tcmod scale 0.1 0.1
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+
+}
+
+textures/terrain/mxterra10_0to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0t.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock2t.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+
+}
+
+textures/terrain/mxterra10_0to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0t.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	
+
+}
+
+textures/terrain/mxterra10_0to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0t.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock4c.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+
+}
+
+textures/terrain/mxterra10_1to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock2t.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+}
+
+textures/terrain/mxterra10_1to3
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+}
+
+textures/terrain/mxterra10_1to4
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock4c.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+}
+
+textures/terrain/mxterra10_2to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2t.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+}
+
+textures/terrain/mxterra10_2to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2t.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock4c.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+}
+
+textures/terrain/mxterra10_3to4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3g.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock4c.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+}
+
+
+///////////////// dam terrain ////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra11_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0bds.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1
+	}
+}
+
+textures/terrain/mxterra11_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1bds.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1 
+	}
+}
+
+textures/terrain/mxterra11_2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2bo.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra11_3
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3_a.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra11_4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra11_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0bds.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock1bds.tga
+		tcmod scale 0.1 0.1
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra11_0to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0bds.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock2bo.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra11_0to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0bds.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock3_a.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra11_0to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0bds.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+textures/terrain/mxterra11_1to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1bds.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock2bo.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra11_1to3
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1bds.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock3_a.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra11_1to4
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1bds.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra11_2to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2bo.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock3_a.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra11_2to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2bo.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra11_3to4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3_a.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+///////////////// dam skybox /////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra12_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		tcmod scale 1 1
+	}
+}
+
+textures/terrain/mxterra12_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		tcmod scale .75 .75
+	}
+}
+
+textures/terrain/mxterra12_2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2b.tga
+		tcmod scale .75 .75
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra12_3
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale .75 .75
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra12_4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale .75 .75
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra12_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale .75 .75
+	}
+	{
+		map textures/stone/mxrock1b.tga
+		tcmod scale 1 1
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra12_0to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 1 1
+	}
+	{
+		map textures/stone/mxrock2b.tga
+		tcmod scale .75 .75
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra12_0to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 1 1
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale .75 .75
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra12_0to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 1 1
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 1 1
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra12_1to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale .75 .75
+	}
+	{
+		map textures/stone/mxrock2b.tga
+		tcmod scale .75 .75
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra12_1to3
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale .75 .75
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale .75 .75
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra12_1to4
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale .75 .75
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale .75 .75
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra12_2to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale .75 .75
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale .75 .75
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra12_2to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale .75 .75
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale .75 .75
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra12_3to4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3g.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale .75 .75
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale .75 .75
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+///////////////// escape /////////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra13_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/rock/roc_m01p.tga
+		rgbGen vertexLit
+		tcmod scale .05 .05
+	}
+}
+
+textures/terrain/mxterra13_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/rock/roc_m01p.tga
+		rgbGen vertexLit
+		tcmod scale .075 .075
+	}
+
+
+}
+
+textures/terrain/mxterra13_2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/snow/s_grass_ml03a_s.tga
+		tcmod scale .075 .075
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra13_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures//rock/roc_m01aa.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale .075 .075
+	}
+	{
+		map textures/rock/roc_m01p.tga
+		tcmod scale 1 1
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra13_0to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/rock/roc_m01p.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale .05 .05
+	}
+	{
+		map textures/snow/s_grass_ml03a_s.tga
+		tcmod scale .075 .075
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra13_1to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/rock/roc_m01p.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale .075 .075
+	}
+	{
+		map textures/snow/s_grass_ml03a_s.tga
+		tcmod scale .075 .075
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+///////////////// dark forest ////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra14_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1
+	}
+}
+
+textures/terrain/mxterra14_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1 
+	}	
+}
+
+textures/terrain/mxterra14_2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2b.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra14_3
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra14_4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+	}
+}
+
+textures/terrain/mxterra14_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock1b.tga
+		tcmod scale 0.1 0.1
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra14_0to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock2b.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra14_0to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra14_0to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra14_1to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock2b.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra14_1to3
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra14_1to4
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra14_2to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra14_2to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra14_3to4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3g.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock4b.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+///////////////// norway /////////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra15_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow0.tga
+		rgbGen vertexLit
+		tcmod scale 0.05 0.05
+	}
+}
+
+textures/terrain/mxterra15_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow3.tga
+		rgbGen vertexLit
+		tcmod scale 0.025 0.025
+	}
+}
+
+textures/terrain/mxterra15_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow0.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxsnow3.tga
+		tcmod scale 0.025 0.025
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+/////////////////end ///////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra16_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+//		map textures/stone/dirt_m03.tga
+		map textures/stone/ground_c09a.tga
+//		map textures/stone/mxrock0t.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1
+	}
+
+}
+
+textures/terrain/mxterra16_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1 
+	}
+
+}
+
+textures/terrain/mxterra16_2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+//	      map textures/stone/ground_c09a.tga
+		map textures/stone/mxrock4ca.tga
+//		map textures/stone/dirt_m03.tga
+		tcmod scale 0.05 0.05
+		rgbGen vertexLit
+	}
+	
+
+}
+// assault_rock/ground_c09a
+// terrain/dirt_m03
+textures/terrain/mxterra16_3
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+	}
+
+
+}
+
+textures/terrain/mxterra16_4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/dirt_m03.tga
+//		map textures/stone/mxrock4ca.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+	}
+
+
+}
+
+textures/terrain/mxterra16_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/ground_c09a.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock1b.tga
+		tcmod scale 0.1 0.1
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+
+}
+
+textures/terrain/mxterra16_0to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/ground_c09a.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock4ca.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+
+}
+
+textures/terrain/mxterra16_0to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/ground_c09a.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+	
+
+}
+
+textures/terrain/mxterra16_0to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/ground_c09a.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1
+	}
+	{
+		map textures/stone/dirt_m03.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+
+}
+
+textures/terrain/mxterra16_1to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock4ca.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+}
+
+textures/terrain/mxterra16_1to3
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+}
+
+textures/terrain/mxterra16_1to4
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1b.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/dirt_m03.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+}
+
+textures/terrain/mxterra16_2to3
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock4ca.tga
+
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxrock3g.tga
+		tcmod scale 0.05 0.05 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+}
+
+textures/terrain/mxterra16_2to4
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock4ca.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/dirt_m03.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+}
+
+textures/terrain/mxterra16_3to4
+{
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3g.tga
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/dirt_m03.tga
+		tcmod scale 0.1 0.1 
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+
+}
+
+
+
+///////////////// Boss2 /////////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra17_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow0.tga
+		rgbGen vertexLit
+		tcmod scale 0.05 0.05
+	}
+}
+
+textures/terrain/mxterra17_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow3.tga
+		rgbGen vertexLit
+		tcmod scale 0.025 0.025
+	}
+}
+
+textures/terrain/mxterra17_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow0.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.05 0.05 
+	}
+	{
+		map textures/stone/mxsnow3.tga
+		tcmod scale 0.025 0.025
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+///////////////// baseout2 ////////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra18_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2t.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1
+	}
+}
+
+textures/terrain/mxterra18_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3_a.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1 
+	}
+}
+
+textures/terrain/mxterra18_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2t.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock3_a.tga
+		tcmod scale 0.1 0.1
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+///////////////// assault2 /////////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra19_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1
+	}
+}
+
+textures/terrain/mxterra19_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3_a.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1 
+	}
+}
+
+textures/terrain/mxterra19_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock3_a.tga
+		tcmod scale 0.1 0.1
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+
+///////////////// Dam2 /////////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra20_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1
+	}
+}
+
+textures/terrain/mxterra20_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3_a.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1 
+	}
+}
+
+textures/terrain/mxterra20_2
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock1aa.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1 
+	}
+}
+
+textures/terrain/mxterra20_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock3_a.tga
+		tcmod scale 0.1 0.1
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+textures/terrain/mxterra20_0to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock1aa.tga
+		tcmod scale 0.1 0.1
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra20_1to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock3_a.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock1aa.tga
+		tcmod scale 0.1 0.1
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+///////////////// Heinrich /////////////////////
+//////////////////////////////////////////////
+
+textures/terrain/mxterra21_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/dirt_m03.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1
+	}
+}
+
+textures/terrain/mxterra21_1
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock4ca.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1 
+	}
+}
+
+textures/terrain/mxterra21_2
+{
+	surfaceparm gravelsteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/ground_c09a.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1 
+	}
+}
+
+textures/terrain/mxterra21_0to1
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/dirt_m03.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/mxrock4ca.tga
+		tcmod scale 0.1 0.1
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+textures/terrain/mxterra21_0to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/dirt_m03.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/ground_c09a.tga
+		tcmod scale 0.1 0.1
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+textures/terrain/mxterra21_1to2
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock4ca.tga	
+		rgbGen vertexLit
+		alphaGen vertex
+		tcmod scale 0.1 0.1 
+	}
+	{
+		map textures/stone/ground_c09a.tga
+		tcmod scale 0.1 0.1
+		rgbGen vertexLit
+		alphaGen vertex
+		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+	}
+}
+
+
+
+/////////////////end ///////////////////
+//////////////////////////////////////////////
+
+
+
+
+textures/terrain/forest_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock0b.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1
+	}
+
+}
+
+
+textures/terrain/snow_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxsnow3.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1
+
+	}
+
+}
+
+textures/terrain/rubble_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxdebri0.tga
+		rgbGen vertexLit
+		tcmod scale 0.25 0.25
+
+	}
+
+}
+
+textures/terrain/rock_0
+{
+	surfaceparm grasssteps
+	surfaceparm nolightmap
+	q3map_novertexshadows
+	q3map_forcesunlight	
+	{
+		map textures/stone/mxrock2t.tga
+		rgbGen vertexLit
+		tcmod scale 0.1 0.1
+
+	}
+
+}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/debian/changelog b/debian/changelog
index f178830..1bb65b1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+iortcw (1.51.c+dfsg1+git20220119.1.bc09878-1) UNRELEASED; urgency=low
+
+  * New upstream snapshot.
+  * Drop patch build-Link-game-cgame-ui-modules-to-LIBS.patch, present upstream.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Sat, 05 Mar 2022 06:47:57 -0000
+
 iortcw (1.51.c+dfsg1-3) unstable; urgency=medium
 
   * Update AppArmor profiles to use abstractions from 2.13.x.
diff --git a/debian/patches/All-Rend2-Stub-out-USE_BOX_CUBEMAP_PARALLAX-on-GLSL-1.30.patch b/debian/patches/All-Rend2-Stub-out-USE_BOX_CUBEMAP_PARALLAX-on-GLSL-1.30.patch
index d1f4a5b..68e3c6c 100644
--- a/debian/patches/All-Rend2-Stub-out-USE_BOX_CUBEMAP_PARALLAX-on-GLSL-1.30.patch
+++ b/debian/patches/All-Rend2-Stub-out-USE_BOX_CUBEMAP_PARALLAX-on-GLSL-1.30.patch
@@ -10,11 +10,11 @@ Origin: upstream, 1.51d, commit:4bbfab9fd0e3fa359571ad6a40e9790e2d013fa6
  SP/code/rend2/glsl/lightall_fp.glsl | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
 
-diff --git a/MP/code/rend2/glsl/lightall_fp.glsl b/MP/code/rend2/glsl/lightall_fp.glsl
-index 443aff1..73b92ac 100644
---- a/MP/code/rend2/glsl/lightall_fp.glsl
-+++ b/MP/code/rend2/glsl/lightall_fp.glsl
-@@ -441,7 +441,7 @@ void main()
+Index: iortcw/MP/code/rend2/glsl/lightall_fp.glsl
+===================================================================
+--- iortcw.orig/MP/code/rend2/glsl/lightall_fp.glsl
++++ iortcw/MP/code/rend2/glsl/lightall_fp.glsl
+@@ -445,7 +445,7 @@ void main()
  	// from http://seblagarde.wordpress.com/2012/09/29/image-based-lighting-approaches-and-parallax-corrected-cubemap/
  	vec3 parallax = u_CubeMapInfo.xyz + u_CubeMapInfo.w * viewDir;
  
@@ -23,11 +23,11 @@ index 443aff1..73b92ac 100644
  	vec3 cubeLightColor = hitCube(R * u_CubeMapInfo.w, parallax, u_CubeMapInfo.www, ROUGHNESS_MIPS * roughness, u_CubeMap).rgb * u_EnableTextures.w;
    #else
  	vec3 cubeLightColor = textureCubeLod(u_CubeMap, R + parallax, ROUGHNESS_MIPS * roughness).rgb * u_EnableTextures.w;
-diff --git a/SP/code/rend2/glsl/lightall_fp.glsl b/SP/code/rend2/glsl/lightall_fp.glsl
-index 443aff1..73b92ac 100644
---- a/SP/code/rend2/glsl/lightall_fp.glsl
-+++ b/SP/code/rend2/glsl/lightall_fp.glsl
-@@ -441,7 +441,7 @@ void main()
+Index: iortcw/SP/code/rend2/glsl/lightall_fp.glsl
+===================================================================
+--- iortcw.orig/SP/code/rend2/glsl/lightall_fp.glsl
++++ iortcw/SP/code/rend2/glsl/lightall_fp.glsl
+@@ -445,7 +445,7 @@ void main()
  	// from http://seblagarde.wordpress.com/2012/09/29/image-based-lighting-approaches-and-parallax-corrected-cubemap/
  	vec3 parallax = u_CubeMapInfo.xyz + u_CubeMapInfo.w * viewDir;
  
diff --git a/debian/patches/build-Link-game-cgame-ui-modules-to-LIBS.patch b/debian/patches/build-Link-game-cgame-ui-modules-to-LIBS.patch
deleted file mode 100644
index 2633b7c..0000000
--- a/debian/patches/build-Link-game-cgame-ui-modules-to-LIBS.patch
+++ /dev/null
@@ -1,123 +0,0 @@
-From: Simon McVittie <smcv@debian.org>
-Date: Fri, 24 Jul 2020 10:55:56 +0100
-Subject: build: Link game, cgame, ui modules to $(LIBS)
-
-All three modules call mathematical functions like atan2(). On glibc
-systems, when compiled to native code with an ordinary C compiler
-(as opposed to bytecode from q3lcc), they get the definition of those
-functions from libm.
-
-Until now, they were not explicitly linked to libm, and instead relied
-on the fact that libm is linked into the main executable. However,
-doing it this way defeats glibc's symbol-versioning mechanisms, and
-can fail in some situations, in particular binaries built with
--ffast-math on a pre-2.31 version of glibc (where atan2() resolves to
-__atan2_finite()), and used without recompilation on a post-2.31 version
-of glibc (where __atan2_finite() has become a deprecated hidden symbol
-that is only available as a versioned symbol).
-
-When building shared libraries and loadable modules, it's most robust
-to link them explicitly to their dependencies, as is done here.
-$(LIBS) also includes -ldl, which is unnecessary but harmless.
-
-Bug-Debian: https://bugs.debian.org/966150
-Bug-Debian: https://bugs.debian.org/966173
-Forwarded: https://github.com/iortcw/iortcw/pull/112
-Applied-upstream: 1.51d, commit:9601361
----
- MP/Makefile | 12 ++++++------
- SP/Makefile | 12 ++++++------
- 2 files changed, 12 insertions(+), 12 deletions(-)
-
-diff --git a/MP/Makefile b/MP/Makefile
-index 5447e44..0f1f7eb 100644
---- a/MP/Makefile
-+++ b/MP/Makefile
-@@ -2405,11 +2405,11 @@ Q3CGVMOBJ = $(Q3CGOBJ_:%.o=%.asm)
- ifdef MINGW
- $(B)/$(BASEGAME)/cgame_mp_$(SHLIBNAME): $(Q3CGOBJ)
- 	$(echo_cmd) "LD $@"
--	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3CGOBJ)
-+	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3CGOBJ) $(LIBS)
- else
- $(B)/$(BASEGAME)/cgame.mp.$(SHLIBNAME): $(Q3CGOBJ)
- 	$(echo_cmd) "LD $@"
--	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3CGOBJ)
-+	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3CGOBJ) $(LIBS)
- endif
- $(B)/$(BASEGAME)/vm/cgame.mp.qvm: $(Q3CGVMOBJ) $(CGDIR)/cg_syscalls.asm $(Q3ASM)
- 	$(echo_cmd) "Q3ASM $@"
-@@ -2480,11 +2480,11 @@ Q3GVMOBJ = $(Q3GOBJ_:%.o=%.asm)
- ifdef MINGW
- $(B)/$(BASEGAME)/qagame_mp_$(SHLIBNAME): $(Q3GOBJ)
- 	$(echo_cmd) "LD $@"
--	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3GOBJ)
-+	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3GOBJ) $(LIBS)
- else
- $(B)/$(BASEGAME)/qagame.mp.$(SHLIBNAME): $(Q3GOBJ)
- 	$(echo_cmd) "LD $@"
--	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3GOBJ)
-+	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3GOBJ) $(LIBS)
- endif
- $(B)/$(BASEGAME)/vm/qagame.mp.qvm: $(Q3GVMOBJ) $(GDIR)/g_syscalls.asm $(Q3ASM)
- 	$(echo_cmd) "Q3ASM $@"
-@@ -2514,11 +2514,11 @@ Q3UIVMOBJ = $(Q3UIOBJ_:%.o=%.asm)
- ifdef MINGW
- $(B)/$(BASEGAME)/ui_mp_$(SHLIBNAME): $(Q3UIOBJ)
- 	$(echo_cmd) "LD $@"
--	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3UIOBJ)
-+	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3UIOBJ) $(LIBS)
- else
- $(B)/$(BASEGAME)/ui.mp.$(SHLIBNAME): $(Q3UIOBJ)
- 	$(echo_cmd) "LD $@"
--	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3UIOBJ)
-+	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3UIOBJ) $(LIBS)
- endif
- $(B)/$(BASEGAME)/vm/ui.mp.qvm: $(Q3UIVMOBJ) $(UIDIR)/ui_syscalls.asm $(Q3ASM)
- 	$(echo_cmd) "Q3ASM $@"
-diff --git a/SP/Makefile b/SP/Makefile
-index 667aeeb..9ca1d62 100644
---- a/SP/Makefile
-+++ b/SP/Makefile
-@@ -2371,11 +2371,11 @@ Q3CGVMOBJ = $(Q3CGOBJ_:%.o=%.asm)
- ifdef MINGW
- $(B)/$(BASEGAME)/cgame_sp_$(SHLIBNAME): $(Q3CGOBJ)
- 	$(echo_cmd) "LD $@"
--	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3CGOBJ)
-+	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3CGOBJ) $(LIBS)
- else
- $(B)/$(BASEGAME)/cgame.sp.$(SHLIBNAME): $(Q3CGOBJ)
- 	$(echo_cmd) "LD $@"
--	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3CGOBJ)
-+	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3CGOBJ) $(LIBS)
- endif
- $(B)/$(BASEGAME)/vm/cgame.sp.qvm: $(Q3CGVMOBJ) $(CGDIR)/cg_syscalls.asm $(Q3ASM)
- 	$(echo_cmd) "Q3ASM $@"
-@@ -2446,11 +2446,11 @@ Q3GVMOBJ = $(Q3GOBJ_:%.o=%.asm)
- ifdef MINGW
- $(B)/$(BASEGAME)/qagame_sp_$(SHLIBNAME): $(Q3GOBJ)
- 	$(echo_cmd) "LD $@"
--	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3GOBJ)
-+	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3GOBJ) $(LIBS)
- else
- $(B)/$(BASEGAME)/qagame.sp.$(SHLIBNAME): $(Q3GOBJ)
- 	$(echo_cmd) "LD $@"
--	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3GOBJ)
-+	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3GOBJ) $(LIBS)
- endif
- $(B)/$(BASEGAME)/vm/qagame.sp.qvm: $(Q3GVMOBJ) $(GDIR)/g_syscalls.asm $(Q3ASM)
- 	$(echo_cmd) "Q3ASM $@"
-@@ -2480,11 +2480,11 @@ Q3UIVMOBJ = $(Q3UIOBJ_:%.o=%.asm)
- ifdef MINGW
- $(B)/$(BASEGAME)/ui_sp_$(SHLIBNAME): $(Q3UIOBJ)
- 	$(echo_cmd) "LD $@"
--	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3UIOBJ)
-+	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3UIOBJ) $(LIBS)
- else
- $(B)/$(BASEGAME)/ui.sp.$(SHLIBNAME): $(Q3UIOBJ)
- 	$(echo_cmd) "LD $@"
--	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3UIOBJ)
-+	$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3UIOBJ) $(LIBS)
- endif
- $(B)/$(BASEGAME)/vm/ui.sp.qvm: $(Q3UIVMOBJ) $(UIDIR)/ui_syscalls.asm $(Q3ASM)
- 	$(echo_cmd) "Q3ASM $@"
diff --git a/debian/patches/debian/Disable-client-side-auto-download-by-default.patch b/debian/patches/debian/Disable-client-side-auto-download-by-default.patch
index add6d22..2812c73 100644
--- a/debian/patches/debian/Disable-client-side-auto-download-by-default.patch
+++ b/debian/patches/debian/Disable-client-side-auto-download-by-default.patch
@@ -12,11 +12,11 @@ anyway.
  MP/code/client/cl_main.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/MP/code/client/cl_main.c b/MP/code/client/cl_main.c
-index 41b69b8..5b9d768 100644
---- a/MP/code/client/cl_main.c
-+++ b/MP/code/client/cl_main.c
-@@ -4031,7 +4031,7 @@ void CL_Init( void ) {
+Index: iortcw/MP/code/client/cl_main.c
+===================================================================
+--- iortcw.orig/MP/code/client/cl_main.c
++++ iortcw/MP/code/client/cl_main.c
+@@ -4033,7 +4033,7 @@ void CL_Init( void ) {
  
  	cl_showMouseRate = Cvar_Get( "cl_showmouserate", "0", 0 );
  
diff --git a/debian/patches/debian/File-access-methods-prevent-overwriting-DLLs-CVE-201.patch b/debian/patches/debian/File-access-methods-prevent-overwriting-DLLs-CVE-201.patch
index a574ef0..b211c3e 100644
--- a/debian/patches/debian/File-access-methods-prevent-overwriting-DLLs-CVE-201.patch
+++ b/debian/patches/debian/File-access-methods-prevent-overwriting-DLLs-CVE-201.patch
@@ -32,11 +32,11 @@ Upstream rejected this change, but we want it in Debian anyway.
  SP/code/qcommon/files.c | 10 ++++++++++
  2 files changed, 18 insertions(+), 4 deletions(-)
 
-diff --git a/MP/code/qcommon/files.c b/MP/code/qcommon/files.c
-index 7460b4d..c3375a0 100644
---- a/MP/code/qcommon/files.c
-+++ b/MP/code/qcommon/files.c
-@@ -704,7 +704,9 @@ fileHandle_t FS_SV_FOpenFileWrite( const char *filename ) {
+Index: iortcw/MP/code/qcommon/files.c
+===================================================================
+--- iortcw.orig/MP/code/qcommon/files.c
++++ iortcw/MP/code/qcommon/files.c
+@@ -704,7 +704,9 @@ fileHandle_t FS_SV_FOpenFileWrite( const
  		Com_Printf( "FS_SV_FOpenFileWrite: %s\n", ospath );
  	}
  
@@ -47,7 +47,7 @@ index 7460b4d..c3375a0 100644
  
  	if( FS_CreatePath( ospath ) ) {
  		return 0;
-@@ -938,7 +940,9 @@ fileHandle_t FS_FOpenFileWrite( const char *filename ) {
+@@ -938,7 +940,9 @@ fileHandle_t FS_FOpenFileWrite( const ch
  		Com_Printf( "FS_FOpenFileWrite: %s\n", ospath );
  	}
  
@@ -58,7 +58,7 @@ index 7460b4d..c3375a0 100644
  
  	if ( FS_CreatePath( ospath ) ) {
  		return 0;
-@@ -1593,7 +1597,7 @@ int FS_FindVM(void **startSearch, char *found, int foundlen, const char *name, q
+@@ -1593,7 +1597,7 @@ int FS_FindVM(void **startSearch, char *
  				return VMI_COMPILED;
  			}
  
@@ -67,7 +67,7 @@ index 7460b4d..c3375a0 100644
  			// extract the dlls from the mp_bin.pk3 so
  			// that they can be referenced
  			if (Q_stricmp(name, "qagame"))
-@@ -1637,7 +1641,7 @@ int FS_FindVM(void **startSearch, char *found, int foundlen, const char *name, q
+@@ -1637,7 +1641,7 @@ int FS_FindVM(void **startSearch, char *
  
  // TTimo
  // relevant to client only
@@ -76,11 +76,11 @@ index 7460b4d..c3375a0 100644
  /*
  ==================
  FS_CL_ExtractFromPakFile
-diff --git a/SP/code/qcommon/files.c b/SP/code/qcommon/files.c
-index caf9f41..c18d437 100644
---- a/SP/code/qcommon/files.c
-+++ b/SP/code/qcommon/files.c
-@@ -175,6 +175,8 @@ or configs will never get loaded from disk!
+Index: iortcw/SP/code/qcommon/files.c
+===================================================================
+--- iortcw.orig/SP/code/qcommon/files.c
++++ iortcw/SP/code/qcommon/files.c
+@@ -175,6 +175,8 @@ or configs will never get loaded from di
  
  */
  
@@ -89,7 +89,7 @@ index caf9f41..c18d437 100644
  // every time a new demo pk3 file is built, this checksum must be updated.
  // the easiest way to get it is to just run the game and see what it spits out
  #ifndef STANDALONE
-@@ -613,6 +615,10 @@ static void FS_CopyFile( char *fromOSPath, char *toOSPath ) {
+@@ -613,6 +615,10 @@ static void FS_CopyFile( char *fromOSPat
  		return;
  	}
  
@@ -100,7 +100,7 @@ index caf9f41..c18d437 100644
  	f = Sys_FOpen( fromOSPath, "rb" );
  	if ( !f ) {
  		return;
-@@ -662,6 +668,10 @@ void FS_CopyFileOS( char *from, char *to ) {
+@@ -662,6 +668,10 @@ void FS_CopyFileOS( char *from, char *to
  		return;
  	}
  
diff --git a/debian/patches/debian/Remove-support-for-downloading-executable-updates.patch b/debian/patches/debian/Remove-support-for-downloading-executable-updates.patch
index bb606a2..937ff4e 100644
--- a/debian/patches/debian/Remove-support-for-downloading-executable-updates.patch
+++ b/debian/patches/debian/Remove-support-for-downloading-executable-updates.patch
@@ -13,10 +13,10 @@ in Debian anyway.
  MP/code/sys/sys_unix.c    |  20 ------
  3 files changed, 2 insertions(+), 187 deletions(-)
 
-diff --git a/MP/code/client/cl_main.c b/MP/code/client/cl_main.c
-index 5b9d768..ef3411d 100644
---- a/MP/code/client/cl_main.c
-+++ b/MP/code/client/cl_main.c
+Index: iortcw/MP/code/client/cl_main.c
+===================================================================
+--- iortcw.orig/MP/code/client/cl_main.c
++++ iortcw/MP/code/client/cl_main.c
 @@ -2195,24 +2195,7 @@ void CL_DownloadsComplete( void ) {
  
  	// DHM - Nerve :: Auto-update (not finished yet)
@@ -43,7 +43,7 @@ index 5b9d768..ef3411d 100644
  	}
  
  #ifdef USE_CURL
-@@ -2905,14 +2888,6 @@ void CL_ConnectionlessPacket( netadr_t from, msg_t *msg ) {
+@@ -2905,14 +2888,6 @@ void CL_ConnectionlessPacket( netadr_t f
  			}
  		}
  
@@ -58,7 +58,7 @@ index 5b9d768..ef3411d 100644
  #ifdef LEGACY_PROTOCOL
  		Netchan_Setup(NS_CLIENT, &clc.netchan, from, Cvar_VariableValue("net_qport"),
  			      clc.challenge, clc.compat);
-@@ -3536,119 +3511,9 @@ int CL_ScaledMilliseconds( void ) {
+@@ -3538,119 +3513,9 @@ int CL_ScaledMilliseconds( void ) {
  
  // DHM - Nerve
  void CL_CheckAutoUpdate( void ) {
@@ -178,7 +178,7 @@ index 5b9d768..ef3411d 100644
  }
  // DHM - Nerve
  
-@@ -3980,7 +3845,7 @@ void CL_Init( void ) {
+@@ -3982,7 +3847,7 @@ void CL_Init( void ) {
  #ifdef UPDATE_SERVER_NAME
  	cl_motd = Cvar_Get( "cl_motd", "1", 0 );
  #endif
@@ -187,7 +187,7 @@ index 5b9d768..ef3411d 100644
  
  	cl_timeout = Cvar_Get( "cl_timeout", "200", 0 );
  
-@@ -4505,30 +4370,6 @@ CL_UpdateInfoPacket
+@@ -4507,30 +4372,6 @@ CL_UpdateInfoPacket
  ===================
  */
  void CL_UpdateInfoPacket( netadr_t from ) {
@@ -218,11 +218,11 @@ index 5b9d768..ef3411d 100644
  }
  // DHM - Nerve
  
-diff --git a/MP/code/qcommon/qcommon.h b/MP/code/qcommon/qcommon.h
-index a677f94..a96f351 100644
---- a/MP/code/qcommon/qcommon.h
-+++ b/MP/code/qcommon/qcommon.h
-@@ -1272,12 +1272,6 @@ void Sys_StartProcess( char *cmdline, qboolean doexit );            // NERVE - S
+Index: iortcw/MP/code/qcommon/qcommon.h
+===================================================================
+--- iortcw.orig/MP/code/qcommon/qcommon.h
++++ iortcw/MP/code/qcommon/qcommon.h
+@@ -1274,12 +1274,6 @@ void Sys_StartProcess( char *cmdline, qb
  void Sys_OpenURL( const char *url, qboolean doexit );                       // NERVE - SMF
  int Sys_GetHighQualityCPU( void );
  
@@ -235,11 +235,11 @@ index a677f94..a96f351 100644
  typedef enum
  {
  	DR_YES = 0,
-diff --git a/MP/code/sys/sys_unix.c b/MP/code/sys/sys_unix.c
-index acd3bc2..ff76dfc 100644
---- a/MP/code/sys/sys_unix.c
-+++ b/MP/code/sys/sys_unix.c
-@@ -1008,26 +1008,6 @@ int Sys_GetHighQualityCPU() {
+Index: iortcw/MP/code/sys/sys_unix.c
+===================================================================
+--- iortcw.orig/MP/code/sys/sys_unix.c
++++ iortcw/MP/code/sys/sys_unix.c
+@@ -1016,26 +1016,6 @@ int Sys_GetHighQualityCPU() {
  	return 1;
  }
  
diff --git a/debian/patches/series b/debian/patches/series
index 8d5e306..cf51b47 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,5 +1,4 @@
 All-Rend2-Stub-out-USE_BOX_CUBEMAP_PARALLAX-on-GLSL-1.30.patch
-build-Link-game-cgame-ui-modules-to-LIBS.patch
 debian/Disable-client-side-auto-download-by-default.patch
 debian/File-access-methods-prevent-overwriting-DLLs-CVE-201.patch
 debian/Remove-support-for-downloading-executable-updates.patch
diff --git a/md4-readme.txt b/md4-readme.txt
new file mode 100644
index 0000000..fc0e556
--- /dev/null
+++ b/md4-readme.txt
@@ -0,0 +1,54 @@
+##########################################################
+# Info about the MD4 format supported by the ioQ3 engine #
+##########################################################
+
+All models included with the original version of Quake3 from id soft are in
+the MD3 format. Animations in this format are realized by saving the position
+of every vertex in each frame which can make these files pretty large.
+
+ID started work on a newer format, the MD4 format which they never finished.
+This format uses a skeleton with all vertices "attached" to their bones.
+Because only the position of the bones must be stored for each frame and the
+number of bones is not very high this format is more efficient when
+doing animations.
+
+Raven software "finished" this format originally started by ID and included
+it in their game EliteForce. They called their model format "MDR" which is
+the name I have used throughout the sourcecode and I will continue using in
+this readme. Since the code on how to handle those MDR files was released
+under a GPL licence a long time ago, I was able to implement this format for
+Quake3 and do some efficiency improvements.
+To enable the support for this model format, go to qcommon/qfiles.h,
+remove the comment slashes for #define RAVENMD4 and then compile the engine.
+
+Including finished MDR models in your projects is easy: just load the model
+files in your cgame code as you would normally load an MD3 model. The engine
+will expect the models to have a ".mdr" suffix.
+The rest is pretty much the same: Selecting the current animation frame,
+adding a skin to the model, etc..
+You can check out the original eliteforce game sourcecode if you want to
+have examples on using the md4s. The source can be got at:
+http://eliteforce2.filefront.com/
+You can also get reference MDR files there, just go to the model/skin
+section there and pick something to download.
+
+Now here comes the tricky part:
+Creating files with this format. There are tools to create these kinds of
+MDR files, like a plugin for Milkshape.
+
+A pretty good overview about MDR file creation is available at
+http://synapse.vgfort.com/
+You can find some tools for creating MDR files there.
+
+On a sidenote:
+There is an independent implementation of the MD4 file format available
+here:
+http://gongo.quakedev.com/
+At this time, ioquake3 has no support for these models though that may
+change in the future. Nevertheless, he has got a tool for skeletal
+animations that can possibly be hooked into the MDR format with some
+modifications.
+
+
+Good luck!
+ - Thilo Schulz
diff --git a/rend2-readme.md b/rend2-readme.md
index a813c13..1d76408 100644
--- a/rend2-readme.md
+++ b/rend2-readme.md
@@ -188,6 +188,11 @@ Cvars for advanced material usage:
                                      1 - Use parallax occlusion mapping.
                                      2 - Use relief mapping. (slower)
 
+*  `r_parallaxMapOffset`            - Set the parallax height offset.
+                                     0    - Values map to -255 - 0. (default)
+                                     0.5  - Values map to -127 - 127.
+                                     1.0  - Values map to 0 - 255.
+
 *  `r_parallaxMapShadows`           - Enable self-shadowing on parallax map
                                    supported materials.
                                      0 - No. (default)