diff --git a/neo/CMakeLists.txt b/neo/CMakeLists.txt index c43c1b04..51414869 100644 --- a/neo/CMakeLists.txt +++ b/neo/CMakeLists.txt @@ -36,7 +36,7 @@ option(OPENAL "Use OpenAL soft instead of XAudio2" OFF) option(FFMPEG - "Use FMPEG to render Bink videos" ON) + "Use FMPEG to render Bink videos" OFF) option(BINKDEC "Use included libbinkdec to render Bink videos" OFF) @@ -51,10 +51,10 @@ option(USE_MoltenVK "Use MoltenVK library directly instead of Vulkan loader on macOS" OFF) option(ONATIVE - "Optimize for the host CPU" OFF) + "Optimize for the host CPU" ON) option(WINDOWS10 - "Build for Windows 10+" OFF) + "Build for Windows 10+" ON) option(USE_SYSTEM_ZLIB "Use the system zlib instead of the bundled one" OFF) @@ -94,6 +94,12 @@ else() option(USE_INTRINSICS_SSE "Compile using SSE intrinsics (e.g mmx, sse, msse2)" OFF) endif() +#trying to add windows arm support +if(CMAKE_SYSTEM_PROCESSOR MATCHES "(arm64)|(x64)") +option(USE_INTRINSICS_SSE "Compile using SSE intrinsics (e.g mmx, sse, msse2)" OFF) +endif() + + if(FFMPEG AND BINKDEC) message(FATAL_ERROR "Only one of FFMPEG and BINKDEC (or neither) can be enabled at a time") endif() @@ -102,8 +108,9 @@ if(UNIX) set(OPENAL ON) # SRS - Disable precompiled headers when cross-compiling on OSX, e.g. when creating universal binaries - if((CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64" AND CMAKE_OSX_ARCHITECTURES MATCHES "arm64" ) OR - (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "arm64" AND CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")) + if((CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64" AND CMAKE_OSX_ARCHITECTURES MATCHES "arm64" ) OR + # (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "arm64" AND CMAKE_OSX_ARCHITECTURES MATCHES "x86_64") + (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "arm64") OR (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x64")) set(USE_PRECOMPILED_HEADERS OFF) endif() diff --git a/neo/cmake-vs2019-arm64.bat b/neo/cmake-vs2019-arm64.bat new file mode 100644 index 00000000..d47af80e --- /dev/null +++ b/neo/cmake-vs2019-arm64.bat @@ -0,0 +1,6 @@ +cd .. +del /s /q build +mkdir build +cd build +cmake -G "Visual Studio 16" -A arm64 -D WINDOWS10=ON -D USE_INTRINSICS_SSE=OFF ../neo +pause \ No newline at end of file diff --git a/neo/idlib/sys/sys_defines.h b/neo/idlib/sys/sys_defines.h index ca9ee5b5..b1cfafe3 100644 --- a/neo/idlib/sys/sys_defines.h +++ b/neo/idlib/sys/sys_defines.h @@ -39,9 +39,12 @@ If you have questions concerning this license or the applicable additional terms // Win32 #if defined(WIN32) || defined(_WIN32) + #if defined(_WIN64) #define CPUSTRING "x64" + #elif defined(__aarch64__) || defined(__ARM64__) || defined(_M_ARM64) + #define CPUSTRING "arm64" #else #define CPUSTRING "x86" #endif @@ -185,7 +188,9 @@ Defines and macros usable in all code #define ALIGN( x, a ) ( ( ( x ) + ((a)-1) ) & ~((a)-1) ) + // RB: changed UINT_PTR to uintptr_t +#include #define _alloca16( x ) ((void *)ALIGN( (uintptr_t)_alloca( ALIGN( x, 16 ) + 16 ), 16 ) ) #define _alloca128( x ) ((void *)ALIGN( (uintptr_t)_alloca( ALIGN( x, 128 ) + 128 ), 128 ) ) // RB end diff --git a/neo/libs/rapidjson/include/rapidjson/rapidjson.h b/neo/libs/rapidjson/include/rapidjson/rapidjson.h index f22130d3..d7ccb286 100644 --- a/neo/libs/rapidjson/include/rapidjson/rapidjson.h +++ b/neo/libs/rapidjson/include/rapidjson/rapidjson.h @@ -15,6 +15,8 @@ #ifndef RAPIDJSON_RAPIDJSON_H_ #define RAPIDJSON_RAPIDJSON_H_ +//#define RAPIDJSON_ENDIAN 0 + /*!\file rapidjson.h \brief common definitions and configuration @@ -209,7 +211,7 @@ // Detect with architecture macros # elif defined(__sparc) || defined(__sparc__) || defined(_POWER) || defined(__powerpc__) || defined(__ppc__) || defined(__hpux) || defined(__hppa) || defined(_MIPSEB) || defined(_POWER) || defined(__s390__) # define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN -# elif defined(__i386__) || defined(__alpha__) || defined(__ia64) || defined(__ia64__) || defined(_M_IX86) || defined(_M_IA64) || defined(_M_ALPHA) || defined(__amd64) || defined(__amd64__) || defined(_M_AMD64) || defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || defined(__bfin__) +# elif defined(_M_ARM64) || defined(__i386__) || defined(__alpha__) || defined(__ia64) || defined(__ia64__) || defined(_M_IX86) || defined(_M_IA64) || defined(_M_ALPHA) || defined(__amd64) || defined(__amd64__) || defined(_M_AMD64) || defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || defined(__bfin__) # define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN # elif defined(RAPIDJSON_DOXYGEN_RUNNING) # define RAPIDJSON_ENDIAN diff --git a/neo/shaders/BRDF.inc.hlsl b/neo/shaders/BRDF.inc.hlsl index 3aec2c4a..192f1097 100644 --- a/neo/shaders/BRDF.inc.hlsl +++ b/neo/shaders/BRDF.inc.hlsl @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Doom 3 BFG Edition GPL Source Code @@ -54,7 +54,7 @@ half Distribution_GGX_1886( half hdotN, half alpha ) } // Fresnel term F( v, h ) -// Fnone( v, h ) = F(0°) = specularColor +// Fnone( v, h ) = F(0�) = specularColor half3 Fresnel_Schlick( half3 specularColor, half vDotN ) { return specularColor + ( 1.0 - specularColor ) * pow( 1.0 - vDotN, 5.0 ); diff --git a/neo/shaders/builtin/lighting/ambient_lightgrid_IBL.ps.hlsl b/neo/shaders/builtin/lighting/ambient_lightgrid_IBL.ps.hlsl index 302d5254..57480c52 100644 --- a/neo/shaders/builtin/lighting/ambient_lightgrid_IBL.ps.hlsl +++ b/neo/shaders/builtin/lighting/ambient_lightgrid_IBL.ps.hlsl @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Doom 3 BFG Edition GPL Source Code diff --git a/neo/shaders/builtin/lighting/interaction.ps.hlsl b/neo/shaders/builtin/lighting/interaction.ps.hlsl index 99fafe03..3da7fecc 100644 --- a/neo/shaders/builtin/lighting/interaction.ps.hlsl +++ b/neo/shaders/builtin/lighting/interaction.ps.hlsl @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Doom 3 BFG Edition GPL Source Code diff --git a/neo/shaders/builtin/lighting/interaction.vs.hlsl b/neo/shaders/builtin/lighting/interaction.vs.hlsl index cf31dfb8..35799621 100644 --- a/neo/shaders/builtin/lighting/interaction.vs.hlsl +++ b/neo/shaders/builtin/lighting/interaction.vs.hlsl @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Doom 3 BFG Edition GPL Source Code diff --git a/neo/shaders/builtin/lighting/interactionSM.ps.hlsl b/neo/shaders/builtin/lighting/interactionSM.ps.hlsl index 96b2e3d3..e0f0bca5 100644 --- a/neo/shaders/builtin/lighting/interactionSM.ps.hlsl +++ b/neo/shaders/builtin/lighting/interactionSM.ps.hlsl @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Doom 3 BFG Edition GPL Source Code diff --git a/neo/shaders/builtin/lighting/interactionSM.vs.hlsl b/neo/shaders/builtin/lighting/interactionSM.vs.hlsl index 962cf178..bd6d7af2 100644 --- a/neo/shaders/builtin/lighting/interactionSM.vs.hlsl +++ b/neo/shaders/builtin/lighting/interactionSM.vs.hlsl @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Doom 3 BFG Edition GPL Source Code diff --git a/neo/shaders/builtin/post/SMAA.inc.hlsl b/neo/shaders/builtin/post/SMAA.inc.hlsl index c32a9a3b..765cbe3a 100644 --- a/neo/shaders/builtin/post/SMAA.inc.hlsl +++ b/neo/shaders/builtin/post/SMAA.inc.hlsl @@ -1,4 +1,4 @@ -/** +/** * Copyright (C) 2013 Jorge Jimenez (jorge@iryoku.com) * Copyright (C) 2013 Jose I. Echevarria (joseignacioechevarria@gmail.com) * Copyright (C) 2013 Belen Masia (bmasia@unizar.es) @@ -44,7 +44,7 @@ * * The shader has three passes, chained together as follows: * - * |input|------------------· + * |input|------------------� * v | * [ SMAA*EdgeDetection ] | * v | @@ -54,7 +54,7 @@ * v | * |blendTex| | * v | - * [ SMAANeighborhoodBlending ] <------· + * [ SMAANeighborhoodBlending ] <------� * v * |output| * diff --git a/neo/shaders/globalshaders b/neo/shaders/globalshaders index 2f7a83d9..7f6df45c 100644 --- a/neo/shaders/globalshaders +++ b/neo/shaders/globalshaders @@ -1 +1 @@ -BRDF.inc.hlslglobal_inc.hlslBRDF.inc.hlslglobal_inc.hlsl \ No newline at end of file +BRDF.inc.hlsl global_inc.hlsl BRDF.inc.hlsl global_inc.hlsl \ No newline at end of file diff --git a/neo/sound/XAudio2/XA2_CinematicAudio.cpp b/neo/sound/XAudio2/XA2_CinematicAudio.cpp index 0d519fb4..15e8a39e 100644 --- a/neo/sound/XAudio2/XA2_CinematicAudio.cpp +++ b/neo/sound/XAudio2/XA2_CinematicAudio.cpp @@ -115,6 +115,9 @@ void CinematicAudio_XAudio2::InitAudio( void* audioContext ) bool use_ext = false; voiceFormatcine.nChannels = binkInfo->nChannels; //fixed voiceFormatcine.nSamplesPerSec = binkInfo->sampleRate; //fixed +#else + int format_byte = 2; + bool use_ext = false; #endif WAVEFORMATEXTENSIBLE exvoice = { 0 };