[openjk] 10/15: Imported Upstream version 0~20150815+dfsg1

Simon McVittie smcv at debian.org
Wed Oct 7 07:36:19 UTC 2015


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch master
in repository openjk.

commit cae0229fa31918de8fab1ef4d3ef5d324404a832
Author: Simon McVittie <smcv at debian.org>
Date:   Sun Aug 16 10:52:25 2015 +0100

    Imported Upstream version 0~20150815+dfsg1
---
 .travis.yml                                      |  22 +++
 CMakeLists.txt                                   |  18 +-
 CMakeModules/Toolchains/i686-w64-mingw32.cmake   |  18 ++
 CMakeModules/Toolchains/x86_64-w64-mingw32.cmake |  18 ++
 LICENSE.txt                                      |  73 +++++++-
 README.md                                        | 108 +++++-------
 code/CMakeLists.txt                              |   4 +-
 code/Ragl/ragl_common.h                          |   2 +-
 code/cgame/FxScheduler.cpp                       |   4 +-
 code/client/snd_dma.cpp                          |   2 +-
 code/client/snd_local.h                          |   8 +-
 code/game/g_client.cpp                           |   2 -
 code/game/wp_saber.cpp                           | 116 +++++++++---
 code/qcommon/common.cpp                          |   4 +-
 code/qcommon/files.cpp                           |  21 ++-
 code/qcommon/q_shared.h                          |   1 +
 code/qcommon/timing.h                            |   6 +-
 code/rd-vanilla/qgl.h                            |   2 +-
 code/ui/ui_main.cpp                              |  17 +-
 codeJK2/cgame/FxScheduler.cpp                    |   4 +-
 codemp/CMakeLists.txt                            |   4 +-
 codemp/cgame/cg_draw.c                           | 216 ++++++++++++++++++-----
 codemp/client/snd_dma.cpp                        |   2 +-
 codemp/client/snd_local.h                        |   2 +-
 codemp/game/bg_pmove.c                           |   2 +-
 codemp/qcommon/common.cpp                        |   4 +-
 codemp/qcommon/files.cpp                         |  24 ++-
 codemp/rd-vanilla/qgl.h                          |   2 +-
 codemp/rd-vanilla/tr_cmds.cpp                    |  13 +-
 codemp/server/NPCNav/navigator.cpp               |   3 +
 codemp/ui/ui_main.c                              |  23 ++-
 shared/sdl/sdl_input.cpp                         |   2 +-
 shared/sys/con_win32.cpp                         |   2 +-
 shared/sys/sys_win32.cpp                         |   4 +-
 34 files changed, 545 insertions(+), 208 deletions(-)

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..5d442cd
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,22 @@
+language: cpp
+sudo: true
+
+install:
+  - ./tools/travis-install.sh "${host:-native}" "${flavour:-Release}" $opts
+
+script:
+  - ./tools/travis-build.sh "${host:-native}" "${flavour:-Release}" $opts
+
+compiler: gcc
+env:
+  - ""
+  - flavour=Debug
+  #- host=i686-linux-gnu
+  - host=i686-w64-mingw32
+  - host=x86_64-w64-mingw32
+
+# One extra build with clang, its warnings are often better
+matrix:
+  include:
+    - compiler: clang
+      env: ""
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5d21f3e..d106899 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,12 +17,6 @@
 #============================================================================
 
 cmake_minimum_required(VERSION 2.8.8)
-
-# Set CMake policies
-if(POLICY CMP0043)
-	cmake_policy(SET CMP0043 OLD) # Don't ignore COMPILE_DEFINITION_<build>
-endif()
-
 # For checks in subdirectories
 set(InOpenJK TRUE)
 
@@ -73,7 +67,7 @@ else()
 	set(MakeApplicationBundles OFF)
 endif()
 
-if(MSVC)
+if(WIN32)
 	option(UseInternalSDL2 "Whether to use the included SDL2 library instead of a locally installed one" ON)
 else()
 	set(UseInternalSDL2 OFF)
@@ -82,6 +76,9 @@ endif()
 # Custom CMake Modules needed
 list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}/CMakeModules")
 
+Include(CheckTypeSize)
+check_type_size("void*" CMAKE_SIZEOF_VOID_P)
+
 # ${Architecture} must match ARCH_STRING in q_platform.h,
 # and is used in DLL names (jagamex86.dll, jagamex86.dylib, jagamei386.so).
 if(WIN32)
@@ -209,6 +206,13 @@ elseif (("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_C_COMPILER_ID}" S
 			set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mstackrealign")
 			set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpmath=sse")
 		endif()
+
+		if(WIN32)
+			# Link libgcc and libstdc++ statically
+			set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libgcc")
+			set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc")
+			set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++")
+		endif()
 	elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
 		set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
 		set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-comment")
diff --git a/CMakeModules/Toolchains/i686-w64-mingw32.cmake b/CMakeModules/Toolchains/i686-w64-mingw32.cmake
new file mode 100644
index 0000000..fcdcdae
--- /dev/null
+++ b/CMakeModules/Toolchains/i686-w64-mingw32.cmake
@@ -0,0 +1,18 @@
+set(GNU_HOST i686-w64-mingw32)
+set(CMAKE_SYSTEM_PROCESSOR "i686")
+
+set(COMPILER_PREFIX "${GNU_HOST}-")
+
+set(CMAKE_SYSTEM_NAME "Windows")
+set(CMAKE_CROSSCOMPILING TRUE)
+set(WIN32 TRUE)
+set(MINGW TRUE)
+
+include(CMakeForceCompiler)
+cmake_force_c_compiler(${COMPILER_PREFIX}gcc GNU)
+cmake_force_cxx_compiler(${COMPILER_PREFIX}g++ GNU)
+set(CMAKE_RC_COMPILER ${COMPILER_PREFIX}windres)
+
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
diff --git a/CMakeModules/Toolchains/x86_64-w64-mingw32.cmake b/CMakeModules/Toolchains/x86_64-w64-mingw32.cmake
new file mode 100644
index 0000000..7fb132a
--- /dev/null
+++ b/CMakeModules/Toolchains/x86_64-w64-mingw32.cmake
@@ -0,0 +1,18 @@
+set(GNU_HOST x86_64-w64-mingw32)
+set(CMAKE_SYSTEM_PROCESSOR "x86_64")
+
+set(COMPILER_PREFIX "${GNU_HOST}-")
+
+set(CMAKE_SYSTEM_NAME "Windows")
+set(CMAKE_CROSSCOMPILING TRUE)
+set(WIN32 TRUE)
+set(MINGW TRUE)
+
+include(CMakeForceCompiler)
+cmake_force_c_compiler(${COMPILER_PREFIX}gcc GNU)
+cmake_force_cxx_compiler(${COMPILER_PREFIX}g++ GNU)
+set(CMAKE_RC_COMPILER ${COMPILER_PREFIX}windres)
+
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
diff --git a/LICENSE.txt b/LICENSE.txt
index e37680c..23cb790 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,12 +1,12 @@
-		    GNU GENERAL PUBLIC LICENSE
-		       Version 2, June 1991
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 2, June 1991
 
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
-			    Preamble
+                            Preamble
 
   The licenses for most software are designed to take away your
 freedom to share and change it.  By contrast, the GNU General Public
@@ -56,7 +56,7 @@ patent must be licensed for everyone's free use or not licensed at all.
   The precise terms and conditions for copying, distribution and
 modification follow.
 
-		    GNU GENERAL PUBLIC LICENSE
+                    GNU GENERAL PUBLIC LICENSE
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 
   0. This License applies to any program or other work which contains
@@ -255,7 +255,7 @@ make exceptions for this.  Our decision will be guided by the two goals
 of preserving the free status of all derivatives of our free software and
 of promoting the sharing and reuse of software generally.
 
-			    NO WARRANTY
+                            NO WARRANTY
 
   11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
@@ -277,4 +277,63 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGES.
 
-		     END OF TERMS AND CONDITIONS
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    {description}
+    Copyright (C) {year}  {fullname}
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  {signature of Ty Coon}, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/README.md b/README.md
index 30cde3d..4990ce7 100644
--- a/README.md
+++ b/README.md
@@ -1,90 +1,72 @@
-# JACoders "OpenJK" project #
-[![Coverity Scan Build Status](https://scan.coverity.com/projects/1153/badge.svg)](https://scan.coverity.com/projects/1153)
+# OpenJK
 
-IRC: irc.arloria.net / #JACoders ([webchat](http://unic0rn.github.io/tiramisu/jacoders/))
+OpenJK is an effort by the JACoders group to maintain and improve the game engines on which the Jedi Academy (JA) and Jedi Outcast (JO) games run on, while maintaining *full backwards compatibility* with the existing games. *This project does not attempt to rebalance or otherwise modify core gameplay*.
 
-Forum: http://jkhub.org/forum/51-discussion/
+Our aims are to:
+* Improve the stability of the engine by fixing bugs and improving performance.
+* Provide a clean base from which new JO and JA code modifications can be made.
+* Make available this engine to more operating systems. To date, we have ports on Linux and OS X.
 
-The purpose of this project is to maintain and improve the Jedi Academy and Jedi Outcast games, developed by Raven Software. This project does not attempt to rebalance or otherwise modify core gameplay.
+Currently, the most stable portion of this project is the Jedi Academy multiplayer code, with the single player code in a reasonable state.
 
-Major enhancement changes are very low priority at this time unless patches are made available and which do not alter the core functionality of gameplay or the stock renderer itself.
+Rough support for Jedi Outcast single player is also available, however this should be considered heavily work in progress. This is not currently actively worked on or tested. OpenJK does not have Jedi Outcast multiplayer support.
 
 Please use discretion when making issue requests on GitHub. The [JKHub sub-forum](http://jkhub.org/forum/51-discussion/) is a better place for support queries, discussions, and feature requests.
 
-## Jedi Outcast Support ##
-
-_Do not make issues regarding Jedi Outcast problems at this time. It is considered mostly unfinished, broken, and to be used at your own risk!_
-
-There is no Multiplayer code for JK2MP at all on our repository at this time. The Single-player support must be explicitly turned on in your own compile. The pre-built versions will not include this.
+[![IRC](https://img.shields.io/badge/irc-%23JACoders-brightgreen.svg)](http://unic0rn.github.io/tiramisu/jacoders/)
+[![Forum](https://img.shields.io/badge/forum-JKHub.org%20OpenJK-brightgreen.svg)](http://jkhub.org/forum/51-discussion/)
 
-## 64-bit Support
-
-64-bit is currently supported on non-Windows platforms.
+[![Coverity Scan Build Status](https://scan.coverity.com/projects/1153/badge.svg)](https://scan.coverity.com/projects/1153)
 
-## Installation ##
+| Windows | OSX | Linux x86 | Linux x64 |
+|---------|-----|-----------|-----------|
+| [![Windows Build Status](http://jk.xd.cm/badge.svg?builder=windows)](http://jk.xd.cm/builders/windows) | [ ![OSX Build Status](http://jk.xd.cm/badge.svg?builder=osx)](http://jk.xd.cm/builders/osx) | [ ![Linux x86 Build Status](http://jk.xd.cm/badge.svg?builder=linux)](http://jk.xd.cm/builders/linux) | [ ![Linux x64 Build Status](http://jk.xd.cm/badge.svg?builder=linux-64)](http://jk.xd.cm/builders/linux-64) |
 
-First, install Jedi Academy. If you don't already own the game you can buy it from online stores such as [Steam](http://store.steampowered.com/app/6020/), [Amazon](http://www.amazon.com/Star-Wars-Jedi-Knight-Academy-Pc/dp/B0000A2MCN) or [Play](http://www.play.com/Games/PC/4-/127805/Star-Wars-Jedi-Knight-Jedi-Academy/Product.html?searchstring=jedi+academy&searchsource=0&searchtype=allproducts&urlrefer=search). Then unpack the OpenJK zip file to your Jedi Academy GameData folder.
+## License
 
-## Maintainers (in alphabetical order) ##
+[![License](https://img.shields.io/github/license/JACoders/OpenJK.svg)](https://github.com/JACoders/OpenJK/blob/master/LICENSE.txt)
 
-* eezstreet
-* Ensiform
-* Razish
-* redsaurus
-* Xycaleth
-
-## Significant contributors (in alphabetical order) ##
-
-* exidl
-* ImperatorPrime
-* mrwonko
-* Scooper
-* Sil
-
-## Dependencies ##
+OpenJK is licensed under GPLv2 as free software. You are free to use, modify and redistribute OpenJK following the terms in LICENSE.txt.
 
-* SDL2 (2.0.3+) (included on Windows)
-* OpenGL
-* OpenAL (included on Windows)
-* libpng (included on Windows)
-* libjpeg (included on Windows)
-* zlib (included on Windows)
+## For players
 
-## Dedicated Server ##
+To install OpenJK, you will first need Jedi Academy installed. If you don't already own the game you can buy it from online stores such as [Steam](http://store.steampowered.com/app/6020/), [Amazon](http://www.amazon.com/Star-Wars-Jedi-Knight-Academy-Pc/dp/B0000A2MCN) or [GOG](https://www.gog.com/game/star_wars_jedi_knight_jedi_academy).
 
-In order to run a dedicated server, you must use the openjkded binary. Running dedicated from the main executable is currently not possible because it was broken with the addition of modular renderer.
+Installing and running OpenJK:
 
-## Developer Notes ##
+1. [Download the latest build](http://builds.openjk.org) for your operating system.
+2. Extract the contents of the file into the Jedi Academy `GameData/` folder. For Steam users, this will be in `<Steam Folder>/steamapps/common/Jedi Academy/GameData`.
+3. Run `openjk.x86.exe` (Windows), `openjk.i386` (Linux 32-bit), `openjk.x86_64` (Linux 64-bit) or the `OpenJK` application (OS X), depending on your operating system.
 
-OpenJK is licensed under GPLv2 as free software. You are free to use, modify and redistribute OpenJK following the terms in LICENSE.txt.
+## For Developers
 
-Please be aware of the implications of the GPLv2 licence. In short, be prepared to share your code under the same GPLv2 licence.
+### Building OpenJK
+* [Compilation guide](https://github.com/JACoders/OpenJK/wiki/Compilation-guide)
+* [Debugging guide](https://github.com/JACoders/OpenJK/wiki/Debugging)
 
-### If you wish to contribute to OpenJK, please do the following ###
+### Contributing to OpenJK
 * [Fork](https://github.com/JACoders/OpenJK/fork) the project on GitHub
 * Create a new branch and make your changes
 * Send a [pull request](https://help.github.com/articles/creating-a-pull-request) to upstream (JACoders/OpenJK)
 
-### If you wish to base your work off OpenJK (mod or engine) ###
+### Using OpenJK as a base for a new mod
 * [Fork](https://github.com/JACoders/OpenJK/fork) the project on GitHub
 * Change the GAMEVERSION define in codemp/game/g_local.h from "OpenJK" to your project name
 * If you make a nice change, please consider back-porting to upstream via pull request as described above. This is so everyone benefits without having to reinvent the wheel for every project.
 
-### Reserved renderer names ###
-* rd-vanilla (JA's original renderer)
-* rd-dedicated (Stripped down renderer for use with dedicated server)
-* rd-rend2 (Maintainer: Xycaleth)
-* rd-es (OpenGL ES compliant renderer for use with Raspberry Pi, Ouya, etc - please contribute!)
-* rd-strawberry (Maintainer: Xycaleth)
-* rd-vader (Maintainer: mrwonko)
-* rd-palpatine (Maintainer: mrwonko)
-* rd-sidious (Maintainer: mrwonko)
-
-### Engine hacks in existing mods ###
-Mods which make use of runtime memory patches may fail to run under OpenJK, and in the worst case will cause the program to crash. Consider forking OpenJK and adding your engine modifications directly, or applying these patches only if you are running on the retail engine.
-
-### Links of Interest ###
-* [Buildbot](http://jk.xd.cm/)
-* [Buildbot builds](http://builds.openjk.org/)
-* [Compilation Guide](https://github.com/JACoders/OpenJK/wiki/Compilation-guide)
-* [JKHub sub-forum](http://jkhub.org/forum/51-discussion/)
+## Maintainers (in alphabetical order)
+
+* Ensiform
+* Razish
+* Xycaleth
+
+## Significant contributors (in alphabetical order)
+
+* eezstreet
+* exidl
+* ImperatorPrime
+* mrwonko
+* redsaurus
+* Scooper
+* Sil
+* smcv
diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt
index da16f2d..62ea964 100644
--- a/code/CMakeLists.txt
+++ b/code/CMakeLists.txt
@@ -73,14 +73,14 @@ if(BuildSPEngine OR BuildJK2SPEngine)
 		if(CMAKE_SIZEOF_VOID_P EQUAL 4)
 			set(SPEngineLibraries
 				${SPEngineLibraries}
-				${OpenJKLibDir}/SDL2/lib/x86/SDL2.lib
 				${OpenJKLibDir}/SDL2/lib/x86/SDL2main.lib
+				${OpenJKLibDir}/SDL2/lib/x86/SDL2.lib
 				)
 		else()
 			set(SPEngineLibraries
 				${SPEngineLibraries}
-				${OpenJKLibDir}/SDL2/lib/x64/SDL2.lib
 				${OpenJKLibDir}/SDL2/lib/x64/SDL2main.lib
+				${OpenJKLibDir}/SDL2/lib/x64/SDL2.lib
 				)
 		endif()
 		
diff --git a/code/Ragl/ragl_common.h b/code/Ragl/ragl_common.h
index c30d602..3a4f132 100644
--- a/code/Ragl/ragl_common.h
+++ b/code/Ragl/ragl_common.h
@@ -87,7 +87,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 	#if !defined(RAGL_PROFILE_INC)
 		#define  RAGL_PROFILE_INC
         #ifdef _WIN32
-            #include "Windows.h"
+            #include "windows.h"
         #endif
 	#endif
 #endif
diff --git a/code/cgame/FxScheduler.cpp b/code/cgame/FxScheduler.cpp
index 3135ced..794d43d 100644
--- a/code/cgame/FxScheduler.cpp
+++ b/code/cgame/FxScheduler.cpp
@@ -39,9 +39,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 	#include "../qcommon/q_shared.h"
 #endif
 
-#ifndef _WIN32
-    #include <cmath>
-#endif
+#include <cmath>
 
 
 CFxScheduler	theFxScheduler;
diff --git a/code/client/snd_dma.cpp b/code/client/snd_dma.cpp
index cf3694f..9c336f8 100644
--- a/code/client/snd_dma.cpp
+++ b/code/client/snd_dma.cpp
@@ -36,7 +36,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 #define __STDC_FORMAT_MACROS
 #include <inttypes.h>
 #if defined(_WIN32)
-#include <Windows.h>
+#include <windows.h>
 #endif
 
 static void S_Play_f(void);
diff --git a/code/client/snd_local.h b/code/client/snd_local.h
index 5d50b3f..2d99340 100644
--- a/code/client/snd_local.h
+++ b/code/client/snd_local.h
@@ -37,10 +37,10 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 
 // Open AL Specific
 #ifdef USE_OPENAL
-#include "openal\al.h"
-#include "openal\alc.h"
-#include "eax\eax.h"
-#include "eax\eaxman.h"
+#include "OpenAL/al.h"
+#include "OpenAL/alc.h"
+#include "eax/eax.h"
+#include "eax/EaxMan.h"
 /*#elif defined MACOS_X
 #include <OpenAL/al.h>
 #include <OpenAL/alc.h>
diff --git a/code/game/g_client.cpp b/code/game/g_client.cpp
index 7ee56a9..f7bcee6 100644
--- a/code/game/g_client.cpp
+++ b/code/game/g_client.cpp
@@ -1755,7 +1755,6 @@ void G_SetG2PlayerModel( gentity_t * const ent, const char *modelName, const cha
 		}
 	}
 	int skin = gi.RE_RegisterSkin( skinName );
-	assert(skin);
 	//now generate the ghoul2 model this client should be.
 	if ( ent->client->NPC_class == CLASS_VEHICLE )
 	{//vehicles actually grab their model from the appropriate vehicle data entry
@@ -1776,7 +1775,6 @@ void G_SetG2PlayerModel( gentity_t * const ent, const char *modelName, const cha
 		modelName = "stormtrooper";
 		Com_sprintf( skinName, sizeof( skinName ), "models/players/%s/model_default.skin", modelName );
 		skin = gi.RE_RegisterSkin( skinName );
-		assert(skin);
 		ent->playerModel = gi.G2API_InitGhoul2Model( ent->ghoul2, va("models/players/%s/model.glm", modelName), G_ModelIndex( va("models/players/%s/model.glm", modelName) ), NULL_HANDLE, NULL_HANDLE, 0, 0 );
 	}
 	if (ent->playerModel == -1)
diff --git a/code/game/wp_saber.cpp b/code/game/wp_saber.cpp
index 9a9b343..46c869f 100644
--- a/code/game/wp_saber.cpp
+++ b/code/game/wp_saber.cpp
@@ -5344,9 +5344,9 @@ void WP_SaberDamageTrace( gentity_t *ent, int saberNum, int bladeNum )
 						else if ( !activeDefense//they're not defending
 							|| (entPowerLevel > FORCE_LEVEL_2 //I hit hard
 								&& hitOwnerPowerLevel < entPowerLevel)//they are defending, but their defense strength is lower than my attack...
-							|| (!deflected && Q_irand( 0, PM_PowerLevelForSaberAnim( &ent->client->ps, saberNum ) - hitOwner->client->ps.forcePowerLevel[FP_SABER_DEFENSE]/*PM_PowerLevelForSaberAnim( &hitOwner->client->ps )*/ ) > 0 ) )
+							|| (!deflected && Q_irand( 0, Q_max(0, PM_PowerLevelForSaberAnim( &ent->client->ps, saberNum ) - hitOwner->client->ps.forcePowerLevel[FP_SABER_DEFENSE])/*PM_PowerLevelForSaberAnim( &hitOwner->client->ps )*/ ) > 0 ) )
 						{//broke their parry altogether
-							if ( entPowerLevel > FORCE_LEVEL_2 || Q_irand( 0, ent->client->ps.forcePowerLevel[FP_SABER_OFFENSE] - hitOwner->client->ps.forcePowerLevel[FP_SABER_DEFENSE] ) )
+							if ( entPowerLevel > FORCE_LEVEL_2 || Q_irand( 0, Q_max(0, ent->client->ps.forcePowerLevel[FP_SABER_OFFENSE] - hitOwner->client->ps.forcePowerLevel[FP_SABER_DEFENSE]) ) )
 							{//chance of continuing with the attack (not bouncing back)
 								ent->client->ps.saberEventFlags &= ~SEF_BLOCKED;
 								ent->client->ps.saberBounceMove = LS_NONE;
@@ -8863,6 +8863,85 @@ qboolean WP_ForceThrowable( gentity_t *ent, gentity_t *forwardEnt, gentity_t *se
 	return qtrue;
 }
 
+static qboolean ShouldPlayerResistForceThrow( gentity_t *player, gentity_t *attacker, qboolean pull )
+{
+	if ( player->health <= 0 )
+	{
+		return qfalse;
+	}
+	
+	if ( !player->client )
+	{
+		return qfalse;
+	}
+
+	if ( player->client->ps.forceRageRecoveryTime >= level.time )
+	{
+		return qfalse;
+	}
+	
+	//wasn't trying to grip/drain anyone
+	if ( player->client->ps.torsoAnim == BOTH_FORCEGRIP_HOLD ||
+			player->client->ps.torsoAnim == BOTH_FORCE_DRAIN_GRAB_START ||
+			player->client->ps.torsoAnim == BOTH_FORCE_DRAIN_GRAB_HOLD )
+	{
+		return qfalse;
+	}
+
+	//only 30% chance of resisting a Desann or yoda push
+	if ( (attacker->client->NPC_class == CLASS_DESANN || Q_stricmp("Yoda",attacker->NPC_type) == 0) && Q_irand( 0, 2 ) > 0 )
+	{
+		return qfalse;
+	}
+
+	//on the ground
+	if ( player->client->ps.groundEntityNum == ENTITYNUM_NONE )
+	{
+		return qfalse;
+	}
+
+	//not knocked down already
+	if ( PM_InKnockDown( &player->client->ps ) )
+	{
+		return qfalse;	
+	}
+
+	//not involved in a saberLock
+	if ( player->client->ps.saberLockTime >= level.time )
+	{
+		return qfalse;
+	}
+
+	//not attacking or otherwise busy
+	if ( player->client->ps.weaponTime >= level.time )
+	{
+		return qfalse;
+	}
+
+	//using saber or fists
+	if ( player->client->ps.weapon != WP_SABER && player->client->ps.weapon != WP_MELEE )
+	{
+		return qfalse;
+	}
+
+	forcePowers_t forcePower = (pull ? FP_PULL : FP_PUSH);
+	int attackingForceLevel = attacker->client->ps.forcePowerLevel[forcePower];
+	int defendingForceLevel = player->client->ps.forcePowerLevel[forcePower];
+
+	if ( player->client->ps.powerups[PW_FORCE_PUSH] > level.time ||
+		Q_irand( 0, Q_max(0, defendingForceLevel - attackingForceLevel)*2 + 1 ) > 0 )
+	{
+		// player was pushing, or player's force push/pull is high enough to try to stop me
+		if ( InFront( attacker->currentOrigin, player->client->renderInfo.eyePoint, player->client->ps.viewangles, 0.3f ) )
+		{
+			//I'm in front of player
+			return qtrue;
+		}
+	}
+
+	return qfalse;
+}
+
 void ForceThrow( gentity_t *self, qboolean pull, qboolean fake )
 {//FIXME: pass in a target ent so we (an NPC) can push/pull just one targeted ent.
 	//shove things in front of you away
@@ -9249,33 +9328,12 @@ void ForceThrow( gentity_t *self, qboolean pull, qboolean fake )
 				}
 				else if ( !push_list[x]->s.number )
 				{//player
-					if ( !noResist
-						&& push_list[x]->health > 0 //alive
-						&& push_list[x]->client //client
-						&& push_list[x]->client->ps.forceRageRecoveryTime < level.time //not recobering from rage
-						&& push_list[x]->client->ps.torsoAnim != BOTH_FORCEGRIP_HOLD// BOTH_FORCEGRIP1//wasn't trying to grip anyone
-						//&& push_list[x]->client->ps.torsoAnim != BOTH_HUGGER1// wasn't trying to grip-drain anyone
-						&& push_list[x]->client->ps.torsoAnim != BOTH_FORCE_DRAIN_GRAB_START// wasn't trying to grip-drain anyone
-						&& push_list[x]->client->ps.torsoAnim != BOTH_FORCE_DRAIN_GRAB_HOLD// wasn't trying to grip-drain anyone
-						&& ((self->client->NPC_class != CLASS_DESANN&&Q_stricmp("Yoda",self->NPC_type)) || !Q_irand( 0, 2 ) )//only 30% chance of resisting a Desann push
-						&& push_list[x]->client->ps.groundEntityNum != ENTITYNUM_NONE//on the ground
-						&& !PM_InKnockDown( &push_list[x]->client->ps )//not knocked down already
-						&& push_list[x]->client->ps.saberLockTime < level.time//not involved in a saberLock
-						&& push_list[x]->client->ps.weaponTime < level.time//not attacking or otherwise busy
-						&& (push_list[x]->client->ps.weapon == WP_SABER||push_list[x]->client->ps.weapon == WP_MELEE) )//using saber or fists
-					{//trying to push or pull the player!
-						if ( push_list[x]->client->ps.powerups[PW_FORCE_PUSH] > level.time//player was pushing/pulling too
-							||( pull && Q_irand( 0, (push_list[x]->client->ps.forcePowerLevel[FP_PULL] - self->client->ps.forcePowerLevel[FP_PULL])*2+1 ) > 0 )//player's pull is high enough
-							||( !pull && Q_irand( 0, (push_list[x]->client->ps.forcePowerLevel[FP_PUSH] - self->client->ps.forcePowerLevel[FP_PUSH])*2+1 ) > 0 ) )//player's push is high enough
-						{//player's force push/pull is high enough to try to stop me
-							if ( InFront( self->currentOrigin, push_list[x]->client->renderInfo.eyePoint, push_list[x]->client->ps.viewangles, 0.3f ) )
-							{//I'm in front of player
-								WP_ResistForcePush( push_list[x], self, qfalse );
-								push_list[x]->client->ps.saberMove = push_list[x]->client->ps.saberBounceMove = LS_READY;//don't finish whatever saber anim you may have been in
-								push_list[x]->client->ps.saberBlocked = BLOCKED_NONE;
-								continue;
-							}
-						}
+					if ( !noResist && ShouldPlayerResistForceThrow(push_list[x], self, pull) )
+					{
+						WP_ResistForcePush( push_list[x], self, qfalse );
+						push_list[x]->client->ps.saberMove = push_list[x]->client->ps.saberBounceMove = LS_READY;//don't finish whatever saber anim you may have been in
+						push_list[x]->client->ps.saberBlocked = BLOCKED_NONE;
+						continue;
 					}
 				}
 				else if ( push_list[x]->client && Jedi_WaitingAmbush( push_list[x] ) )
diff --git a/code/qcommon/common.cpp b/code/qcommon/common.cpp
index 68aa2f3..e4ec12b 100644
--- a/code/qcommon/common.cpp
+++ b/code/qcommon/common.cpp
@@ -31,7 +31,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 #include "stv_version.h"
 #if defined(_WIN32)
 #define WIN32_LEAN_AND_MEAN
-#include <Windows.h>
+#include <windows.h>
 #endif
 
 // Because renderer.
@@ -1137,7 +1137,7 @@ void Com_Init( char *commandLine ) {
 		com_skippingcin = Cvar_Get ("skippingCinematic", "0", CVAR_ROM);
 		com_buildScript = Cvar_Get( "com_buildScript", "0", 0 );
 
-		com_affinity = Cvar_Get( "com_affinity", "1", CVAR_ARCHIVE );
+		com_affinity = Cvar_Get( "com_affinity", "0", CVAR_ARCHIVE );
 
 		com_bootlogo = Cvar_Get( "com_bootlogo", "1", CVAR_ARCHIVE );
 		
diff --git a/code/qcommon/files.cpp b/code/qcommon/files.cpp
index 97d4db3..a6fb0e4 100644
--- a/code/qcommon/files.cpp
+++ b/code/qcommon/files.cpp
@@ -45,7 +45,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 #endif
 
 #if defined(_WIN32)
-#include <Windows.h>
+#include <windows.h>
 #endif
 
 /*
@@ -960,14 +960,23 @@ void FS_Rename( const char *from, const char *to ) {
 }
 
 /*
-==============
+===========
 FS_FCloseFile
 
-If the FILE pointer is an open pak file, leave it open.
+Close a file.
 
-For some reason, other dll's can't just cal fclose()
-on files returned by FS_FOpenFile...
-==============
+There are three cases handled:
+
+  * normal file: closed with fclose.
+
+  * file in pak3 archive: subfile is closed with unzCloseCurrentFile, but the
+    minizip handle to the pak3 remains open.
+
+  * file in pak3 archive, opened with "unique" flag: This file did not use
+    the system minizip handle to the pak3 file, but its own dedicated one.
+    The dedicated handle is closed with unzClose.
+
+===========
 */
 void FS_FCloseFile( fileHandle_t f ) {
 	if ( !fs_searchpaths ) {
diff --git a/code/qcommon/q_shared.h b/code/qcommon/q_shared.h
index 96e58eb..ed9b62e 100644
--- a/code/qcommon/q_shared.h
+++ b/code/qcommon/q_shared.h
@@ -799,6 +799,7 @@ inline float Q_crandom( int *seed ) {
 
 // Returns an integer min <= x <= max (ie inclusive)
 inline int Q_irand(int min, int max) {
+	assert(min <= max);
 	return (rand() % (max - min + 1)) + min;
 }
 
diff --git a/code/qcommon/timing.h b/code/qcommon/timing.h
index a5e2115..f608c27 100644
--- a/code/qcommon/timing.h
+++ b/code/qcommon/timing.h
@@ -20,6 +20,10 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 ===========================================================================
 */
 
+#if defined(_WIN32) && defined(__GNUC__)
+#include <x86intrin.h>  /* for __rdtsc() */
+#endif
+
 class timing_c
 {
 private:
@@ -60,4 +64,4 @@ public:
 	}
 };
 
-// end
\ No newline at end of file
+// end
diff --git a/code/rd-vanilla/qgl.h b/code/rd-vanilla/qgl.h
index 891bed1..9c28c76 100644
--- a/code/rd-vanilla/qgl.h
+++ b/code/rd-vanilla/qgl.h
@@ -27,7 +27,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 #	include <GL/gl.h>
 #elif defined( _WIN32 )
 #	include <windows.h>
-#	include <gl/gl.h>
+#	include <GL/gl.h>
 #elif defined(MACOS_X)
 // Prevent OS X headers from including its own glext header
 #	define GL_GLEXT_LEGACY
diff --git a/code/ui/ui_main.cpp b/code/ui/ui_main.cpp
index 7e76742..20b0b13 100644
--- a/code/ui/ui_main.cpp
+++ b/code/ui/ui_main.cpp
@@ -29,8 +29,9 @@ USER INTERFACE MAIN
 =======================================================================
 */
 
-// leave this at the top of all UI_xxxx files for PCH reasons...
-//
+#include <algorithm>
+#include <vector>
+
 #include "../server/exe_headers.h"
 
 #include "ui_local.h"
@@ -2396,11 +2397,13 @@ static void UI_BuildPlayerModel_List( qboolean inGameLoad )
 
 		if (f)
 		{
-			char buffer[2048];
-			playerSpeciesInfo_t *species;
-			ui.FS_Read(&buffer, filelen, f);
+			playerSpeciesInfo_t *species = NULL;
+
+			std::vector<char> buffer(filelen + 1);
+			ui.FS_Read(&buffer[0], filelen, f);
 			ui.FS_FCloseFile(f);
-			buffer[filelen] = 0;	//ensure trailing NULL
+
+			buffer[filelen] = 0;
 
 			//record this species
 			if (uiInfo.playerSpeciesCount >= uiInfo.playerSpeciesMax)
@@ -2412,7 +2415,7 @@ static void UI_BuildPlayerModel_List( qboolean inGameLoad )
 			memset(species, 0, sizeof(playerSpeciesInfo_t));
 			Q_strncpyz( species->Name, dirptr, MAX_QPATH, qtrue );
 
-			if (!UI_ParseColorData(buffer,*species))
+			if (!UI_ParseColorData(buffer.data(),*species))
 			{
 				ui.Printf( "UI_BuildPlayerModel_List: Errors parsing '%s'\n", fpath );
 			}
diff --git a/codeJK2/cgame/FxScheduler.cpp b/codeJK2/cgame/FxScheduler.cpp
index 73fb075..3ca3ae6 100644
--- a/codeJK2/cgame/FxScheduler.cpp
+++ b/codeJK2/cgame/FxScheduler.cpp
@@ -38,9 +38,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 
 #include "cg_media.h"
 
-#ifndef _WIN32
-    #include <cmath>
-#endif
+#include <cmath>
 
 
 CFxScheduler	theFxScheduler;
diff --git a/codemp/CMakeLists.txt b/codemp/CMakeLists.txt
index 7eda7e0..07768ac 100644
--- a/codemp/CMakeLists.txt
+++ b/codemp/CMakeLists.txt
@@ -389,14 +389,14 @@ if(BuildMPEngine)
 		if(CMAKE_SIZEOF_VOID_P EQUAL 4)
 			set(MPEngineLibraries
 				${MPEngineLibraries}
-				${OpenJKLibDir}/SDL2/lib/x86/SDL2.lib
 				${OpenJKLibDir}/SDL2/lib/x86/SDL2main.lib
+				${OpenJKLibDir}/SDL2/lib/x86/SDL2.lib
 				)
 		else()
 			set(MPEngineLibraries
 				${MPEngineLibraries}
-				${OpenJKLibDir}/SDL2/lib/x64/SDL2.lib
 				${OpenJKLibDir}/SDL2/lib/x64/SDL2main.lib
+				${OpenJKLibDir}/SDL2/lib/x64/SDL2.lib
 				)
 		endif()
 		
diff --git a/codemp/cgame/cg_draw.c b/codemp/cgame/cg_draw.c
index a7a6222..cc801c7 100644
--- a/codemp/cgame/cg_draw.c
+++ b/codemp/cgame/cg_draw.c
@@ -1132,7 +1132,14 @@ void CG_DrawForcePower( menuDef_t *menuHUD )
 	if (focusItem)
 	{
 		// Print force amount
-		trap->R_SetColor( focusItem->window.foreColor );
+		if ( flash )
+		{
+			trap->R_SetColor( colorTable[CT_RED] );
+		}
+		else
+		{
+			trap->R_SetColor( focusItem->window.foreColor );
+		}
 
 		CG_DrawNumField (
 			focusItem->window.rect.x,
@@ -1146,6 +1153,168 @@ void CG_DrawForcePower( menuDef_t *menuHUD )
 	}
 }
 
+static void CG_DrawSimpleSaberStyle( const centity_t *cent )
+{
+	uint32_t	calcColor;
+	char		num[7] = { 0 };
+	int			weapX = 16;
+
+	if ( !cent->currentState.weapon ) // We don't have a weapon right now
+	{
+		return;
+	}
+
+	if ( cent->currentState.weapon != WP_SABER )
+	{
+		return;
+	}
+
+	switch ( cg.predictedPlayerState.fd.saberDrawAnimLevel )
+	{
+	default:
+	case SS_FAST:
+		Com_sprintf( num, sizeof( num ), "FAST" );
+		calcColor = CT_ICON_BLUE;
+		weapX = 0;
+		break;
+	case SS_MEDIUM:
+		Com_sprintf( num, sizeof( num ), "MEDIUM" );
+		calcColor = CT_YELLOW;
+		break;
+	case SS_STRONG:
+		Com_sprintf( num, sizeof( num ), "STRONG" );
+		calcColor = CT_HUD_RED;
+		break;
+	case SS_DESANN:
+		Com_sprintf( num, sizeof( num ), "DESANN" );
+		calcColor = CT_HUD_RED;
+		break;
+	case SS_TAVION:
+		Com_sprintf( num, sizeof( num ), "TAVION" );
+		calcColor = CT_ICON_BLUE;
+		break;
+	case SS_DUAL:
+		Com_sprintf( num, sizeof( num ), "AKIMBO" );
+		calcColor = CT_HUD_ORANGE;
+		break;
+	case SS_STAFF:
+		Com_sprintf( num, sizeof( num ), "STAFF" );
+		calcColor = CT_HUD_ORANGE;
+		break;
+	}
+
+	CG_DrawProportionalString( SCREEN_WIDTH - (weapX + 16 + 32), (SCREEN_HEIGHT - 80) + 40, num, UI_SMALLFONT | UI_DROPSHADOW, colorTable[calcColor] );
+}
+
+static void CG_DrawSimpleAmmo( const centity_t *cent )
+{
+	playerState_t	*ps;
+	uint32_t	calcColor;
+	int			currValue = 0;
+	char		num[16] = { 0 };
+
+	if ( !cent->currentState.weapon ) // We don't have a weapon right now
+	{
+		return;
+	}
+
+	ps = &cg.snap->ps;
+
+	currValue = ps->ammo[weaponData[cent->currentState.weapon].ammoIndex];
+
+	// No ammo
+	if ( currValue < 0 || (weaponData[cent->currentState.weapon].energyPerShot == 0 && weaponData[cent->currentState.weapon].altEnergyPerShot == 0) )
+	{
+		CG_DrawProportionalString( SCREEN_WIDTH - (16 + 32), (SCREEN_HEIGHT - 80) + 40, "--", UI_SMALLFONT | UI_DROPSHADOW, colorTable[CT_HUD_ORANGE] );
+		return;
+	}
+
+	//
+	// ammo
+	//
+	if ( cg.oldammo < currValue )
+	{
+		cg.oldAmmoTime = cg.time + 200;
+	}
+
+	cg.oldammo = currValue;
+
+	// Determine the color of the numeric field
+
+	// Firing or reloading?
+	if ( (cg.predictedPlayerState.weaponstate == WEAPON_FIRING
+		&& cg.predictedPlayerState.weaponTime > 100) )
+	{
+		calcColor = CT_LTGREY;
+	}
+	else
+	{
+		if ( currValue > 0 )
+		{
+			if ( cg.oldAmmoTime > cg.time )
+			{
+				calcColor = CT_YELLOW;
+			}
+			else
+			{
+				calcColor = CT_HUD_ORANGE;
+			}
+		}
+		else
+		{
+			calcColor = CT_RED;
+		}
+	}
+
+	Com_sprintf( num, sizeof( num ), "%i", currValue );
+
+	CG_DrawProportionalString( SCREEN_WIDTH - (16 + 32), (SCREEN_HEIGHT - 80) + 40, num, UI_SMALLFONT | UI_DROPSHADOW, colorTable[calcColor] );
+}
+
+static void CG_DrawSimpleForcePower( const centity_t *cent )
+{
+	uint32_t	calcColor;
+	char		num[16] = { 0 };
+	qboolean	flash = qfalse;
+
+	if ( !cg.snap->ps.fd.forcePowersKnown )
+	{
+		return;
+	}
+
+	// Make the hud flash by setting forceHUDTotalFlashTime above cg.time
+	if ( cg.forceHUDTotalFlashTime > cg.time )
+	{
+		flash = qtrue;
+		if ( cg.forceHUDNextFlashTime < cg.time )
+		{
+			cg.forceHUDNextFlashTime = cg.time + 400;
+			trap->S_StartSound( NULL, 0, CHAN_LOCAL, cgs.media.noforceSound );
+			if ( cg.forceHUDActive )
+			{
+				cg.forceHUDActive = qfalse;
+			}
+			else
+			{
+				cg.forceHUDActive = qtrue;
+			}
+
+		}
+	}
+	else	// turn HUD back on if it had just finished flashing time.
+	{
+		cg.forceHUDNextFlashTime = 0;
+		cg.forceHUDActive = qtrue;
+	}
+
+	// Determine the color of the numeric field
+	calcColor = flash ? CT_RED : CT_ICON_BLUE;
+
+	Com_sprintf( num, sizeof( num ), "%i", cg.snap->ps.fd.forcePower );
+
+	CG_DrawProportionalString( SCREEN_WIDTH - (18 + 14 + 32), (SCREEN_HEIGHT - 80) + 40 + 14, num, UI_SMALLFONT | UI_DROPSHADOW, colorTable[calcColor] );
+}
+
 /*
 ================
 CG_DrawHUD
@@ -1163,8 +1332,6 @@ void CG_DrawHUD(centity_t	*cent)
 	{
 		int x = 0;
 		int y = SCREEN_HEIGHT-80;
-		char ammoString[64];
-		int weapX = x;
 
 		if (cg.predictedPlayerState.pm_type != PM_SPECTATOR)
 		{
@@ -1172,45 +1339,14 @@ void CG_DrawHUD(centity_t	*cent)
 
 			CG_DrawProportionalString( x+18+14, y+40+14, va( "%i", cg.snap->ps.stats[STAT_ARMOR] ), UI_SMALLFONT|UI_DROPSHADOW, colorTable[CT_HUD_GREEN] );
 
-			if (cg.snap->ps.weapon == WP_SABER)
-			{
-				if (cg.snap->ps.fd.saberDrawAnimLevel == SS_DUAL)
-				{
-					Com_sprintf(ammoString, sizeof(ammoString), "AKIMBO");
-					weapX += 16;
-				}
-				else if (cg.snap->ps.fd.saberDrawAnimLevel == SS_STAFF)
-				{
-					Com_sprintf(ammoString, sizeof(ammoString), "STAFF");
-					weapX += 16;
-				}
-				else if (cg.snap->ps.fd.saberDrawAnimLevel == FORCE_LEVEL_3)
-				{
-					Com_sprintf(ammoString, sizeof(ammoString), "STRONG");
-					weapX += 16;
-				}
-				else if (cg.snap->ps.fd.saberDrawAnimLevel == FORCE_LEVEL_2)
-				{
-					Com_sprintf(ammoString, sizeof(ammoString), "MEDIUM");
-					weapX += 16;
-				}
-				else
-				{
-					Com_sprintf(ammoString, sizeof(ammoString), "FAST");
-				}
-			}
-			else if (weaponData[cent->currentState.weapon].energyPerShot == 0 && weaponData[cent->currentState.weapon].altEnergyPerShot == 0)
-			{
-				Q_strncpyz(ammoString, "--", sizeof(ammoString));
-			}
-			else
-			{
-				Com_sprintf(ammoString, sizeof(ammoString), "%i", cg.snap->ps.ammo[weaponData[cent->currentState.weapon].ammoIndex]);
-			}
+			CG_DrawSimpleForcePower( cent );
 
-			CG_DrawProportionalString( SCREEN_WIDTH-(weapX+16+32), y+40, va( "%s", ammoString ), UI_SMALLFONT|UI_DROPSHADOW, colorTable[CT_HUD_ORANGE] );
+			if ( cent->currentState.weapon == WP_SABER )
+				CG_DrawSimpleSaberStyle( cent );
+			else
+				CG_DrawSimpleAmmo( cent );
 
-			CG_DrawProportionalString( SCREEN_WIDTH-(x+18+14+32), y+40+14, va( "%i", cg.snap->ps.fd.forcePower), UI_SMALLFONT|UI_DROPSHADOW, colorTable[CT_ICON_BLUE] );
+			//TODO Add score line
 		}
 
 		return;
diff --git a/codemp/client/snd_dma.cpp b/codemp/client/snd_dma.cpp
index 65b587e..74e1299 100644
--- a/codemp/client/snd_dma.cpp
+++ b/codemp/client/snd_dma.cpp
@@ -36,7 +36,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 #include <inttypes.h>
 
 #if defined(_WIN32)
-#include <Windows.h>
+#include <windows.h>
 #endif
 
 qboolean s_shutUp = qfalse;
diff --git a/codemp/client/snd_local.h b/codemp/client/snd_local.h
index bdd8d99..5cddd1c 100644
--- a/codemp/client/snd_local.h
+++ b/codemp/client/snd_local.h
@@ -37,7 +37,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 #include "OpenAL/al.h"
 #include "OpenAL/alc.h"
 #include "eax/eax.h"
-#include "eax/eaxman.h"
+#include "eax/EaxMan.h"
 /*#elif defined MACOS_X
 #include <OpenAL/al.h>
 #include <OpenAL/alc.h>
diff --git a/codemp/game/bg_pmove.c b/codemp/game/bg_pmove.c
index 62efce9..c4180d8 100644
--- a/codemp/game/bg_pmove.c
+++ b/codemp/game/bg_pmove.c
@@ -9646,7 +9646,7 @@ static QINLINE void PM_CmdForSaberMoves(usercmd_t *ucmd)
 void PM_VehicleViewAngles(playerState_t *ps, bgEntity_t *veh, usercmd_t *ucmd)
 {
 	Vehicle_t *pVeh = veh->m_pVehicle;
-	qboolean setAngles = qtrue;
+	qboolean setAngles = qfalse;
 	vec3_t clampMin;
 	vec3_t clampMax;
 	int i;
diff --git a/codemp/qcommon/common.cpp b/codemp/qcommon/common.cpp
index e3df37a..f866324 100644
--- a/codemp/qcommon/common.cpp
+++ b/codemp/qcommon/common.cpp
@@ -30,7 +30,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 #include "../server/NPCNav/navigator.h"
 #if defined(_WIN32)
 #define WIN32_LEAN_AND_MEAN
-#include <Windows.h>
+#include <windows.h>
 #endif
 
 FILE *debuglogfile;
@@ -1270,7 +1270,7 @@ void Com_Init( char *commandLine ) {
 		com_G2Report = Cvar_Get("com_G2Report", "0", 0);
 #endif
 
-		com_affinity = Cvar_Get( "com_affinity", "1", CVAR_ARCHIVE );
+		com_affinity = Cvar_Get( "com_affinity", "0", CVAR_ARCHIVE );
 
 		com_bootlogo = Cvar_Get( "com_bootlogo", "1", CVAR_ARCHIVE);
 
diff --git a/codemp/qcommon/files.cpp b/codemp/qcommon/files.cpp
index e1203f7..f78cea6 100644
--- a/codemp/qcommon/files.cpp
+++ b/codemp/qcommon/files.cpp
@@ -40,7 +40,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 #include "minizip/unzip.h"
 
 #if defined(_WIN32)
-#include <Windows.h>
+#include <windows.h>
 #endif
 
 // for rmdir
@@ -971,14 +971,23 @@ void FS_Rename( const char *from, const char *to ) {
 }
 
 /*
-==============
+===========
 FS_FCloseFile
 
-If the FILE pointer is an open pak file, leave it open.
+Close a file.
 
-For some reason, other dll's can't just cal fclose()
-on files returned by FS_FOpenFile...
-==============
+There are three cases handled:
+
+  * normal file: closed with fclose.
+
+  * file in pak3 archive: subfile is closed with unzCloseCurrentFile, but the
+    minizip handle to the pak3 remains open.
+
+  * file in pak3 archive, opened with "unique" flag: This file did not use
+    the system minizip handle to the pak3 file, but its own dedicated one.
+    The dedicated handle is closed with unzClose.
+
+===========
 */
 void FS_FCloseFile( fileHandle_t f ) {
 	if ( !fs_searchpaths ) {
@@ -1590,6 +1599,9 @@ qboolean FS_FindPureDLL(const char *name)
 	if(!fs_searchpaths)
 		Com_Error(ERR_FATAL, "Filesystem call made without initialization");
 
+	if ( !Cvar_VariableValue( "sv_pure" ) )
+		return qtrue;
+
 	Com_sprintf(dllName, sizeof(dllName), "%sx86.dll", name);
 
 	if(FS_FOpenFileRead(dllName, &h, qtrue) > 0)
diff --git a/codemp/rd-vanilla/qgl.h b/codemp/rd-vanilla/qgl.h
index 3489f03..df28a69 100644
--- a/codemp/rd-vanilla/qgl.h
+++ b/codemp/rd-vanilla/qgl.h
@@ -27,7 +27,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 #	include <GL/gl.h>
 #elif defined( _WIN32 )
 #	include <windows.h>
-#	include <gl/gl.h>
+#	include <GL/gl.h>
 #elif defined(MACOS_X)
 // Prevent OS X from including its own out-of-date glext.h
 #	define GL_GLEXT_LEGACY
diff --git a/codemp/rd-vanilla/tr_cmds.cpp b/codemp/rd-vanilla/tr_cmds.cpp
index 6d55d65..9dc2764 100644
--- a/codemp/rd-vanilla/tr_cmds.cpp
+++ b/codemp/rd-vanilla/tr_cmds.cpp
@@ -437,16 +437,19 @@ Returns the number of msec spent in the back end
 =============
 */
 void RE_EndFrame( int *frontEndMsec, int *backEndMsec ) {
-	swapBuffersCommand_t	*cmd;
+	swapBuffersCommand_t *cmd;
+	renderCommandList_t *cmdList;
 
 	if ( !tr.registered ) {
 		return;
 	}
-	cmd = (swapBuffersCommand_t *) R_GetCommandBuffer( sizeof( *cmd ) );
-	if ( !cmd ) {
-		return;
-	}
+
+	cmdList = &backEndData->commands;
+	assert( cmdList->used + 4 <= MAX_RENDER_COMMANDS );
+
+	cmd = (swapBuffersCommand_t *)(cmdList->cmds + cmdList->used);
 	cmd->commandId = RC_SWAP_BUFFERS;
+	cmdList->used += 4;
 
 	R_IssueRenderCommands( qtrue );
 
diff --git a/codemp/server/NPCNav/navigator.cpp b/codemp/server/NPCNav/navigator.cpp
index 0473b0d..3331687 100644
--- a/codemp/server/NPCNav/navigator.cpp
+++ b/codemp/server/NPCNav/navigator.cpp
@@ -610,6 +610,9 @@ bool CNavigator::Load( const char *filename, int checksum )
 {
 	fileHandle_t	file;
 
+	// Free previous map just in case. jampgame doesn't do this by default...
+	Free();
+
 	//Attempt to load the file
 	FS_FOpenFileByMode( va( "maps/%s.nav", filename ), &file, FS_READ );
 
diff --git a/codemp/ui/ui_main.c b/codemp/ui/ui_main.c
index 7c89627..bdb0733 100644
--- a/codemp/ui/ui_main.c
+++ b/codemp/ui/ui_main.c
@@ -33,6 +33,8 @@ USER INTERFACE MAIN
 // use this to get a demo build without an explicit demo build, i.e. to get the demo ui files to build
 //#define PRE_RELEASE_TADEMO
 
+#include <stdlib.h>
+
 #include "ghoul2/G2.h"
 #include "ui_local.h"
 #include "qcommon/qfiles.h"
@@ -9674,15 +9676,22 @@ static void UI_BuildPlayerModel_List( qboolean inGameLoad )
 
 		if (f)
 		{
-			char buffer[2048];
 			playerSpeciesInfo_t *species;
-			char	skinname[64];
-			int		numfiles;
-			int		iSkinParts=0;
+			char                 skinname[64];
+			int                  numfiles;
+			int                  iSkinParts=0;
+			char                *buffer = NULL;
+
+			buffer = malloc(filelen + 1);
+			if(!buffer)
+			{
+				Com_Error(ERR_FATAL, "Could not allocate buffer to read %s", fpath);
+			}
 
-			trap->FS_Read(&buffer, filelen, f);
+			trap->FS_Read(buffer, filelen, f);
 			trap->FS_Close(f);
-			buffer[filelen] = 0;	//ensure trailing NULL
+
+			buffer[filelen] = 0;
 
 			//record this species
 			if (uiInfo.playerSpeciesCount >= uiInfo.playerSpeciesMax)
@@ -9707,6 +9716,8 @@ static void UI_BuildPlayerModel_List( qboolean inGameLoad )
 			species->SkinTorso = (skinName_t *)malloc(species->SkinTorsoMax * sizeof(skinName_t));
 			species->SkinLeg = (skinName_t *)malloc(species->SkinLegMax * sizeof(skinName_t));
 
+			free(buffer);
+
 			numfiles = trap->FS_GetFileList( va("models/players/%s",dirptr), ".skin", filelist, 2048 );
 			fileptr  = filelist;
 			for (j=0; j<numfiles; j++,fileptr+=filelen+1)
diff --git a/shared/sdl/sdl_input.cpp b/shared/sdl/sdl_input.cpp
index ed210c2..cb2e98d 100644
--- a/shared/sdl/sdl_input.cpp
+++ b/shared/sdl/sdl_input.cpp
@@ -176,7 +176,7 @@ static qboolean IN_IsConsoleKey( fakeAscii_t key, int character )
 
 #if defined(_WIN32)
 #define WIN32_LEAN_AND_MEAN
-#include <Windows.h>
+#include <windows.h>
 #endif
 
 static bool IN_NumLockEnabled( void )
diff --git a/shared/sys/con_win32.cpp b/shared/sys/con_win32.cpp
index 7b38aae..d495624 100644
--- a/shared/sys/con_win32.cpp
+++ b/shared/sys/con_win32.cpp
@@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #include "qcommon/qcommon.h"
 #include "sys_local.h"
 #include "con_local.h"
-#include <Windows.h>
+#include <windows.h>
 
 #define QCONSOLE_HISTORY 32
 
diff --git a/shared/sys/sys_win32.cpp b/shared/sys/sys_win32.cpp
index c8142d2..3c27ce1 100644
--- a/shared/sys/sys_win32.cpp
+++ b/shared/sys/sys_win32.cpp
@@ -22,8 +22,8 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 #include "sys_local.h"
 #include <direct.h>
 #include <io.h>
-#include <ShlObj.h>
-#include <Windows.h>
+#include <shlobj.h>
+#include <windows.h>
 
 #define MEM_THRESHOLD (128*1024*1024)
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/openjk.git



More information about the Pkg-games-commits mailing list