diff --git a/crogine.sln b/crogine.sln index 84621f210..71da50233 100644 --- a/crogine.sln +++ b/crogine.sln @@ -608,7 +608,6 @@ Global {64579103-DEC3-41E4-971F-9C0DF996BE8B}.Debug|ARM.ActiveCfg = Debug|Win32 {64579103-DEC3-41E4-971F-9C0DF996BE8B}.Debug|ARM64.ActiveCfg = Debug|Win32 {64579103-DEC3-41E4-971F-9C0DF996BE8B}.Debug|x64.ActiveCfg = Debug|x64 - {64579103-DEC3-41E4-971F-9C0DF996BE8B}.Debug|x64.Build.0 = Debug|x64 {64579103-DEC3-41E4-971F-9C0DF996BE8B}.Debug|x86.ActiveCfg = Debug|Win32 {64579103-DEC3-41E4-971F-9C0DF996BE8B}.DebugASan|Any CPU.ActiveCfg = DebugASan|Win32 {64579103-DEC3-41E4-971F-9C0DF996BE8B}.DebugASan|ARM.ActiveCfg = DebugASan|Win32 @@ -671,6 +670,7 @@ Global {B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Debug|ARM.ActiveCfg = Debug|Win32 {B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Debug|ARM64.ActiveCfg = Debug|Win32 {B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Debug|x64.ActiveCfg = Debug|x64 + {B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Debug|x64.Build.0 = Debug|x64 {B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Debug|x86.ActiveCfg = Debug|Win32 {B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Debug|x86.Build.0 = Debug|Win32 {B1559428-CDF8-4797-8766-0EA62BDD6D1B}.DebugASan|Any CPU.ActiveCfg = DebugASan|Win32 diff --git a/crogine/src/core/ConfigFile.cpp b/crogine/src/core/ConfigFile.cpp index 27dcb509c..580cb3d4f 100644 --- a/crogine/src/core/ConfigFile.cpp +++ b/crogine/src/core/ConfigFile.cpp @@ -201,13 +201,24 @@ bool ConfigObject::loadFromFile(const std::string& filePath, bool relative) //remove any opening comments std::string data; + char* temp = nullptr; std::int64_t readTotal = 0; - static const std::int32_t DEST_SIZE = 256; + static constexpr std::int32_t DEST_SIZE = 1024;// 256; char dest[DEST_SIZE]; while (data.empty() && readTotal < fileSize) { - data = std::string(Util::String::rwgets(dest, DEST_SIZE, rr.file, &readTotal)); - removeComment(data); + temp = Util::String::rwgets(dest, DEST_SIZE, rr.file, &readTotal); + + if (temp) + { + data = std::string(temp); + removeComment(data); + } + else + { + LogE << path << ": unexpected EOF" << std::endl; + return false; + } } //check config is not opened with a property if (isProperty(data)) @@ -218,8 +229,18 @@ bool ConfigObject::loadFromFile(const std::string& filePath, bool relative) //make sure next line is a brace to ensure we have an object std::string lastLine = data; - data = std::string(Util::String::rwgets(dest, DEST_SIZE, rr.file, &readTotal)); - removeComment(data); + + temp = Util::String::rwgets(dest, DEST_SIZE, rr.file, &readTotal); + if (temp) + { + data = std::string(temp); + removeComment(data); + } + else + { + LogE << path << ": unexpected EOF" << std::endl; + return false; + } //tracks brace balance std::vector objStack; @@ -242,8 +263,18 @@ bool ConfigObject::loadFromFile(const std::string& filePath, bool relative) while (readTotal < fileSize) { - data = std::string(Util::String::rwgets(dest, DEST_SIZE, rr.file, &readTotal)); - removeComment(data); + temp = Util::String::rwgets(dest, DEST_SIZE, rr.file, &readTotal); + if (temp) + { + data = std::string(temp); + removeComment(data); + } + else + { + LogE << path << ": unexpected EOF" << std::endl; + return false; + } + if (!data.empty()) { if (data[0] == '}') @@ -274,8 +305,19 @@ bool ConfigObject::loadFromFile(const std::string& filePath, bool relative) { //add a new object and make it current std::string prevLine = data; - data = std::string(Util::String::rwgets(dest, DEST_SIZE, rr.file, &readTotal)); - removeComment(data); + + temp = Util::String::rwgets(dest, DEST_SIZE, rr.file, &readTotal); + if (temp) + { + data = std::string(temp); + removeComment(data); + } + else + { + LogE << path << ": unexpected EOF" << std::endl; + return false; + } + if (data[0] == '{') { //TODO we have to allow mutliple objects with the same name in this instance diff --git a/extlibs/sdl2/include/SDL_config.h b/extlibs/sdl2/include/SDL_config.h index dba780860..49605b1e8 100644 --- a/extlibs/sdl2/include/SDL_config.h +++ b/extlibs/sdl2/include/SDL_config.h @@ -19,313 +19,43 @@ 3. This notice may not be removed or altered from any source distribution. */ -#ifndef SDL_config_windows_h_ -#define SDL_config_windows_h_ +#ifndef SDL_config_h_ #define SDL_config_h_ #include "SDL_platform.h" -/* winsdkver.h defines _WIN32_MAXVER for SDK version detection. It is present since at least the Windows 7 SDK, - * but out of caution we'll only use it if the compiler supports __has_include() to confirm its presence. - * If your compiler doesn't support __has_include() but you have winsdkver.h, define HAVE_WINSDKVER_H. */ -#if !defined(HAVE_WINSDKVER_H) && defined(__has_include) -#if __has_include() -#define HAVE_WINSDKVER_H 1 -#endif -#endif - -#ifdef HAVE_WINSDKVER_H -#include -#endif - -/* sdkddkver.h defines more specific SDK version numbers. This is needed because older versions of the - * Windows 10 SDK have broken declarations for the C API for DirectX 12. */ -#if !defined(HAVE_SDKDDKVER_H) && defined(__has_include) -#if __has_include() -#define HAVE_SDKDDKVER_H 1 -#endif -#endif - -#ifdef HAVE_SDKDDKVER_H -#include -#endif - -/* This is a set of defines to configure the SDL features */ - -#if !defined(HAVE_STDINT_H) && !defined(_STDINT_H_) -/* Most everything except Visual Studio 2008 and earlier has stdint.h now */ -#if defined(_MSC_VER) && (_MSC_VER < 1600) -typedef signed __int8 int8_t; -typedef unsigned __int8 uint8_t; -typedef signed __int16 int16_t; -typedef unsigned __int16 uint16_t; -typedef signed __int32 int32_t; -typedef unsigned __int32 uint32_t; -typedef signed __int64 int64_t; -typedef unsigned __int64 uint64_t; -#ifndef _UINTPTR_T_DEFINED -#ifdef _WIN64 -typedef unsigned __int64 uintptr_t; -#else -typedef unsigned int uintptr_t; -#endif -#define _UINTPTR_T_DEFINED -#endif -#else -#define HAVE_STDINT_H 1 -#endif /* Visual Studio 2008 */ -#endif /* !_STDINT_H_ && !HAVE_STDINT_H */ - -#ifdef _WIN64 -# define SIZEOF_VOIDP 8 -#else -# define SIZEOF_VOIDP 4 -#endif - -#ifdef __clang__ -# define HAVE_GCC_ATOMICS 1 -#endif - -#define HAVE_DDRAW_H 1 -#define HAVE_DINPUT_H 1 -#define HAVE_DSOUND_H 1 -#ifndef __WATCOMC__ -#define HAVE_DXGI_H 1 -#define HAVE_XINPUT_H 1 -#if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0A00 /* Windows 10 SDK */ -#define HAVE_WINDOWS_GAMING_INPUT_H 1 -#endif -#if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0602 /* Windows 8 SDK */ -#define HAVE_D3D11_H 1 -#define HAVE_ROAPI_H 1 -#endif -#if defined(WDK_NTDDI_VERSION) && WDK_NTDDI_VERSION > 0x0A000008 /* 10.0.19041.0 */ -#define HAVE_D3D12_H 1 -#endif -#if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0603 /* Windows 8.1 SDK */ -#define HAVE_SHELLSCALINGAPI_H 1 -#endif -#define HAVE_MMDEVICEAPI_H 1 -#define HAVE_AUDIOCLIENT_H 1 -#define HAVE_TPCSHRD_H 1 -#define HAVE_SENSORSAPI_H 1 -#endif -#if (defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64)) && (defined(_MSC_VER) && _MSC_VER >= 1600) -#define HAVE_IMMINTRIN_H 1 -#elif defined(__has_include) && (defined(__i386__) || defined(__x86_64)) -# if __has_include() -# define HAVE_IMMINTRIN_H 1 -# endif -#endif - -/* This is disabled by default to avoid C runtime dependencies and manifest requirements */ -#ifdef HAVE_LIBC -/* Useful headers */ -#define STDC_HEADERS 1 -#define HAVE_CTYPE_H 1 -#define HAVE_FLOAT_H 1 -#define HAVE_LIMITS_H 1 -#define HAVE_MATH_H 1 -#define HAVE_SIGNAL_H 1 -#define HAVE_STDIO_H 1 -#define HAVE_STRING_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -/* OpenWatcom requires specific calling conventions for qsort and bsearch */ -#ifndef __WATCOMC__ -#define HAVE_QSORT 1 -#define HAVE_BSEARCH 1 -#endif -#define HAVE_ABS 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE__STRREV 1 -/* These functions have security warnings, so we won't use them */ -/* #undef HAVE__STRUPR */ -/* #undef HAVE__STRLWR */ -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -/* #undef HAVE_STRTOK_R */ -/* These functions have security warnings, so we won't use them */ -/* #undef HAVE__LTOA */ -/* #undef HAVE__ULTOA */ -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE__STRICMP 1 -#define HAVE__STRNICMP 1 -#define HAVE__WCSICMP 1 -#define HAVE__WCSNICMP 1 -#define HAVE__WCSDUP 1 -#define HAVE_ACOS 1 -#define HAVE_ASIN 1 -#define HAVE_ATAN 1 -#define HAVE_ATAN2 1 -#define HAVE_CEIL 1 -#define HAVE_COS 1 -#define HAVE_EXP 1 -#define HAVE_FABS 1 -#define HAVE_FLOOR 1 -#define HAVE_FMOD 1 -#define HAVE_LOG 1 -#define HAVE_LOG10 1 -#define HAVE_POW 1 -#define HAVE_SIN 1 -#define HAVE_SQRT 1 -#define HAVE_TAN 1 -#ifndef __WATCOMC__ -#define HAVE_ACOSF 1 -#define HAVE_ASINF 1 -#define HAVE_ATANF 1 -#define HAVE_ATAN2F 1 -#define HAVE_CEILF 1 -#define HAVE__COPYSIGN 1 -#define HAVE_COSF 1 -#define HAVE_EXPF 1 -#define HAVE_FABSF 1 -#define HAVE_FLOORF 1 -#define HAVE_FMODF 1 -#define HAVE_LOGF 1 -#define HAVE_LOG10F 1 -#define HAVE_POWF 1 -#define HAVE_SINF 1 -#define HAVE_SQRTF 1 -#define HAVE_TANF 1 -#endif -#if defined(_MSC_VER) -/* These functions were added with the VC++ 2013 C runtime library */ -#if _MSC_VER >= 1800 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_VSSCANF 1 -#define HAVE_LROUND 1 -#define HAVE_LROUNDF 1 -#define HAVE_ROUND 1 -#define HAVE_ROUNDF 1 -#define HAVE_SCALBN 1 -#define HAVE_SCALBNF 1 -#define HAVE_TRUNC 1 -#define HAVE_TRUNCF 1 -#endif -/* This function is available with at least the VC++ 2008 C runtime library */ -#if _MSC_VER >= 1400 -#define HAVE__FSEEKI64 1 -#endif -#ifdef _USE_MATH_DEFINES -#define HAVE_M_PI 1 -#endif -#elif defined(__WATCOMC__) -#define HAVE__FSEEKI64 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_VSSCANF 1 -#define HAVE_ROUND 1 -#define HAVE_SCALBN 1 -#define HAVE_TRUNC 1 -#else -#define HAVE_M_PI 1 -#endif +/** + * \file SDL_config.h + */ + +/* Add any platform that doesn't build using the configure system. */ +#if defined(__WIN32__) +#include "SDL_config_windows.h" +#elif defined(__WINRT__) +#include "SDL_config_winrt.h" +#elif defined(__WINGDK__) +#include "SDL_config_wingdk.h" +#elif defined(__XBOXONE__) || defined(__XBOXSERIES__) +#include "SDL_config_xbox.h" +#elif defined(__MACOSX__) +#include "SDL_config_macosx.h" +#elif defined(__IPHONEOS__) +#include "SDL_config_iphoneos.h" +#elif defined(__ANDROID__) +#include "SDL_config_android.h" +#elif defined(__OS2__) +#include "SDL_config_os2.h" +#elif defined(__EMSCRIPTEN__) +#include "SDL_config_emscripten.h" +#elif defined(__NGAGE__) +#include "SDL_config_ngage.h" #else -#define HAVE_STDARG_H 1 -#define HAVE_STDDEF_H 1 -#endif - -/* Enable various audio drivers */ -#if defined(HAVE_MMDEVICEAPI_H) && defined(HAVE_AUDIOCLIENT_H) -#define SDL_AUDIO_DRIVER_WASAPI 1 -#endif -#define SDL_AUDIO_DRIVER_DSOUND 1 -#define SDL_AUDIO_DRIVER_WINMM 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 +/* This is a minimal configuration just to get SDL running on new platforms. */ +#include "SDL_config_minimal.h" +#endif /* platform config */ -/* Enable various input drivers */ -#define SDL_JOYSTICK_DINPUT 1 -#define SDL_JOYSTICK_HIDAPI 1 -#ifndef __WINRT__ -#define SDL_JOYSTICK_RAWINPUT 1 +#ifdef USING_GENERATED_CONFIG_H +#error Wrong SDL_config.h, check your include path? #endif -#define SDL_JOYSTICK_VIRTUAL 1 -#ifdef HAVE_WINDOWS_GAMING_INPUT_H -#define SDL_JOYSTICK_WGI 1 -#endif -#define SDL_JOYSTICK_XINPUT 1 -#define SDL_HAPTIC_DINPUT 1 -#define SDL_HAPTIC_XINPUT 1 - -/* Enable the sensor driver */ -#ifdef HAVE_SENSORSAPI_H -#define SDL_SENSOR_WINDOWS 1 -#else -#define SDL_SENSOR_DUMMY 1 -#endif - -/* Enable various shared object loading systems */ -#define SDL_LOADSO_WINDOWS 1 - -/* Enable various threading systems */ -#define SDL_THREAD_GENERIC_COND_SUFFIX 1 -#define SDL_THREAD_WINDOWS 1 - -/* Enable various timer systems */ -#define SDL_TIMER_WINDOWS 1 - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_DUMMY 1 -#define SDL_VIDEO_DRIVER_WINDOWS 1 - -#ifndef SDL_VIDEO_RENDER_D3D -#define SDL_VIDEO_RENDER_D3D 1 -#endif -#if !defined(SDL_VIDEO_RENDER_D3D11) && defined(HAVE_D3D11_H) -#define SDL_VIDEO_RENDER_D3D11 1 -#endif -#if !defined(SDL_VIDEO_RENDER_D3D12) && defined(HAVE_D3D12_H) -#define SDL_VIDEO_RENDER_D3D12 1 -#endif - -/* Enable OpenGL support */ -#ifndef SDL_VIDEO_OPENGL -#define SDL_VIDEO_OPENGL 1 -#endif -#ifndef SDL_VIDEO_OPENGL_WGL -#define SDL_VIDEO_OPENGL_WGL 1 -#endif -#ifndef SDL_VIDEO_RENDER_OGL -#define SDL_VIDEO_RENDER_OGL 1 -#endif -#ifndef SDL_VIDEO_RENDER_OGL_ES2 -#define SDL_VIDEO_RENDER_OGL_ES2 1 -#endif -#ifndef SDL_VIDEO_OPENGL_ES2 -#define SDL_VIDEO_OPENGL_ES2 1 -#endif -#ifndef SDL_VIDEO_OPENGL_EGL -#define SDL_VIDEO_OPENGL_EGL 1 -#endif - -/* Enable Vulkan support */ -#define SDL_VIDEO_VULKAN 1 - -/* Enable system power support */ -#define SDL_POWER_WINDOWS 1 - -/* Enable filesystem support */ -#define SDL_FILESYSTEM_WINDOWS 1 - -#endif /* SDL_config_windows_h_ */ -/* vi: set ts=4 sw=4 expandtab: */ +#endif /* SDL_config_h_ */ diff --git a/extlibs/sdl2/include/SDL_config.h.cmake b/extlibs/sdl2/include/SDL_config.h.cmake new file mode 100644 index 000000000..ffcafd895 --- /dev/null +++ b/extlibs/sdl2/include/SDL_config.h.cmake @@ -0,0 +1,570 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_config_h_ +#define SDL_config_h_ + +/** + * \file SDL_config.h.in + * + * This is a set of defines to configure the SDL features + */ + +/* General platform specific identifiers */ +#include "SDL_platform.h" + +/* C language features */ +#cmakedefine const @HAVE_CONST@ +#cmakedefine inline @HAVE_INLINE@ +#cmakedefine volatile @HAVE_VOLATILE@ + +/* C datatypes */ +/* Define SIZEOF_VOIDP for 64/32 architectures */ +#if defined(__LP64__) || defined(_LP64) || defined(_WIN64) +#define SIZEOF_VOIDP 8 +#else +#define SIZEOF_VOIDP 4 +#endif + +#cmakedefine HAVE_GCC_ATOMICS @HAVE_GCC_ATOMICS@ +#cmakedefine HAVE_GCC_SYNC_LOCK_TEST_AND_SET @HAVE_GCC_SYNC_LOCK_TEST_AND_SET@ + +/* Comment this if you want to build without any C library requirements */ +#cmakedefine HAVE_LIBC 1 +#ifdef HAVE_LIBC + +/* Useful headers */ +#cmakedefine STDC_HEADERS 1 +#cmakedefine HAVE_ALLOCA_H 1 +#cmakedefine HAVE_CTYPE_H 1 +#cmakedefine HAVE_FLOAT_H 1 +#cmakedefine HAVE_ICONV_H 1 +#cmakedefine HAVE_INTTYPES_H 1 +#cmakedefine HAVE_LIMITS_H 1 +#cmakedefine HAVE_MALLOC_H 1 +#cmakedefine HAVE_MATH_H 1 +#cmakedefine HAVE_MEMORY_H 1 +#cmakedefine HAVE_SIGNAL_H 1 +#cmakedefine HAVE_STDARG_H 1 +#cmakedefine HAVE_STDDEF_H 1 +#cmakedefine HAVE_STDINT_H 1 +#cmakedefine HAVE_STDIO_H 1 +#cmakedefine HAVE_STDLIB_H 1 +#cmakedefine HAVE_STRINGS_H 1 +#cmakedefine HAVE_STRING_H 1 +#cmakedefine HAVE_SYS_TYPES_H 1 +#cmakedefine HAVE_WCHAR_H 1 +#cmakedefine HAVE_LINUX_INPUT_H 1 +#cmakedefine HAVE_PTHREAD_NP_H 1 +#cmakedefine HAVE_LIBUNWIND_H 1 + +/* C library functions */ +#cmakedefine HAVE_DLOPEN 1 +#cmakedefine HAVE_MALLOC 1 +#cmakedefine HAVE_CALLOC 1 +#cmakedefine HAVE_REALLOC 1 +#cmakedefine HAVE_FREE 1 +#cmakedefine HAVE_ALLOCA 1 +#ifndef __WIN32__ /* Don't use C runtime versions of these on Windows */ +#cmakedefine HAVE_GETENV 1 +#cmakedefine HAVE_SETENV 1 +#cmakedefine HAVE_PUTENV 1 +#cmakedefine HAVE_UNSETENV 1 +#endif +#cmakedefine HAVE_QSORT 1 +#cmakedefine HAVE_BSEARCH 1 +#cmakedefine HAVE_ABS 1 +#cmakedefine HAVE_BCOPY 1 +#cmakedefine HAVE_MEMSET 1 +#cmakedefine HAVE_MEMCPY 1 +#cmakedefine HAVE_MEMMOVE 1 +#cmakedefine HAVE_MEMCMP 1 +#cmakedefine HAVE_WCSLEN 1 +#cmakedefine HAVE_WCSLCPY 1 +#cmakedefine HAVE_WCSLCAT 1 +#cmakedefine HAVE__WCSDUP 1 +#cmakedefine HAVE_WCSDUP 1 +#cmakedefine HAVE_WCSSTR 1 +#cmakedefine HAVE_WCSCMP 1 +#cmakedefine HAVE_WCSNCMP 1 +#cmakedefine HAVE_WCSCASECMP 1 +#cmakedefine HAVE__WCSICMP 1 +#cmakedefine HAVE_WCSNCASECMP 1 +#cmakedefine HAVE__WCSNICMP 1 +#cmakedefine HAVE_STRLEN 1 +#cmakedefine HAVE_STRLCPY 1 +#cmakedefine HAVE_STRLCAT 1 +#cmakedefine HAVE__STRREV 1 +#cmakedefine HAVE__STRUPR 1 +#cmakedefine HAVE__STRLWR 1 +#cmakedefine HAVE_INDEX 1 +#cmakedefine HAVE_RINDEX 1 +#cmakedefine HAVE_STRCHR 1 +#cmakedefine HAVE_STRRCHR 1 +#cmakedefine HAVE_STRSTR 1 +#cmakedefine HAVE_STRTOK_R 1 +#cmakedefine HAVE_ITOA 1 +#cmakedefine HAVE__LTOA 1 +#cmakedefine HAVE__UITOA 1 +#cmakedefine HAVE__ULTOA 1 +#cmakedefine HAVE_STRTOL 1 +#cmakedefine HAVE_STRTOUL 1 +#cmakedefine HAVE__I64TOA 1 +#cmakedefine HAVE__UI64TOA 1 +#cmakedefine HAVE_STRTOLL 1 +#cmakedefine HAVE_STRTOULL 1 +#cmakedefine HAVE_STRTOD 1 +#cmakedefine HAVE_ATOI 1 +#cmakedefine HAVE_ATOF 1 +#cmakedefine HAVE_STRCMP 1 +#cmakedefine HAVE_STRNCMP 1 +#cmakedefine HAVE__STRICMP 1 +#cmakedefine HAVE_STRCASECMP 1 +#cmakedefine HAVE__STRNICMP 1 +#cmakedefine HAVE_STRNCASECMP 1 +#cmakedefine HAVE_STRCASESTR 1 +#cmakedefine HAVE_SSCANF 1 +#cmakedefine HAVE_VSSCANF 1 +#cmakedefine HAVE_VSNPRINTF 1 +#cmakedefine HAVE_M_PI 1 +#cmakedefine HAVE_ACOS 1 +#cmakedefine HAVE_ACOSF 1 +#cmakedefine HAVE_ASIN 1 +#cmakedefine HAVE_ASINF 1 +#cmakedefine HAVE_ATAN 1 +#cmakedefine HAVE_ATANF 1 +#cmakedefine HAVE_ATAN2 1 +#cmakedefine HAVE_ATAN2F 1 +#cmakedefine HAVE_CEIL 1 +#cmakedefine HAVE_CEILF 1 +#cmakedefine HAVE_COPYSIGN 1 +#cmakedefine HAVE_COPYSIGNF 1 +#cmakedefine HAVE_COS 1 +#cmakedefine HAVE_COSF 1 +#cmakedefine HAVE_EXP 1 +#cmakedefine HAVE_EXPF 1 +#cmakedefine HAVE_FABS 1 +#cmakedefine HAVE_FABSF 1 +#cmakedefine HAVE_FLOOR 1 +#cmakedefine HAVE_FLOORF 1 +#cmakedefine HAVE_FMOD 1 +#cmakedefine HAVE_FMODF 1 +#cmakedefine HAVE_LOG 1 +#cmakedefine HAVE_LOGF 1 +#cmakedefine HAVE_LOG10 1 +#cmakedefine HAVE_LOG10F 1 +#cmakedefine HAVE_LROUND 1 +#cmakedefine HAVE_LROUNDF 1 +#cmakedefine HAVE_POW 1 +#cmakedefine HAVE_POWF 1 +#cmakedefine HAVE_ROUND 1 +#cmakedefine HAVE_ROUNDF 1 +#cmakedefine HAVE_SCALBN 1 +#cmakedefine HAVE_SCALBNF 1 +#cmakedefine HAVE_SIN 1 +#cmakedefine HAVE_SINF 1 +#cmakedefine HAVE_SQRT 1 +#cmakedefine HAVE_SQRTF 1 +#cmakedefine HAVE_TAN 1 +#cmakedefine HAVE_TANF 1 +#cmakedefine HAVE_TRUNC 1 +#cmakedefine HAVE_TRUNCF 1 +#cmakedefine HAVE_FOPEN64 1 +#cmakedefine HAVE_FSEEKO 1 +#cmakedefine HAVE_FSEEKO64 1 +#cmakedefine HAVE_MEMFD_CREATE 1 +#cmakedefine HAVE_POSIX_FALLOCATE 1 +#cmakedefine HAVE_SIGACTION 1 +#cmakedefine HAVE_SA_SIGACTION 1 +#cmakedefine HAVE_SETJMP 1 +#cmakedefine HAVE_NANOSLEEP 1 +#cmakedefine HAVE_SYSCONF 1 +#cmakedefine HAVE_SYSCTLBYNAME 1 +#cmakedefine HAVE_CLOCK_GETTIME 1 +#cmakedefine HAVE_GETPAGESIZE 1 +#cmakedefine HAVE_MPROTECT 1 +#cmakedefine HAVE_ICONV 1 +#cmakedefine SDL_USE_LIBICONV 1 +#cmakedefine HAVE_PTHREAD_SETNAME_NP 1 +#cmakedefine HAVE_PTHREAD_SET_NAME_NP 1 +#cmakedefine HAVE_SEM_TIMEDWAIT 1 +#cmakedefine HAVE_GETAUXVAL 1 +#cmakedefine HAVE_ELF_AUX_INFO 1 +#cmakedefine HAVE_POLL 1 +#cmakedefine HAVE__EXIT 1 + +#else +#cmakedefine HAVE_STDARG_H 1 +#cmakedefine HAVE_STDDEF_H 1 +#cmakedefine HAVE_STDINT_H 1 +#cmakedefine HAVE_FLOAT_H 1 +#endif /* HAVE_LIBC */ + +#cmakedefine HAVE_ALTIVEC_H 1 +#cmakedefine HAVE_DBUS_DBUS_H 1 +#cmakedefine HAVE_FCITX 1 +#cmakedefine HAVE_IBUS_IBUS_H 1 +#cmakedefine HAVE_SYS_INOTIFY_H 1 +#cmakedefine HAVE_INOTIFY_INIT 1 +#cmakedefine HAVE_INOTIFY_INIT1 1 +#cmakedefine HAVE_INOTIFY 1 +#cmakedefine HAVE_LIBUSB 1 +#cmakedefine HAVE_O_CLOEXEC 1 + +/* Apple platforms might be building universal binaries, where Intel builds + can use immintrin.h but other architectures can't. */ +#ifdef __APPLE__ +# if defined(__has_include) && (defined(__i386__) || defined(__x86_64)) +# if __has_include() +# define HAVE_IMMINTRIN_H 1 +# endif +# endif +#else /* non-Apple platforms can use the normal CMake check for this. */ +#cmakedefine HAVE_IMMINTRIN_H 1 +#endif + +#cmakedefine HAVE_LIBUDEV_H 1 +#cmakedefine HAVE_LIBSAMPLERATE_H 1 +#cmakedefine HAVE_LIBDECOR_H 1 + +#cmakedefine HAVE_D3D_H @HAVE_D3D_H@ +#cmakedefine HAVE_D3D11_H @HAVE_D3D11_H@ +#cmakedefine HAVE_D3D12_H @HAVE_D3D12_H@ +#cmakedefine HAVE_DDRAW_H @HAVE_DDRAW_H@ +#cmakedefine HAVE_DSOUND_H @HAVE_DSOUND_H@ +#cmakedefine HAVE_DINPUT_H @HAVE_DINPUT_H@ +#cmakedefine HAVE_XINPUT_H @HAVE_XINPUT_H@ +#cmakedefine HAVE_WINDOWS_GAMING_INPUT_H @HAVE_WINDOWS_GAMING_INPUT_H@ +#cmakedefine HAVE_DXGI_H @HAVE_DXGI_H@ + +#cmakedefine HAVE_MMDEVICEAPI_H @HAVE_MMDEVICEAPI_H@ +#cmakedefine HAVE_AUDIOCLIENT_H @HAVE_AUDIOCLIENT_H@ +#cmakedefine HAVE_TPCSHRD_H @HAVE_TPCSHRD_H@ +#cmakedefine HAVE_SENSORSAPI_H @HAVE_SENSORSAPI_H@ +#cmakedefine HAVE_ROAPI_H @HAVE_ROAPI_H@ +#cmakedefine HAVE_SHELLSCALINGAPI_H @HAVE_SHELLSCALINGAPI_H@ + +#cmakedefine USE_POSIX_SPAWN @USE_POSIX_SPAWN@ + +/* SDL internal assertion support */ +#if @SDL_DEFAULT_ASSERT_LEVEL_CONFIGURED@ +#cmakedefine SDL_DEFAULT_ASSERT_LEVEL @SDL_DEFAULT_ASSERT_LEVEL@ +#endif + +/* Allow disabling of core subsystems */ +#cmakedefine SDL_ATOMIC_DISABLED @SDL_ATOMIC_DISABLED@ +#cmakedefine SDL_AUDIO_DISABLED @SDL_AUDIO_DISABLED@ +#cmakedefine SDL_CPUINFO_DISABLED @SDL_CPUINFO_DISABLED@ +#cmakedefine SDL_EVENTS_DISABLED @SDL_EVENTS_DISABLED@ +#cmakedefine SDL_FILE_DISABLED @SDL_FILE_DISABLED@ +#cmakedefine SDL_JOYSTICK_DISABLED @SDL_JOYSTICK_DISABLED@ +#cmakedefine SDL_HAPTIC_DISABLED @SDL_HAPTIC_DISABLED@ +#cmakedefine SDL_HIDAPI_DISABLED @SDL_HIDAPI_DISABLED@ +#cmakedefine SDL_SENSOR_DISABLED @SDL_SENSOR_DISABLED@ +#cmakedefine SDL_LOADSO_DISABLED @SDL_LOADSO_DISABLED@ +#cmakedefine SDL_RENDER_DISABLED @SDL_RENDER_DISABLED@ +#cmakedefine SDL_THREADS_DISABLED @SDL_THREADS_DISABLED@ +#cmakedefine SDL_TIMERS_DISABLED @SDL_TIMERS_DISABLED@ +#cmakedefine SDL_VIDEO_DISABLED @SDL_VIDEO_DISABLED@ +#cmakedefine SDL_POWER_DISABLED @SDL_POWER_DISABLED@ +#cmakedefine SDL_FILESYSTEM_DISABLED @SDL_FILESYSTEM_DISABLED@ +#cmakedefine SDL_LOCALE_DISABLED @SDL_LOCALE_DISABLED@ +#cmakedefine SDL_MISC_DISABLED @SDL_MISC_DISABLED@ + +/* Enable various audio drivers */ +#cmakedefine SDL_AUDIO_DRIVER_ALSA @SDL_AUDIO_DRIVER_ALSA@ +#cmakedefine SDL_AUDIO_DRIVER_ALSA_DYNAMIC @SDL_AUDIO_DRIVER_ALSA_DYNAMIC@ +#cmakedefine SDL_AUDIO_DRIVER_ANDROID @SDL_AUDIO_DRIVER_ANDROID@ +#cmakedefine SDL_AUDIO_DRIVER_OPENSLES @SDL_AUDIO_DRIVER_OPENSLES@ +#cmakedefine SDL_AUDIO_DRIVER_AAUDIO @SDL_AUDIO_DRIVER_AAUDIO@ +#cmakedefine SDL_AUDIO_DRIVER_ARTS @SDL_AUDIO_DRIVER_ARTS@ +#cmakedefine SDL_AUDIO_DRIVER_ARTS_DYNAMIC @SDL_AUDIO_DRIVER_ARTS_DYNAMIC@ +#cmakedefine SDL_AUDIO_DRIVER_COREAUDIO @SDL_AUDIO_DRIVER_COREAUDIO@ +#cmakedefine SDL_AUDIO_DRIVER_DISK @SDL_AUDIO_DRIVER_DISK@ +#cmakedefine SDL_AUDIO_DRIVER_DSOUND @SDL_AUDIO_DRIVER_DSOUND@ +#cmakedefine SDL_AUDIO_DRIVER_DUMMY @SDL_AUDIO_DRIVER_DUMMY@ +#cmakedefine SDL_AUDIO_DRIVER_EMSCRIPTEN @SDL_AUDIO_DRIVER_EMSCRIPTEN@ +#cmakedefine SDL_AUDIO_DRIVER_ESD @SDL_AUDIO_DRIVER_ESD@ +#cmakedefine SDL_AUDIO_DRIVER_ESD_DYNAMIC @SDL_AUDIO_DRIVER_ESD_DYNAMIC@ +#cmakedefine SDL_AUDIO_DRIVER_FUSIONSOUND @SDL_AUDIO_DRIVER_FUSIONSOUND@ +#cmakedefine SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC @SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC@ +#cmakedefine SDL_AUDIO_DRIVER_HAIKU @SDL_AUDIO_DRIVER_HAIKU@ +#cmakedefine SDL_AUDIO_DRIVER_JACK @SDL_AUDIO_DRIVER_JACK@ +#cmakedefine SDL_AUDIO_DRIVER_JACK_DYNAMIC @SDL_AUDIO_DRIVER_JACK_DYNAMIC@ +#cmakedefine SDL_AUDIO_DRIVER_NAS @SDL_AUDIO_DRIVER_NAS@ +#cmakedefine SDL_AUDIO_DRIVER_NAS_DYNAMIC @SDL_AUDIO_DRIVER_NAS_DYNAMIC@ +#cmakedefine SDL_AUDIO_DRIVER_NETBSD @SDL_AUDIO_DRIVER_NETBSD@ +#cmakedefine SDL_AUDIO_DRIVER_OSS @SDL_AUDIO_DRIVER_OSS@ +#cmakedefine SDL_AUDIO_DRIVER_PAUDIO @SDL_AUDIO_DRIVER_PAUDIO@ +#cmakedefine SDL_AUDIO_DRIVER_PIPEWIRE @SDL_AUDIO_DRIVER_PIPEWIRE@ +#cmakedefine SDL_AUDIO_DRIVER_PIPEWIRE_DYNAMIC @SDL_AUDIO_DRIVER_PIPEWIRE_DYNAMIC@ +#cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO @SDL_AUDIO_DRIVER_PULSEAUDIO@ +#cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC @SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC@ +#cmakedefine SDL_AUDIO_DRIVER_QSA @SDL_AUDIO_DRIVER_QSA@ +#cmakedefine SDL_AUDIO_DRIVER_SNDIO @SDL_AUDIO_DRIVER_SNDIO@ +#cmakedefine SDL_AUDIO_DRIVER_SNDIO_DYNAMIC @SDL_AUDIO_DRIVER_SNDIO_DYNAMIC@ +#cmakedefine SDL_AUDIO_DRIVER_SUNAUDIO @SDL_AUDIO_DRIVER_SUNAUDIO@ +#cmakedefine SDL_AUDIO_DRIVER_WASAPI @SDL_AUDIO_DRIVER_WASAPI@ +#cmakedefine SDL_AUDIO_DRIVER_WINMM @SDL_AUDIO_DRIVER_WINMM@ +#cmakedefine SDL_AUDIO_DRIVER_OS2 @SDL_AUDIO_DRIVER_OS2@ +#cmakedefine SDL_AUDIO_DRIVER_VITA @SDL_AUDIO_DRIVER_VITA@ +#cmakedefine SDL_AUDIO_DRIVER_PSP @SDL_AUDIO_DRIVER_PSP@ +#cmakedefine SDL_AUDIO_DRIVER_PS2 @SDL_AUDIO_DRIVER_PS2@ +#cmakedefine SDL_AUDIO_DRIVER_N3DS @SDL_AUDIO_DRIVER_N3DS@ + +/* Enable various input drivers */ +#cmakedefine SDL_INPUT_LINUXEV @SDL_INPUT_LINUXEV@ +#cmakedefine SDL_INPUT_LINUXKD @SDL_INPUT_LINUXKD@ +#cmakedefine SDL_INPUT_FBSDKBIO @SDL_INPUT_FBSDKBIO@ +#cmakedefine SDL_INPUT_WSCONS @SDL_INPUT_WSCONS@ +#cmakedefine SDL_JOYSTICK_ANDROID @SDL_JOYSTICK_ANDROID@ +#cmakedefine SDL_JOYSTICK_HAIKU @SDL_JOYSTICK_HAIKU@ +#cmakedefine SDL_JOYSTICK_WGI @SDL_JOYSTICK_WGI@ +#cmakedefine SDL_JOYSTICK_DINPUT @SDL_JOYSTICK_DINPUT@ +#cmakedefine SDL_JOYSTICK_XINPUT @SDL_JOYSTICK_XINPUT@ +#cmakedefine SDL_JOYSTICK_DUMMY @SDL_JOYSTICK_DUMMY@ +#cmakedefine SDL_JOYSTICK_IOKIT @SDL_JOYSTICK_IOKIT@ +#cmakedefine SDL_JOYSTICK_MFI @SDL_JOYSTICK_MFI@ +#cmakedefine SDL_JOYSTICK_LINUX @SDL_JOYSTICK_LINUX@ +#cmakedefine SDL_JOYSTICK_OS2 @SDL_JOYSTICK_OS2@ +#cmakedefine SDL_JOYSTICK_USBHID @SDL_JOYSTICK_USBHID@ +#cmakedefine SDL_HAVE_MACHINE_JOYSTICK_H @SDL_HAVE_MACHINE_JOYSTICK_H@ +#cmakedefine SDL_JOYSTICK_HIDAPI @SDL_JOYSTICK_HIDAPI@ +#cmakedefine SDL_JOYSTICK_RAWINPUT @SDL_JOYSTICK_RAWINPUT@ +#cmakedefine SDL_JOYSTICK_EMSCRIPTEN @SDL_JOYSTICK_EMSCRIPTEN@ +#cmakedefine SDL_JOYSTICK_VIRTUAL @SDL_JOYSTICK_VIRTUAL@ +#cmakedefine SDL_JOYSTICK_VITA @SDL_JOYSTICK_VITA@ +#cmakedefine SDL_JOYSTICK_PSP @SDL_JOYSTICK_PSP@ +#cmakedefine SDL_JOYSTICK_PS2 @SDL_JOYSTICK_PS2@ +#cmakedefine SDL_JOYSTICK_N3DS @SDL_JOYSTICK_N3DS@ +#cmakedefine SDL_HAPTIC_DUMMY @SDL_HAPTIC_DUMMY@ +#cmakedefine SDL_HAPTIC_LINUX @SDL_HAPTIC_LINUX@ +#cmakedefine SDL_HAPTIC_IOKIT @SDL_HAPTIC_IOKIT@ +#cmakedefine SDL_HAPTIC_DINPUT @SDL_HAPTIC_DINPUT@ +#cmakedefine SDL_HAPTIC_XINPUT @SDL_HAPTIC_XINPUT@ +#cmakedefine SDL_HAPTIC_ANDROID @SDL_HAPTIC_ANDROID@ +#cmakedefine SDL_LIBUSB_DYNAMIC @SDL_LIBUSB_DYNAMIC@ +#cmakedefine SDL_UDEV_DYNAMIC @SDL_UDEV_DYNAMIC@ + +/* Enable various sensor drivers */ +#cmakedefine SDL_SENSOR_ANDROID @SDL_SENSOR_ANDROID@ +#cmakedefine SDL_SENSOR_COREMOTION @SDL_SENSOR_COREMOTION@ +#cmakedefine SDL_SENSOR_WINDOWS @SDL_SENSOR_WINDOWS@ +#cmakedefine SDL_SENSOR_DUMMY @SDL_SENSOR_DUMMY@ +#cmakedefine SDL_SENSOR_VITA @SDL_SENSOR_VITA@ +#cmakedefine SDL_SENSOR_N3DS @SDL_SENSOR_N3DS@ + +/* Enable various shared object loading systems */ +#cmakedefine SDL_LOADSO_DLOPEN @SDL_LOADSO_DLOPEN@ +#cmakedefine SDL_LOADSO_DUMMY @SDL_LOADSO_DUMMY@ +#cmakedefine SDL_LOADSO_LDG @SDL_LOADSO_LDG@ +#cmakedefine SDL_LOADSO_WINDOWS @SDL_LOADSO_WINDOWS@ +#cmakedefine SDL_LOADSO_OS2 @SDL_LOADSO_OS2@ + +/* Enable various threading systems */ +#cmakedefine SDL_THREAD_GENERIC_COND_SUFFIX @SDL_THREAD_GENERIC_COND_SUFFIX@ +#cmakedefine SDL_THREAD_PTHREAD @SDL_THREAD_PTHREAD@ +#cmakedefine SDL_THREAD_PTHREAD_RECURSIVE_MUTEX @SDL_THREAD_PTHREAD_RECURSIVE_MUTEX@ +#cmakedefine SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP @SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP@ +#cmakedefine SDL_THREAD_WINDOWS @SDL_THREAD_WINDOWS@ +#cmakedefine SDL_THREAD_OS2 @SDL_THREAD_OS2@ +#cmakedefine SDL_THREAD_VITA @SDL_THREAD_VITA@ +#cmakedefine SDL_THREAD_PSP @SDL_THREAD_PSP@ +#cmakedefine SDL_THREAD_PS2 @SDL_THREAD_PS2@ +#cmakedefine SDL_THREAD_N3DS @SDL_THREAD_N3DS@ + +/* Enable various timer systems */ +#cmakedefine SDL_TIMER_HAIKU @SDL_TIMER_HAIKU@ +#cmakedefine SDL_TIMER_DUMMY @SDL_TIMER_DUMMY@ +#cmakedefine SDL_TIMER_UNIX @SDL_TIMER_UNIX@ +#cmakedefine SDL_TIMER_WINDOWS @SDL_TIMER_WINDOWS@ +#cmakedefine SDL_TIMER_OS2 @SDL_TIMER_OS2@ +#cmakedefine SDL_TIMER_VITA @SDL_TIMER_VITA@ +#cmakedefine SDL_TIMER_PSP @SDL_TIMER_PSP@ +#cmakedefine SDL_TIMER_PS2 @SDL_TIMER_PS2@ +#cmakedefine SDL_TIMER_N3DS @SDL_TIMER_N3DS@ + +/* Enable various video drivers */ +#cmakedefine SDL_VIDEO_DRIVER_ANDROID @SDL_VIDEO_DRIVER_ANDROID@ +#cmakedefine SDL_VIDEO_DRIVER_EMSCRIPTEN @SDL_VIDEO_DRIVER_EMSCRIPTEN@ +#cmakedefine SDL_VIDEO_DRIVER_HAIKU @SDL_VIDEO_DRIVER_HAIKU@ +#cmakedefine SDL_VIDEO_DRIVER_COCOA @SDL_VIDEO_DRIVER_COCOA@ +#cmakedefine SDL_VIDEO_DRIVER_UIKIT @SDL_VIDEO_DRIVER_UIKIT@ +#cmakedefine SDL_VIDEO_DRIVER_DIRECTFB @SDL_VIDEO_DRIVER_DIRECTFB@ +#cmakedefine SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC @SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC@ +#cmakedefine SDL_VIDEO_DRIVER_DUMMY @SDL_VIDEO_DRIVER_DUMMY@ +#cmakedefine SDL_VIDEO_DRIVER_OFFSCREEN @SDL_VIDEO_DRIVER_OFFSCREEN@ +#cmakedefine SDL_VIDEO_DRIVER_WINDOWS @SDL_VIDEO_DRIVER_WINDOWS@ +#cmakedefine SDL_VIDEO_DRIVER_WINRT @SDL_VIDEO_DRIVER_WINRT@ +#cmakedefine SDL_VIDEO_DRIVER_WAYLAND @SDL_VIDEO_DRIVER_WAYLAND@ +#cmakedefine SDL_VIDEO_DRIVER_RPI @SDL_VIDEO_DRIVER_RPI@ +#cmakedefine SDL_VIDEO_DRIVER_VIVANTE @SDL_VIDEO_DRIVER_VIVANTE@ +#cmakedefine SDL_VIDEO_DRIVER_VIVANTE_VDK @SDL_VIDEO_DRIVER_VIVANTE_VDK@ +#cmakedefine SDL_VIDEO_DRIVER_OS2 @SDL_VIDEO_DRIVER_OS2@ +#cmakedefine SDL_VIDEO_DRIVER_QNX @SDL_VIDEO_DRIVER_QNX@ +#cmakedefine SDL_VIDEO_DRIVER_RISCOS @SDL_VIDEO_DRIVER_RISCOS@ +#cmakedefine SDL_VIDEO_DRIVER_PSP @SDL_VIDEO_DRIVER_PSP@ +#cmakedefine SDL_VIDEO_DRIVER_PS2 @SDL_VIDEO_DRIVER_PS2@ + +#cmakedefine SDL_VIDEO_DRIVER_KMSDRM @SDL_VIDEO_DRIVER_KMSDRM@ +#cmakedefine SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC @SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC@ +#cmakedefine SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM @SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM@ + +#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH @SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH@ +#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC@ +#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL@ +#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR@ +#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON@ +#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR@ + +#cmakedefine SDL_VIDEO_DRIVER_X11 @SDL_VIDEO_DRIVER_X11@ +#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC @SDL_VIDEO_DRIVER_X11_DYNAMIC@ +#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT @SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT@ +#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR @SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR@ +#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 @SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2@ +#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XFIXES @SDL_VIDEO_DRIVER_X11_DYNAMIC_XFIXES@ +#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR @SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR@ +#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS @SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XCURSOR @SDL_VIDEO_DRIVER_X11_XCURSOR@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XDBE @SDL_VIDEO_DRIVER_X11_XDBE@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XINPUT2 @SDL_VIDEO_DRIVER_X11_XINPUT2@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH @SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XFIXES @SDL_VIDEO_DRIVER_X11_XFIXES@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XRANDR @SDL_VIDEO_DRIVER_X11_XRANDR@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XSCRNSAVER @SDL_VIDEO_DRIVER_X11_XSCRNSAVER@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XSHAPE @SDL_VIDEO_DRIVER_X11_XSHAPE@ +#cmakedefine SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS @SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS@ +#cmakedefine SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM @SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM@ +#cmakedefine SDL_VIDEO_DRIVER_VITA @SDL_VIDEO_DRIVER_VITA@ +#cmakedefine SDL_VIDEO_DRIVER_N3DS @SDL_VIDEO_DRIVER_N3DS@ + +#cmakedefine SDL_VIDEO_RENDER_D3D @SDL_VIDEO_RENDER_D3D@ +#cmakedefine SDL_VIDEO_RENDER_D3D11 @SDL_VIDEO_RENDER_D3D11@ +#cmakedefine SDL_VIDEO_RENDER_D3D12 @SDL_VIDEO_RENDER_D3D12@ +#cmakedefine SDL_VIDEO_RENDER_OGL @SDL_VIDEO_RENDER_OGL@ +#cmakedefine SDL_VIDEO_RENDER_OGL_ES @SDL_VIDEO_RENDER_OGL_ES@ +#cmakedefine SDL_VIDEO_RENDER_OGL_ES2 @SDL_VIDEO_RENDER_OGL_ES2@ +#cmakedefine SDL_VIDEO_RENDER_DIRECTFB @SDL_VIDEO_RENDER_DIRECTFB@ +#cmakedefine SDL_VIDEO_RENDER_METAL @SDL_VIDEO_RENDER_METAL@ +#cmakedefine SDL_VIDEO_RENDER_VITA_GXM @SDL_VIDEO_RENDER_VITA_GXM@ +#cmakedefine SDL_VIDEO_RENDER_PS2 @SDL_VIDEO_RENDER_PS2@ +#cmakedefine SDL_VIDEO_RENDER_PSP @SDL_VIDEO_RENDER_PSP@ + +/* Enable OpenGL support */ +#cmakedefine SDL_VIDEO_OPENGL @SDL_VIDEO_OPENGL@ +#cmakedefine SDL_VIDEO_OPENGL_ES @SDL_VIDEO_OPENGL_ES@ +#cmakedefine SDL_VIDEO_OPENGL_ES2 @SDL_VIDEO_OPENGL_ES2@ +#cmakedefine SDL_VIDEO_OPENGL_BGL @SDL_VIDEO_OPENGL_BGL@ +#cmakedefine SDL_VIDEO_OPENGL_CGL @SDL_VIDEO_OPENGL_CGL@ +#cmakedefine SDL_VIDEO_OPENGL_GLX @SDL_VIDEO_OPENGL_GLX@ +#cmakedefine SDL_VIDEO_OPENGL_WGL @SDL_VIDEO_OPENGL_WGL@ +#cmakedefine SDL_VIDEO_OPENGL_EGL @SDL_VIDEO_OPENGL_EGL@ +#cmakedefine SDL_VIDEO_OPENGL_OSMESA @SDL_VIDEO_OPENGL_OSMESA@ +#cmakedefine SDL_VIDEO_OPENGL_OSMESA_DYNAMIC @SDL_VIDEO_OPENGL_OSMESA_DYNAMIC@ + +/* Enable Vulkan support */ +#cmakedefine SDL_VIDEO_VULKAN @SDL_VIDEO_VULKAN@ + +/* Enable Metal support */ +#cmakedefine SDL_VIDEO_METAL @SDL_VIDEO_METAL@ + +/* Enable system power support */ +#cmakedefine SDL_POWER_ANDROID @SDL_POWER_ANDROID@ +#cmakedefine SDL_POWER_LINUX @SDL_POWER_LINUX@ +#cmakedefine SDL_POWER_WINDOWS @SDL_POWER_WINDOWS@ +#cmakedefine SDL_POWER_WINRT @SDL_POWER_WINRT@ +#cmakedefine SDL_POWER_MACOSX @SDL_POWER_MACOSX@ +#cmakedefine SDL_POWER_UIKIT @SDL_POWER_UIKIT@ +#cmakedefine SDL_POWER_HAIKU @SDL_POWER_HAIKU@ +#cmakedefine SDL_POWER_EMSCRIPTEN @SDL_POWER_EMSCRIPTEN@ +#cmakedefine SDL_POWER_HARDWIRED @SDL_POWER_HARDWIRED@ +#cmakedefine SDL_POWER_VITA @SDL_POWER_VITA@ +#cmakedefine SDL_POWER_PSP @SDL_POWER_PSP@ +#cmakedefine SDL_POWER_N3DS @SDL_POWER_N3DS@ + +/* Enable system filesystem support */ +#cmakedefine SDL_FILESYSTEM_ANDROID @SDL_FILESYSTEM_ANDROID@ +#cmakedefine SDL_FILESYSTEM_HAIKU @SDL_FILESYSTEM_HAIKU@ +#cmakedefine SDL_FILESYSTEM_COCOA @SDL_FILESYSTEM_COCOA@ +#cmakedefine SDL_FILESYSTEM_DUMMY @SDL_FILESYSTEM_DUMMY@ +#cmakedefine SDL_FILESYSTEM_RISCOS @SDL_FILESYSTEM_RISCOS@ +#cmakedefine SDL_FILESYSTEM_UNIX @SDL_FILESYSTEM_UNIX@ +#cmakedefine SDL_FILESYSTEM_WINDOWS @SDL_FILESYSTEM_WINDOWS@ +#cmakedefine SDL_FILESYSTEM_EMSCRIPTEN @SDL_FILESYSTEM_EMSCRIPTEN@ +#cmakedefine SDL_FILESYSTEM_OS2 @SDL_FILESYSTEM_OS2@ +#cmakedefine SDL_FILESYSTEM_VITA @SDL_FILESYSTEM_VITA@ +#cmakedefine SDL_FILESYSTEM_PSP @SDL_FILESYSTEM_PSP@ +#cmakedefine SDL_FILESYSTEM_PS2 @SDL_FILESYSTEM_PS2@ +#cmakedefine SDL_FILESYSTEM_N3DS @SDL_FILESYSTEM_N3DS@ + +/* Enable misc subsystem */ +#cmakedefine SDL_MISC_DUMMY @SDL_MISC_DUMMY@ + +/* Enable locale subsystem */ +#cmakedefine SDL_LOCALE_DUMMY @SDL_LOCALE_DUMMY@ + +/* Enable assembly routines */ +#cmakedefine SDL_ALTIVEC_BLITTERS @SDL_ALTIVEC_BLITTERS@ +#cmakedefine SDL_ARM_SIMD_BLITTERS @SDL_ARM_SIMD_BLITTERS@ +#cmakedefine SDL_ARM_NEON_BLITTERS @SDL_ARM_NEON_BLITTERS@ + +/* Whether SDL_DYNAMIC_API needs dlopen */ +#cmakedefine DYNAPI_NEEDS_DLOPEN @DYNAPI_NEEDS_DLOPEN@ + +/* Enable dynamic libsamplerate support */ +#cmakedefine SDL_LIBSAMPLERATE_DYNAMIC @SDL_LIBSAMPLERATE_DYNAMIC@ + +/* Enable ime support */ +#cmakedefine SDL_USE_IME @SDL_USE_IME@ + +/* Platform specific definitions */ +#cmakedefine SDL_IPHONE_KEYBOARD @SDL_IPHONE_KEYBOARD@ +#cmakedefine SDL_IPHONE_LAUNCHSCREEN @SDL_IPHONE_LAUNCHSCREEN@ + +#cmakedefine SDL_VIDEO_VITA_PIB @SDL_VIDEO_VITA_PIB@ +#cmakedefine SDL_VIDEO_VITA_PVR @SDL_VIDEO_VITA_PVR@ +#cmakedefine SDL_VIDEO_VITA_PVR_OGL @SDL_VIDEO_VITA_PVR_OGL@ + +#cmakedefine SDL_HAVE_LIBDECOR_GET_MIN_MAX @SDL_HAVE_LIBDECOR_GET_MIN_MAX@ + +#if !defined(HAVE_STDINT_H) && !defined(_STDINT_H_) +/* Most everything except Visual Studio 2008 and earlier has stdint.h now */ +#if defined(_MSC_VER) && (_MSC_VER < 1600) +typedef signed __int8 int8_t; +typedef unsigned __int8 uint8_t; +typedef signed __int16 int16_t; +typedef unsigned __int16 uint16_t; +typedef signed __int32 int32_t; +typedef unsigned __int32 uint32_t; +typedef signed __int64 int64_t; +typedef unsigned __int64 uint64_t; +#ifndef _UINTPTR_T_DEFINED +#ifdef _WIN64 +typedef unsigned __int64 uintptr_t; +#else +typedef unsigned int uintptr_t; +#endif +#define _UINTPTR_T_DEFINED +#endif +#endif /* Visual Studio 2008 */ +#endif /* !_STDINT_H_ && !HAVE_STDINT_H */ + +#endif /* SDL_config_h_ */ diff --git a/extlibs/sdl2/include/SDL_config.h.in b/extlibs/sdl2/include/SDL_config.h.in new file mode 100644 index 000000000..f5dd166ff --- /dev/null +++ b/extlibs/sdl2/include/SDL_config.h.in @@ -0,0 +1,498 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_config_h_ +#define SDL_config_h_ + +/** + * \file SDL_config.h.in + * + * This is a set of defines to configure the SDL features + */ + +/* General platform specific identifiers */ +#include "SDL_platform.h" + +/* Make sure that this isn't included by Visual C++ */ +#ifdef _MSC_VER +#error You should run git checkout -f include/SDL_config.h +#endif + +/* C language features */ +#undef const +#undef inline +#undef volatile + +/* C datatypes */ +#if defined(__LP64__) || defined(_LP64) || defined(_WIN64) +#define SIZEOF_VOIDP 8 +#else +#define SIZEOF_VOIDP 4 +#endif + +#undef HAVE_GCC_ATOMICS +#undef HAVE_GCC_SYNC_LOCK_TEST_AND_SET + +/* Comment this if you want to build without any C library requirements */ +#undef HAVE_LIBC +#ifdef HAVE_LIBC + +/* Useful headers */ +#undef STDC_HEADERS +#undef HAVE_ALLOCA_H +#undef HAVE_CTYPE_H +#undef HAVE_FLOAT_H +#undef HAVE_ICONV_H +#undef HAVE_INTTYPES_H +#undef HAVE_LIMITS_H +#undef HAVE_MALLOC_H +#undef HAVE_MATH_H +#undef HAVE_MEMORY_H +#undef HAVE_SIGNAL_H +#undef HAVE_STDARG_H +#undef HAVE_STDINT_H +#undef HAVE_STDIO_H +#undef HAVE_STDLIB_H +#undef HAVE_STRINGS_H +#undef HAVE_STRING_H +#undef HAVE_SYS_TYPES_H +#undef HAVE_WCHAR_H +#undef HAVE_LINUX_INPUT_H +#undef HAVE_PTHREAD_NP_H +#undef HAVE_LIBUNWIND_H + +/* C library functions */ +#undef HAVE_DLOPEN +#undef HAVE_MALLOC +#undef HAVE_CALLOC +#undef HAVE_REALLOC +#undef HAVE_FREE +#undef HAVE_ALLOCA +#ifndef __WIN32__ /* Don't use C runtime versions of these on Windows */ +#undef HAVE_GETENV +#undef HAVE_SETENV +#undef HAVE_PUTENV +#undef HAVE_UNSETENV +#endif +#undef HAVE_QSORT +#undef HAVE_BSEARCH +#undef HAVE_ABS +#undef HAVE_BCOPY +#undef HAVE_MEMSET +#undef HAVE_MEMCPY +#undef HAVE_MEMMOVE +#undef HAVE_MEMCMP +#undef HAVE_WCSLEN +#undef HAVE_WCSLCPY +#undef HAVE_WCSLCAT +#undef HAVE__WCSDUP +#undef HAVE_WCSDUP +#undef HAVE_WCSSTR +#undef HAVE_WCSCMP +#undef HAVE_WCSNCMP +#undef HAVE_WCSCASECMP +#undef HAVE__WCSICMP +#undef HAVE_WCSNCASECMP +#undef HAVE__WCSNICMP +#undef HAVE_STRLEN +#undef HAVE_STRLCPY +#undef HAVE_STRLCAT +#undef HAVE__STRREV +#undef HAVE__STRUPR +#undef HAVE__STRLWR +#undef HAVE_INDEX +#undef HAVE_RINDEX +#undef HAVE_STRCHR +#undef HAVE_STRRCHR +#undef HAVE_STRSTR +#undef HAVE_STRTOK_R +#undef HAVE_ITOA +#undef HAVE__LTOA +#undef HAVE__UITOA +#undef HAVE__ULTOA +#undef HAVE_STRTOL +#undef HAVE_STRTOUL +#undef HAVE__I64TOA +#undef HAVE__UI64TOA +#undef HAVE_STRTOLL +#undef HAVE_STRTOULL +#undef HAVE_STRTOD +#undef HAVE_ATOI +#undef HAVE_ATOF +#undef HAVE_STRCMP +#undef HAVE_STRNCMP +#undef HAVE__STRICMP +#undef HAVE_STRCASECMP +#undef HAVE__STRNICMP +#undef HAVE_STRNCASECMP +#undef HAVE_STRCASESTR +#undef HAVE_SSCANF +#undef HAVE_VSSCANF +#undef HAVE_SNPRINTF +#undef HAVE_VSNPRINTF +#undef HAVE_M_PI +#undef HAVE_ACOS +#undef HAVE_ACOSF +#undef HAVE_ASIN +#undef HAVE_ASINF +#undef HAVE_ATAN +#undef HAVE_ATANF +#undef HAVE_ATAN2 +#undef HAVE_ATAN2F +#undef HAVE_CEIL +#undef HAVE_CEILF +#undef HAVE_COPYSIGN +#undef HAVE_COPYSIGNF +#undef HAVE_COS +#undef HAVE_COSF +#undef HAVE_EXP +#undef HAVE_EXPF +#undef HAVE_FABS +#undef HAVE_FABSF +#undef HAVE_FLOOR +#undef HAVE_FLOORF +#undef HAVE_FMOD +#undef HAVE_FMODF +#undef HAVE_LOG +#undef HAVE_LOGF +#undef HAVE_LOG10 +#undef HAVE_LOG10F +#undef HAVE_LROUND +#undef HAVE_LROUNDF +#undef HAVE_POW +#undef HAVE_POWF +#undef HAVE_ROUND +#undef HAVE_ROUNDF +#undef HAVE_SCALBN +#undef HAVE_SCALBNF +#undef HAVE_SIN +#undef HAVE_SINF +#undef HAVE_SQRT +#undef HAVE_SQRTF +#undef HAVE_TAN +#undef HAVE_TANF +#undef HAVE_TRUNC +#undef HAVE_TRUNCF +#undef HAVE_FOPEN64 +#undef HAVE_FSEEKO +#undef HAVE_FSEEKO64 +#undef HAVE_SIGACTION +#undef HAVE_SA_SIGACTION +#undef HAVE_SETJMP +#undef HAVE_NANOSLEEP +#undef HAVE_SYSCONF +#undef HAVE_SYSCTLBYNAME +#undef HAVE_CLOCK_GETTIME +#undef HAVE_GETPAGESIZE +#undef HAVE_MPROTECT +#undef HAVE_ICONV +#undef SDL_USE_LIBICONV +#undef HAVE_PTHREAD_SETNAME_NP +#undef HAVE_PTHREAD_SET_NAME_NP +#undef HAVE_SEM_TIMEDWAIT +#undef HAVE_GETAUXVAL +#undef HAVE_ELF_AUX_INFO +#undef HAVE_POLL +#undef HAVE_MEMFD_CREATE +#undef HAVE_POSIX_FALLOCATE +#undef HAVE__EXIT + +#else +#define HAVE_STDARG_H 1 +#define HAVE_STDDEF_H 1 +#define HAVE_STDINT_H 1 +#endif /* HAVE_LIBC */ + +#undef HAVE_O_CLOEXEC +#undef HAVE_ALTIVEC_H +#undef HAVE_DBUS_DBUS_H +#undef HAVE_FCITX +#undef HAVE_SYS_INOTIFY_H +#undef HAVE_INOTIFY_INIT +#undef HAVE_INOTIFY_INIT1 +#undef HAVE_INOTIFY +#undef HAVE_IBUS_IBUS_H +#undef HAVE_IMMINTRIN_H +#undef HAVE_LIBUDEV_H +#undef HAVE_LIBUSB +#undef HAVE_LIBSAMPLERATE_H +#undef HAVE_LIBDECOR_H +#undef HAVE_LSXINTRIN_H +#undef HAVE_LASXINTRIN_H + +#undef HAVE_DDRAW_H +#undef HAVE_DINPUT_H +#undef HAVE_DSOUND_H +#undef HAVE_DXGI_H +#undef HAVE_WINDOWS_GAMING_INPUT_H +#undef HAVE_XINPUT_H + +#undef HAVE_MMDEVICEAPI_H +#undef HAVE_AUDIOCLIENT_H +#undef HAVE_TPCSHRD_H +#undef HAVE_SENSORSAPI_H +#undef HAVE_ROAPI_H +#undef HAVE_SHELLSCALINGAPI_H + +/* SDL internal assertion support */ +#undef SDL_DEFAULT_ASSERT_LEVEL + +/* Allow disabling of core subsystems */ +#undef SDL_ATOMIC_DISABLED +#undef SDL_AUDIO_DISABLED +#undef SDL_CPUINFO_DISABLED +#undef SDL_EVENTS_DISABLED +#undef SDL_FILE_DISABLED +#undef SDL_JOYSTICK_DISABLED +#undef SDL_HAPTIC_DISABLED +#undef SDL_HIDAPI_DISABLED +#undef SDL_SENSOR_DISABLED +#undef SDL_LOADSO_DISABLED +#undef SDL_RENDER_DISABLED +#undef SDL_THREADS_DISABLED +#undef SDL_TIMERS_DISABLED +#undef SDL_VIDEO_DISABLED +#undef SDL_POWER_DISABLED +#undef SDL_FILESYSTEM_DISABLED +#undef SDL_LOCALE_DISABLED +#undef SDL_MISC_DISABLED + +/* Enable various audio drivers */ +#undef SDL_AUDIO_DRIVER_AAUDIO +#undef SDL_AUDIO_DRIVER_ALSA +#undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC +#undef SDL_AUDIO_DRIVER_ANDROID +#undef SDL_AUDIO_DRIVER_ARTS +#undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC +#undef SDL_AUDIO_DRIVER_COREAUDIO +#undef SDL_AUDIO_DRIVER_DISK +#undef SDL_AUDIO_DRIVER_DSOUND +#undef SDL_AUDIO_DRIVER_DUMMY +#undef SDL_AUDIO_DRIVER_EMSCRIPTEN +#undef SDL_AUDIO_DRIVER_ESD +#undef SDL_AUDIO_DRIVER_ESD_DYNAMIC +#undef SDL_AUDIO_DRIVER_FUSIONSOUND +#undef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC +#undef SDL_AUDIO_DRIVER_HAIKU +#undef SDL_AUDIO_DRIVER_JACK +#undef SDL_AUDIO_DRIVER_JACK_DYNAMIC +#undef SDL_AUDIO_DRIVER_NACL +#undef SDL_AUDIO_DRIVER_NAS +#undef SDL_AUDIO_DRIVER_NAS_DYNAMIC +#undef SDL_AUDIO_DRIVER_NETBSD +#undef SDL_AUDIO_DRIVER_OPENSLES +#undef SDL_AUDIO_DRIVER_OSS +#undef SDL_AUDIO_DRIVER_PAUDIO +#undef SDL_AUDIO_DRIVER_PIPEWIRE +#undef SDL_AUDIO_DRIVER_PIPEWIRE_DYNAMIC +#undef SDL_AUDIO_DRIVER_PULSEAUDIO +#undef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC +#undef SDL_AUDIO_DRIVER_QSA +#undef SDL_AUDIO_DRIVER_SNDIO +#undef SDL_AUDIO_DRIVER_SNDIO_DYNAMIC +#undef SDL_AUDIO_DRIVER_SUNAUDIO +#undef SDL_AUDIO_DRIVER_WASAPI +#undef SDL_AUDIO_DRIVER_WINMM +#undef SDL_AUDIO_DRIVER_OS2 + +/* Enable various input drivers */ +#undef SDL_INPUT_LINUXEV +#undef SDL_INPUT_FBSDKBIO +#undef SDL_INPUT_LINUXKD +#undef SDL_INPUT_WSCONS +#undef SDL_JOYSTICK_HAIKU +#undef SDL_JOYSTICK_DINPUT +#undef SDL_JOYSTICK_WGI +#undef SDL_JOYSTICK_XINPUT +#undef SDL_JOYSTICK_DUMMY +#undef SDL_JOYSTICK_IOKIT +#undef SDL_JOYSTICK_MFI +#undef SDL_JOYSTICK_LINUX +#undef SDL_JOYSTICK_ANDROID +#undef SDL_JOYSTICK_OS2 +#undef SDL_JOYSTICK_USBHID +#undef SDL_HAVE_MACHINE_JOYSTICK_H +#undef SDL_JOYSTICK_HIDAPI +#undef SDL_JOYSTICK_RAWINPUT +#undef SDL_JOYSTICK_EMSCRIPTEN +#undef SDL_JOYSTICK_VIRTUAL +#undef SDL_HAPTIC_DUMMY +#undef SDL_HAPTIC_ANDROID +#undef SDL_HAPTIC_LINUX +#undef SDL_HAPTIC_IOKIT +#undef SDL_HAPTIC_DINPUT +#undef SDL_HAPTIC_XINPUT + +/* Enable various sensor drivers */ +#undef SDL_SENSOR_ANDROID +#undef SDL_SENSOR_COREMOTION +#undef SDL_SENSOR_WINDOWS +#undef SDL_SENSOR_DUMMY + +/* Enable various shared object loading systems */ +#undef SDL_LOADSO_DLOPEN +#undef SDL_LOADSO_DUMMY +#undef SDL_LOADSO_LDG +#undef SDL_LOADSO_WINDOWS +#undef SDL_LOADSO_OS2 + +/* Enable various threading systems */ +#undef SDL_THREAD_GENERIC_COND_SUFFIX +#undef SDL_THREAD_PTHREAD +#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX +#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP +#undef SDL_THREAD_WINDOWS +#undef SDL_THREAD_OS2 + +/* Enable various timer systems */ +#undef SDL_TIMER_HAIKU +#undef SDL_TIMER_DUMMY +#undef SDL_TIMER_UNIX +#undef SDL_TIMER_WINDOWS +#undef SDL_TIMER_OS2 + +/* Enable various video drivers */ +#undef SDL_VIDEO_DRIVER_HAIKU +#undef SDL_VIDEO_DRIVER_COCOA +#undef SDL_VIDEO_DRIVER_DIRECTFB +#undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC +#undef SDL_VIDEO_DRIVER_DUMMY +#undef SDL_VIDEO_DRIVER_WINDOWS +#undef SDL_VIDEO_DRIVER_WAYLAND +#undef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH +#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC +#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL +#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR +#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON +#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR +#undef SDL_VIDEO_DRIVER_X11 +#undef SDL_VIDEO_DRIVER_RPI +#undef SDL_VIDEO_DRIVER_KMSDRM +#undef SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC +#undef SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM +#undef SDL_VIDEO_DRIVER_ANDROID +#undef SDL_VIDEO_DRIVER_EMSCRIPTEN +#undef SDL_VIDEO_DRIVER_OFFSCREEN +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XFIXES +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS +#undef SDL_VIDEO_DRIVER_X11_XCURSOR +#undef SDL_VIDEO_DRIVER_X11_XDBE +#undef SDL_VIDEO_DRIVER_X11_XINPUT2 +#undef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH +#undef SDL_VIDEO_DRIVER_X11_XFIXES +#undef SDL_VIDEO_DRIVER_X11_XRANDR +#undef SDL_VIDEO_DRIVER_X11_XSCRNSAVER +#undef SDL_VIDEO_DRIVER_X11_XSHAPE +#undef SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS +#undef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM +#undef SDL_VIDEO_DRIVER_NACL +#undef SDL_VIDEO_DRIVER_VIVANTE +#undef SDL_VIDEO_DRIVER_VIVANTE_VDK +#undef SDL_VIDEO_DRIVER_OS2 +#undef SDL_VIDEO_DRIVER_QNX +#undef SDL_VIDEO_DRIVER_RISCOS + +#undef SDL_VIDEO_RENDER_D3D +#undef SDL_VIDEO_RENDER_D3D11 +#undef SDL_VIDEO_RENDER_D3D12 +#undef SDL_VIDEO_RENDER_OGL +#undef SDL_VIDEO_RENDER_OGL_ES +#undef SDL_VIDEO_RENDER_OGL_ES2 +#undef SDL_VIDEO_RENDER_DIRECTFB +#undef SDL_VIDEO_RENDER_METAL + +/* Enable OpenGL support */ +#undef SDL_VIDEO_OPENGL +#undef SDL_VIDEO_OPENGL_ES +#undef SDL_VIDEO_OPENGL_ES2 +#undef SDL_VIDEO_OPENGL_BGL +#undef SDL_VIDEO_OPENGL_CGL +#undef SDL_VIDEO_OPENGL_EGL +#undef SDL_VIDEO_OPENGL_GLX +#undef SDL_VIDEO_OPENGL_WGL +#undef SDL_VIDEO_OPENGL_OSMESA +#undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC + +/* Enable Vulkan support */ +#undef SDL_VIDEO_VULKAN + +/* Enable Metal support */ +#undef SDL_VIDEO_METAL + +/* Enable system power support */ +#undef SDL_POWER_LINUX +#undef SDL_POWER_WINDOWS +#undef SDL_POWER_MACOSX +#undef SDL_POWER_HAIKU +#undef SDL_POWER_ANDROID +#undef SDL_POWER_EMSCRIPTEN +#undef SDL_POWER_HARDWIRED + +/* Enable system filesystem support */ +#undef SDL_FILESYSTEM_ANDROID +#undef SDL_FILESYSTEM_HAIKU +#undef SDL_FILESYSTEM_COCOA +#undef SDL_FILESYSTEM_DUMMY +#undef SDL_FILESYSTEM_RISCOS +#undef SDL_FILESYSTEM_UNIX +#undef SDL_FILESYSTEM_WINDOWS +#undef SDL_FILESYSTEM_NACL +#undef SDL_FILESYSTEM_EMSCRIPTEN +#undef SDL_FILESYSTEM_OS2 +#undef SDL_FILESYSTEM_VITA +#undef SDL_FILESYSTEM_PSP +#undef SDL_FILESYSTEM_PS2 + +/* Enable misc subsystem */ +#undef SDL_MISC_DUMMY + +/* Enable locale subsystem */ +#undef SDL_LOCALE_DUMMY + +/* Enable assembly routines */ +#undef SDL_ALTIVEC_BLITTERS +#undef SDL_ARM_SIMD_BLITTERS +#undef SDL_ARM_NEON_BLITTERS + +/* Whether SDL_DYNAMIC_API needs dlopen() */ +#undef DYNAPI_NEEDS_DLOPEN + +/* Enable ime support */ +#undef SDL_USE_IME + +/* Enable dynamic udev support */ +#undef SDL_UDEV_DYNAMIC + +/* Enable dynamic libusb support */ +#undef SDL_LIBUSB_DYNAMIC + +/* Enable dynamic libsamplerate support */ +#undef SDL_LIBSAMPLERATE_DYNAMIC + +/* Libdecor get min/max content size functions */ +#undef SDL_HAVE_LIBDECOR_GET_MIN_MAX + +#endif /* SDL_config_h_ */ diff --git a/extlibs/sdl2/include/SDL_config_android.h b/extlibs/sdl2/include/SDL_config_android.h new file mode 100644 index 000000000..00ffef852 --- /dev/null +++ b/extlibs/sdl2/include/SDL_config_android.h @@ -0,0 +1,194 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_config_android_h_ +#define SDL_config_android_h_ +#define SDL_config_h_ + +#include "SDL_platform.h" + +/** + * \file SDL_config_android.h + * + * This is a configuration that can be used to build SDL for Android + */ + +#include + +#define HAVE_GCC_ATOMICS 1 + +#define STDC_HEADERS 1 +#define HAVE_ALLOCA_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STRING_H 1 +#define HAVE_SYS_TYPES_H 1 + +/* C library functions */ +#define HAVE_DLOPEN 1 +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_SETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_SETENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_BSEARCH 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOK_R 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_STRCASESTR 1 +#define HAVE_VSSCANF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_ACOS 1 +#define HAVE_ACOSF 1 +#define HAVE_ASIN 1 +#define HAVE_ASINF 1 +#define HAVE_ATAN 1 +#define HAVE_ATANF 1 +#define HAVE_ATAN2 1 +#define HAVE_ATAN2F 1 +#define HAVE_CEIL 1 +#define HAVE_CEILF 1 +#define HAVE_COPYSIGN 1 +#define HAVE_COPYSIGNF 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_EXP 1 +#define HAVE_EXPF 1 +#define HAVE_FABS 1 +#define HAVE_FABSF 1 +#define HAVE_FLOOR 1 +#define HAVE_FLOORF 1 +#define HAVE_FMOD 1 +#define HAVE_FMODF 1 +#define HAVE_LOG 1 +#define HAVE_LOGF 1 +#define HAVE_LOG10 1 +#define HAVE_LOG10F 1 +#define HAVE_LROUND 1 +#define HAVE_LROUNDF 1 +#define HAVE_POW 1 +#define HAVE_POWF 1 +#define HAVE_ROUND 1 +#define HAVE_ROUNDF 1 +#define HAVE_SCALBN 1 +#define HAVE_SCALBNF 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#define HAVE_SQRTF 1 +#define HAVE_TAN 1 +#define HAVE_TANF 1 +#define HAVE_TRUNC 1 +#define HAVE_TRUNCF 1 +#define HAVE_SIGACTION 1 +#define HAVE_SETJMP 1 +#define HAVE_NANOSLEEP 1 +#define HAVE_SYSCONF 1 +#define HAVE_CLOCK_GETTIME 1 + +#ifdef __LP64__ +#define SIZEOF_VOIDP 8 +#else +#define SIZEOF_VOIDP 4 +#endif + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_ANDROID 1 +#define SDL_AUDIO_DRIVER_OPENSLES 1 +#define SDL_AUDIO_DRIVER_AAUDIO 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_ANDROID 1 +#define SDL_JOYSTICK_HIDAPI 1 +#define SDL_JOYSTICK_VIRTUAL 1 +#define SDL_HAPTIC_ANDROID 1 + +/* Enable sensor driver */ +#define SDL_SENSOR_ANDROID 1 + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_DLOPEN 1 + +/* Enable various threading systems */ +#define SDL_THREAD_PTHREAD 1 +#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 + +/* Enable various timer systems */ +#define SDL_TIMER_UNIX 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_ANDROID 1 + +/* Enable OpenGL ES */ +#define SDL_VIDEO_OPENGL_ES 1 +#define SDL_VIDEO_OPENGL_ES2 1 +#define SDL_VIDEO_OPENGL_EGL 1 +#define SDL_VIDEO_RENDER_OGL_ES 1 +#define SDL_VIDEO_RENDER_OGL_ES2 1 + +/* Enable Vulkan support */ +/* Android does not support Vulkan in native code using the "armeabi" ABI. */ +#if defined(__ARM_ARCH) && __ARM_ARCH < 7 +#define SDL_VIDEO_VULKAN 0 +#else +#define SDL_VIDEO_VULKAN 1 +#endif + +/* Enable system power support */ +#define SDL_POWER_ANDROID 1 + +/* Enable the filesystem driver */ +#define SDL_FILESYSTEM_ANDROID 1 + +#endif /* SDL_config_android_h_ */ diff --git a/extlibs/sdl2/include/SDL_config_emscripten.h b/extlibs/sdl2/include/SDL_config_emscripten.h new file mode 100644 index 000000000..637cdae50 --- /dev/null +++ b/extlibs/sdl2/include/SDL_config_emscripten.h @@ -0,0 +1,218 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_config_emscripten_h_ +#define _SDL_config_emscripten_h_ + +#include "SDL_platform.h" + +/** + * \file SDL_config_emscripten.h + * + * This is a configuration that can be used to build SDL for Emscripten. + */ + +#ifdef __LP64__ +#define SIZEOF_VOIDP 8 +#else +#define SIZEOF_VOIDP 4 +#endif +#define HAVE_GCC_ATOMICS 1 + +/* Useful headers */ +#define STDC_HEADERS 1 +#define HAVE_ALLOCA_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_ICONV_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_MALLOC_H 1 +#define HAVE_MATH_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_SIGNAL_H 1 +#define HAVE_STDARG_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_STRING_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_WCHAR_H 1 + +/* C library functions */ +#define HAVE_DLOPEN 1 +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_SETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_BSEARCH 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_WCSLEN 1 +#define HAVE_WCSDUP 1 +#define HAVE_WCSSTR 1 +#define HAVE_WCSCMP 1 +#define HAVE_WCSNCMP 1 +#define HAVE_WCSCASECMP 1 +#define HAVE_WCSNCASECMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOK_R 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_SSCANF 1 +#define HAVE_VSSCANF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_M_PI 1 +#define HAVE_ACOS 1 +#define HAVE_ACOSF 1 +#define HAVE_ASIN 1 +#define HAVE_ASINF 1 +#define HAVE_ATAN 1 +#define HAVE_ATANF 1 +#define HAVE_ATAN2 1 +#define HAVE_ATAN2F 1 +#define HAVE_CEIL 1 +#define HAVE_CEILF 1 +#define HAVE_COPYSIGN 1 +#define HAVE_COPYSIGNF 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_EXP 1 +#define HAVE_EXPF 1 +#define HAVE_FABS 1 +#define HAVE_FABSF 1 +#define HAVE_FLOOR 1 +#define HAVE_FLOORF 1 +#define HAVE_FMOD 1 +#define HAVE_FMODF 1 +#define HAVE_LOG 1 +#define HAVE_LOGF 1 +#define HAVE_LOG10 1 +#define HAVE_LOG10F 1 +#define HAVE_LROUND 1 +#define HAVE_LROUNDF 1 +#define HAVE_POW 1 +#define HAVE_POWF 1 +#define HAVE_ROUND 1 +#define HAVE_ROUNDF 1 +#define HAVE_SCALBN 1 +#define HAVE_SCALBNF 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#define HAVE_SQRTF 1 +#define HAVE_TAN 1 +#define HAVE_TANF 1 +#define HAVE_TRUNC 1 +#define HAVE_TRUNCF 1 +#define HAVE_FSEEKO 1 +#define HAVE_FSEEKO64 1 +#define HAVE_SIGACTION 1 +#define HAVE_SA_SIGACTION 1 +#define HAVE_SETJMP 1 +#define HAVE_NANOSLEEP 1 +#define HAVE_SYSCONF 1 +#define HAVE_CLOCK_GETTIME 1 +/* #undef HAVE_GETPAGESIZE */ +#define HAVE_MPROTECT 1 +#define HAVE_ICONV 1 + +/* SDL internal assertion support */ +/* #undef SDL_DEFAULT_ASSERT_LEVEL */ + +#define SDL_CPUINFO_DISABLED 1 +#define SDL_HAPTIC_DISABLED 1 +#define SDL_HIDAPI_DISABLED 1 +#ifndef __EMSCRIPTEN_PTHREADS__ +#define SDL_THREADS_DISABLED 1 +#endif + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 +#define SDL_AUDIO_DRIVER_EMSCRIPTEN 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_EMSCRIPTEN 1 + +/* Enable various sensor drivers */ +#define SDL_SENSOR_DUMMY 1 + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_DLOPEN 1 + +/* Enable various threading systems */ +#ifdef __EMSCRIPTEN_PTHREADS__ +#define SDL_THREAD_PTHREAD 1 +#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 +#endif + +/* Enable various timer systems */ +#define SDL_TIMER_UNIX 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_EMSCRIPTEN 1 + +#define SDL_VIDEO_RENDER_OGL_ES2 1 + +/* Enable OpenGL support */ +/* #undef SDL_VIDEO_OPENGL */ +/* #undef SDL_VIDEO_OPENGL_ES */ +#define SDL_VIDEO_OPENGL_ES2 1 +/* #undef SDL_VIDEO_OPENGL_BGL */ +/* #undef SDL_VIDEO_OPENGL_CGL */ +/* #undef SDL_VIDEO_OPENGL_GLX */ +/* #undef SDL_VIDEO_OPENGL_WGL */ +#define SDL_VIDEO_OPENGL_EGL 1 +/* #undef SDL_VIDEO_OPENGL_OSMESA */ +/* #undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC */ + +/* Enable system power support */ +#define SDL_POWER_EMSCRIPTEN 1 + +/* Enable system filesystem support */ +#define SDL_FILESYSTEM_EMSCRIPTEN 1 + +#endif /* _SDL_config_emscripten_h_ */ diff --git a/extlibs/sdl2/include/SDL_config_iphoneos.h b/extlibs/sdl2/include/SDL_config_iphoneos.h new file mode 100644 index 000000000..2743901fe --- /dev/null +++ b/extlibs/sdl2/include/SDL_config_iphoneos.h @@ -0,0 +1,217 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_config_iphoneos_h_ +#define SDL_config_iphoneos_h_ +#define SDL_config_h_ + +#include "SDL_platform.h" + +#ifdef __LP64__ +#define SIZEOF_VOIDP 8 +#else +#define SIZEOF_VOIDP 4 +#endif + +#define HAVE_GCC_ATOMICS 1 + +#define STDC_HEADERS 1 +#define HAVE_ALLOCA_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STRING_H 1 +#define HAVE_SYS_TYPES_H 1 +/* The libunwind functions are only available on x86 */ +/* #undef HAVE_LIBUNWIND_H */ + +/* C library functions */ +#define HAVE_DLOPEN 1 +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_SETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_SETENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_BSEARCH 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOK_R 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_STRCASESTR 1 +#define HAVE_VSSCANF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_M_PI 1 +#define HAVE_ACOS 1 +#define HAVE_ACOSF 1 +#define HAVE_ASIN 1 +#define HAVE_ASINF 1 +#define HAVE_ATAN 1 +#define HAVE_ATANF 1 +#define HAVE_ATAN2 1 +#define HAVE_ATAN2F 1 +#define HAVE_CEIL 1 +#define HAVE_CEILF 1 +#define HAVE_COPYSIGN 1 +#define HAVE_COPYSIGNF 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_EXP 1 +#define HAVE_EXPF 1 +#define HAVE_FABS 1 +#define HAVE_FABSF 1 +#define HAVE_FLOOR 1 +#define HAVE_FLOORF 1 +#define HAVE_FMOD 1 +#define HAVE_FMODF 1 +#define HAVE_LOG 1 +#define HAVE_LOGF 1 +#define HAVE_LOG10 1 +#define HAVE_LOG10F 1 +#define HAVE_LROUND 1 +#define HAVE_LROUNDF 1 +#define HAVE_POW 1 +#define HAVE_POWF 1 +#define HAVE_ROUND 1 +#define HAVE_ROUNDF 1 +#define HAVE_SCALBN 1 +#define HAVE_SCALBNF 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#define HAVE_SQRTF 1 +#define HAVE_TAN 1 +#define HAVE_TANF 1 +#define HAVE_TRUNC 1 +#define HAVE_TRUNCF 1 +#define HAVE_SIGACTION 1 +#define HAVE_SETJMP 1 +#define HAVE_NANOSLEEP 1 +#define HAVE_SYSCONF 1 +#define HAVE_SYSCTLBYNAME 1 +#define HAVE_O_CLOEXEC 1 + +/* enable iPhone version of Core Audio driver */ +#define SDL_AUDIO_DRIVER_COREAUDIO 1 +/* Enable the dummy audio driver (src/audio/dummy/\*.c) */ +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ +#define SDL_HAPTIC_DUMMY 1 + +/* Enable joystick support */ +/* Only enable HIDAPI support if you want to support Steam Controllers on iOS and tvOS */ +/*#define SDL_JOYSTICK_HIDAPI 1*/ +#define SDL_JOYSTICK_MFI 1 +#define SDL_JOYSTICK_VIRTUAL 1 + +#ifdef __TVOS__ +#define SDL_SENSOR_DUMMY 1 +#else +/* Enable the CoreMotion sensor driver */ +#define SDL_SENSOR_COREMOTION 1 +#endif + +/* Enable Unix style SO loading */ +#define SDL_LOADSO_DLOPEN 1 + +/* Enable various threading systems */ +#define SDL_THREAD_PTHREAD 1 +#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 + +/* Enable various timer systems */ +#define SDL_TIMER_UNIX 1 + +/* Supported video drivers */ +#define SDL_VIDEO_DRIVER_UIKIT 1 +#define SDL_VIDEO_DRIVER_DUMMY 1 + +/* Enable OpenGL ES */ +#if !TARGET_OS_MACCATALYST +#define SDL_VIDEO_OPENGL_ES2 1 +#define SDL_VIDEO_OPENGL_ES 1 +#define SDL_VIDEO_RENDER_OGL_ES 1 +#define SDL_VIDEO_RENDER_OGL_ES2 1 +#endif + +/* Metal supported on 64-bit devices running iOS 8.0 and tvOS 9.0 and newer + Also supported in simulator from iOS 13.0 and tvOS 13.0 + */ +#if (TARGET_OS_SIMULATOR && ((__IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) || (__TV_OS_VERSION_MIN_REQUIRED >= 130000))) || (!TARGET_CPU_ARM && ((__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 90000))) +#define SDL_PLATFORM_SUPPORTS_METAL 1 +#else +#define SDL_PLATFORM_SUPPORTS_METAL 0 +#endif + +#if SDL_PLATFORM_SUPPORTS_METAL +#define SDL_VIDEO_RENDER_METAL 1 +#endif + +#if SDL_PLATFORM_SUPPORTS_METAL +#define SDL_VIDEO_VULKAN 1 +#endif + +#if SDL_PLATFORM_SUPPORTS_METAL +#define SDL_VIDEO_METAL 1 +#endif + +/* Enable system power support */ +#define SDL_POWER_UIKIT 1 + +/* enable iPhone keyboard support */ +#define SDL_IPHONE_KEYBOARD 1 + +/* enable iOS extended launch screen */ +#define SDL_IPHONE_LAUNCHSCREEN 1 + +/* enable filesystem support */ +#define SDL_FILESYSTEM_COCOA 1 + +#endif /* SDL_config_iphoneos_h_ */ diff --git a/extlibs/sdl2/include/SDL_config_macosx.h b/extlibs/sdl2/include/SDL_config_macosx.h new file mode 100644 index 000000000..2db760a9f --- /dev/null +++ b/extlibs/sdl2/include/SDL_config_macosx.h @@ -0,0 +1,277 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_config_macosx_h_ +#define SDL_config_macosx_h_ +#define SDL_config_h_ + +#include "SDL_platform.h" + +/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */ +#include + +/* This is a set of defines to configure the SDL features */ + +#ifdef __LP64__ + #define SIZEOF_VOIDP 8 +#else + #define SIZEOF_VOIDP 4 +#endif + +/* Useful headers */ +#define STDC_HEADERS 1 +#define HAVE_ALLOCA_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_FLOAT_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STRING_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_LIBUNWIND_H 1 + +/* C library functions */ +#define HAVE_DLOPEN 1 +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_SETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_BSEARCH 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOK_R 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_STRCASESTR 1 +#define HAVE_VSSCANF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_M_PI 1 +#define HAVE_ACOS 1 +#define HAVE_ACOSF 1 +#define HAVE_ASIN 1 +#define HAVE_ASINF 1 +#define HAVE_ATAN 1 +#define HAVE_ATANF 1 +#define HAVE_ATAN2 1 +#define HAVE_ATAN2F 1 +#define HAVE_CEIL 1 +#define HAVE_CEILF 1 +#define HAVE_COPYSIGN 1 +#define HAVE_COPYSIGNF 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_EXP 1 +#define HAVE_EXPF 1 +#define HAVE_FABS 1 +#define HAVE_FABSF 1 +#define HAVE_FLOOR 1 +#define HAVE_FLOORF 1 +#define HAVE_FMOD 1 +#define HAVE_FMODF 1 +#define HAVE_LOG 1 +#define HAVE_LOGF 1 +#define HAVE_LOG10 1 +#define HAVE_LOG10F 1 +#define HAVE_LROUND 1 +#define HAVE_LROUNDF 1 +#define HAVE_POW 1 +#define HAVE_POWF 1 +#define HAVE_ROUND 1 +#define HAVE_ROUNDF 1 +#define HAVE_SCALBN 1 +#define HAVE_SCALBNF 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#define HAVE_SQRTF 1 +#define HAVE_TAN 1 +#define HAVE_TANF 1 +#define HAVE_TRUNC 1 +#define HAVE_TRUNCF 1 +#define HAVE_SIGACTION 1 +#define HAVE_SETJMP 1 +#define HAVE_NANOSLEEP 1 +#define HAVE_SYSCONF 1 +#define HAVE_SYSCTLBYNAME 1 + +#if defined(__has_include) && (defined(__i386__) || defined(__x86_64)) +# if __has_include() +# define HAVE_IMMINTRIN_H 1 +# endif +#endif + +#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1070) +#define HAVE_O_CLOEXEC 1 +#endif + +#define HAVE_GCC_ATOMICS 1 + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_COREAUDIO 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_HIDAPI 1 +#define SDL_JOYSTICK_IOKIT 1 +#define SDL_JOYSTICK_VIRTUAL 1 +#define SDL_HAPTIC_IOKIT 1 + +/* The MFI controller support requires ARC Objective C runtime */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 && !defined(__i386__) +#define SDL_JOYSTICK_MFI 1 +#endif + +/* Enable the dummy sensor driver */ +#define SDL_SENSOR_DUMMY 1 + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_DLOPEN 1 + +/* Enable various threading systems */ +#define SDL_THREAD_PTHREAD 1 +#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 + +/* Enable various timer systems */ +#define SDL_TIMER_UNIX 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_COCOA 1 +#define SDL_VIDEO_DRIVER_DUMMY 1 +#undef SDL_VIDEO_DRIVER_X11 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/opt/X11/lib/libX11.6.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/opt/X11/lib/libXext.6.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "/opt/X11/lib/libXi.6.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/opt/X11/lib/libXrandr.2.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/opt/X11/lib/libXss.1.dylib" +#define SDL_VIDEO_DRIVER_X11_XDBE 1 +#define SDL_VIDEO_DRIVER_X11_XRANDR 1 +#define SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1 +#define SDL_VIDEO_DRIVER_X11_XSHAPE 1 +#define SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM 1 + +#ifdef MAC_OS_X_VERSION_10_8 +/* + * No matter the versions targeted, this is the 10.8 or later SDK, so you have + * to use the external Xquartz, which is a more modern Xlib. Previous SDKs + * used an older Xlib. + */ +#define SDL_VIDEO_DRIVER_X11_XINPUT2 1 +#define SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1 +#endif + +#ifndef SDL_VIDEO_RENDER_OGL +#define SDL_VIDEO_RENDER_OGL 1 +#endif + +#ifndef SDL_VIDEO_RENDER_OGL_ES2 +#define SDL_VIDEO_RENDER_OGL_ES2 1 +#endif + +/* Metal only supported on 64-bit architectures with 10.11+ */ +#if TARGET_RT_64_BIT && (MAC_OS_X_VERSION_MAX_ALLOWED >= 101100) +#define SDL_PLATFORM_SUPPORTS_METAL 1 +#else +#define SDL_PLATFORM_SUPPORTS_METAL 0 +#endif + +#ifndef SDL_VIDEO_RENDER_METAL +#if SDL_PLATFORM_SUPPORTS_METAL +#define SDL_VIDEO_RENDER_METAL 1 +#else +#define SDL_VIDEO_RENDER_METAL 0 +#endif +#endif + +/* Enable OpenGL support */ +#ifndef SDL_VIDEO_OPENGL +#define SDL_VIDEO_OPENGL 1 +#endif +#ifndef SDL_VIDEO_OPENGL_ES2 +#define SDL_VIDEO_OPENGL_ES2 1 +#endif +#ifndef SDL_VIDEO_OPENGL_EGL +#define SDL_VIDEO_OPENGL_EGL 1 +#endif +#ifndef SDL_VIDEO_OPENGL_CGL +#define SDL_VIDEO_OPENGL_CGL 1 +#endif +#ifndef SDL_VIDEO_OPENGL_GLX +#define SDL_VIDEO_OPENGL_GLX 1 +#endif + +/* Enable Vulkan and Metal support */ +#ifndef SDL_VIDEO_VULKAN +#if SDL_PLATFORM_SUPPORTS_METAL +#define SDL_VIDEO_VULKAN 1 +#else +#define SDL_VIDEO_VULKAN 0 +#endif +#endif + +#ifndef SDL_VIDEO_METAL +#if SDL_PLATFORM_SUPPORTS_METAL +#define SDL_VIDEO_METAL 1 +#else +#define SDL_VIDEO_METAL 0 +#endif +#endif + +/* Enable system power support */ +#define SDL_POWER_MACOSX 1 + +/* enable filesystem support */ +#define SDL_FILESYSTEM_COCOA 1 + +/* Enable assembly routines */ +#ifdef __ppc__ +#define SDL_ALTIVEC_BLITTERS 1 +#endif + +#endif /* SDL_config_macosx_h_ */ diff --git a/extlibs/sdl2/include/SDL_config_minimal.h b/extlibs/sdl2/include/SDL_config_minimal.h new file mode 100644 index 000000000..ceedda2d6 --- /dev/null +++ b/extlibs/sdl2/include/SDL_config_minimal.h @@ -0,0 +1,95 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_config_minimal_h_ +#define SDL_config_minimal_h_ +#define SDL_config_h_ + +#include "SDL_platform.h" + +/** + * \file SDL_config_minimal.h + * + * This is the minimal configuration that can be used to build SDL. + */ + +#define HAVE_STDARG_H 1 +#define HAVE_STDDEF_H 1 + +#if !defined(HAVE_STDINT_H) && !defined(_STDINT_H_) +/* Most everything except Visual Studio 2008 and earlier has stdint.h now */ +#if defined(_MSC_VER) && (_MSC_VER < 1600) +typedef signed __int8 int8_t; +typedef unsigned __int8 uint8_t; +typedef signed __int16 int16_t; +typedef unsigned __int16 uint16_t; +typedef signed __int32 int32_t; +typedef unsigned __int32 uint32_t; +typedef signed __int64 int64_t; +typedef unsigned __int64 uint64_t; +#ifndef _UINTPTR_T_DEFINED +#ifdef _WIN64 +typedef unsigned __int64 uintptr_t; +#else +typedef unsigned int uintptr_t; +#endif +#define _UINTPTR_T_DEFINED +#endif +#else +#define HAVE_STDINT_H 1 +#endif /* Visual Studio 2008 */ +#endif /* !_STDINT_H_ && !HAVE_STDINT_H */ + +#ifdef __GNUC__ +#define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1 +#endif + +/* Enable the dummy audio driver (src/audio/dummy/\*.c) */ +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */ +#define SDL_JOYSTICK_DISABLED 1 + +/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ +#define SDL_HAPTIC_DISABLED 1 + +/* Enable the stub HIDAPI */ +#define SDL_HIDAPI_DISABLED 1 + +/* Enable the stub sensor driver (src/sensor/dummy/\*.c) */ +#define SDL_SENSOR_DISABLED 1 + +/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ +#define SDL_LOADSO_DISABLED 1 + +/* Enable the stub thread support (src/thread/generic/\*.c) */ +#define SDL_THREADS_DISABLED 1 + +/* Enable the stub timer support (src/timer/dummy/\*.c) */ +#define SDL_TIMERS_DISABLED 1 + +/* Enable the dummy video driver (src/video/dummy/\*.c) */ +#define SDL_VIDEO_DRIVER_DUMMY 1 + +/* Enable the dummy filesystem driver (src/filesystem/dummy/\*.c) */ +#define SDL_FILESYSTEM_DUMMY 1 + +#endif /* SDL_config_minimal_h_ */ diff --git a/extlibs/sdl2/include/SDL_config_ngage.h b/extlibs/sdl2/include/SDL_config_ngage.h new file mode 100644 index 000000000..61c26c2cf --- /dev/null +++ b/extlibs/sdl2/include/SDL_config_ngage.h @@ -0,0 +1,89 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_config_ngage_h_ +#define SDL_config_ngage_h_ +#define SDL_config_h_ + +#include "SDL_platform.h" + +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; +typedef unsigned long uintptr_t; + +#define HAVE_STDARG_H 1 +#define HAVE_STDDEF_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_MATH_H 1 +#define HAVE_CEIL 1 +#define HAVE_COPYSIGN 1 +#define HAVE_COS 1 +#define HAVE_EXP 1 +#define HAVE_FABS 1 +#define HAVE_FLOOR 1 +#define HAVE_LOG 1 +#define HAVE_LOG10 1 +#define HAVE_SCALBN 1 +#define HAVE_SIN 1 +#define HAVE_SQRT 1 +#define HAVE_TAN 1 +#define HAVE_MALLOC 1 +#define SDL_MAIN_NEEDED 1 +#define LACKS_SYS_MMAN_H 1 + +/* Enable the N-Gage thread support (src/thread/ngage/\*.c) */ +#define SDL_THREAD_NGAGE 1 + +/* Enable the N-Gage timer support (src/timer/ngage/\*.c) */ +#define SDL_TIMER_NGAGE 1 + +/* Enable the N-Gage video driver (src/video/ngage/\*.c) */ +#define SDL_VIDEO_DRIVER_NGAGE 1 + +/* Enable the dummy audio driver (src/audio/dummy/\*.c) */ +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */ +#define SDL_JOYSTICK_DISABLED 1 + +/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ +#define SDL_HAPTIC_DISABLED 1 + +/* Enable the stub HIDAPI */ +#define SDL_HIDAPI_DISABLED 1 + +/* Enable the stub sensor driver (src/sensor/dummy/\*.c) */ +#define SDL_SENSOR_DISABLED 1 + +/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ +#define SDL_LOADSO_DISABLED 1 + +/* Enable the dummy filesystem driver (src/filesystem/dummy/\*.c) */ +#define SDL_FILESYSTEM_DUMMY 1 + +#endif /* SDL_config_ngage_h_ */ diff --git a/extlibs/sdl2/include/SDL_config_os2.h b/extlibs/sdl2/include/SDL_config_os2.h new file mode 100644 index 000000000..b2b061d71 --- /dev/null +++ b/extlibs/sdl2/include/SDL_config_os2.h @@ -0,0 +1,204 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_config_os2_h_ +#define SDL_config_os2_h_ +#define SDL_config_h_ + +#include "SDL_platform.h" + +#define SIZEOF_VOIDP 4 + +#define SDL_AUDIO_DRIVER_DUMMY 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_OS2 1 + +#define SDL_POWER_DISABLED 1 +#define SDL_HAPTIC_DISABLED 1 + +#define SDL_SENSOR_DUMMY 1 +#define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_OS2 1 +#define SDL_JOYSTICK_OS2 1 +#ifndef HAVE_LIBUSB_H /* see Makefile */ +#define SDL_HIDAPI_DISABLED 1 +/*#undef SDL_JOYSTICK_HIDAPI */ +#else +#define SDL_JOYSTICK_HIDAPI 1 +#define HAVE_LIBUSB 1 +/* dynamically loaded libusb-1.0 dll: */ +#define SDL_LIBUSB_DYNAMIC "usb100.dll" +#endif +#define SDL_JOYSTICK_VIRTUAL 1 + +/* Enable OpenGL support */ +/* #undef SDL_VIDEO_OPENGL */ + +#define SDL_THREAD_OS2 1 +#define SDL_LOADSO_OS2 1 +#define SDL_TIMER_OS2 1 +#define SDL_FILESYSTEM_OS2 1 + +/* use libsamplerate for audio rate conversion. */ +/*#define HAVE_LIBSAMPLERATE_H 1 */ + +/* Enable dynamic libsamplerate support */ +#define SDL_LIBSAMPLERATE_DYNAMIC "SAMPRATE.DLL" + +#define HAVE_LIBC 1 + +#define HAVE_STDARG_H 1 +#define HAVE_STDDEF_H 1 +#define HAVE_STDINT_H 1 + +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STDLIB_H 1 +#define HAVE_MALLOC_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_STRING_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_WCHAR_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_FLOAT_H 1 +#define HAVE_SIGNAL_H 1 + +#if 0 /* see Makefile */ +#define HAVE_ICONV 1 +#define HAVE_ICONV_H 1 +#endif + +/* #undef HAVE_DLOPEN */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#if defined(__WATCOMC__) +#define HAVE__FSEEKI64 1 +#define HAVE__FTELLI64 1 +#endif +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_SETENV 1 +#define HAVE_PUTENV 1 +/* OpenWatcom requires specific calling conventions for qsort and bsearch */ +#ifndef __WATCOMC__ +#define HAVE_QSORT 1 +#define HAVE_BSEARCH 1 +#endif +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_WCSCMP 1 +#define HAVE__WCSICMP 1 +#define HAVE__WCSNICMP 1 +#define HAVE_WCSLEN 1 +#define HAVE_WCSLCPY 1 +#define HAVE_WCSLCAT 1 +/* #undef HAVE_WCSDUP */ +#define HAVE__WCSDUP 1 +#define HAVE_WCSSTR 1 +#define HAVE_WCSCMP 1 +#define HAVE_WCSNCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRLCAT 1 +#define HAVE__STRREV 1 +#define HAVE__STRUPR 1 +#define HAVE__STRLWR 1 +/* #undef HAVE_INDEX */ +/* #undef HAVE_RINDEX */ +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +/* #undef HAVE_STRTOK_R */ +#define HAVE_ITOA 1 +#define HAVE__LTOA 1 +#define HAVE__ULTOA 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE__I64TOA 1 +#define HAVE__UI64TOA 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRICMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_SSCANF 1 +#define HAVE_VSSCANF 1 +#define HAVE_SNPRINTF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_SETJMP 1 +#define HAVE_ACOS 1 +/* #undef HAVE_ACOSF */ +#define HAVE_ASIN 1 +/* #undef HAVE_ASINF */ +#define HAVE_ATAN 1 +#define HAVE_ATAN2 1 +/* #undef HAVE_ATAN2F */ +#define HAVE_CEIL 1 +/* #undef HAVE_CEILF */ +/* #undef HAVE_COPYSIGN */ +/* #undef HAVE_COPYSIGNF */ +#define HAVE_COS 1 +/* #undef HAVE_COSF */ +#define HAVE_EXP 1 +/* #undef HAVE_EXPF */ +#define HAVE_FABS 1 +/* #undef HAVE_FABSF */ +#define HAVE_FLOOR 1 +/* #undef HAVE_FLOORF */ +#define HAVE_FMOD 1 +/* #undef HAVE_FMODF */ +#define HAVE_LOG 1 +/* #undef HAVE_LOGF */ +#define HAVE_LOG10 1 +/* #undef HAVE_LOG10F */ +#define HAVE_POW 1 +/* #undef HAVE_POWF */ +#define HAVE_SIN 1 +/* #undef HAVE_SINF */ +/* #undef HAVE_SCALBN */ +/* #undef HAVE_SCALBNF */ +#define HAVE_SQRT 1 +/* #undef HAVE_SQRTF */ +#define HAVE_TAN 1 +/* #undef HAVE_TANF */ +/* #undef HAVE_TRUNC */ +/* #undef HAVE_TRUNCF */ +/* #undef HAVE_LROUND */ +/* #undef HAVE_LROUNDF */ +/* #undef HAVE_ROUND */ +/* #undef HAVE_ROUNDF */ + +#endif /* SDL_config_os2_h_ */ diff --git a/extlibs/sdl2/include/SDL_config_pandora.h b/extlibs/sdl2/include/SDL_config_pandora.h new file mode 100644 index 000000000..27b858df1 --- /dev/null +++ b/extlibs/sdl2/include/SDL_config_pandora.h @@ -0,0 +1,141 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_config_pandora_h_ +#define SDL_config_pandora_h_ +#define SDL_config_h_ + +/* This is a set of defines to configure the SDL features */ + +/* General platform specific identifiers */ +#include "SDL_platform.h" + +#ifdef __LP64__ +#define SIZEOF_VOIDP 8 +#else +#define SIZEOF_VOIDP 4 +#endif + +#define SDL_BYTEORDER 1234 + +#define STDC_HEADERS 1 +#define HAVE_ALLOCA_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_ICONV_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_MALLOC_H 1 +#define HAVE_MATH_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_SIGNAL_H 1 +#define HAVE_STDARG_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_STRING_H 1 +#define HAVE_SYS_TYPES_H 1 + +#define HAVE_DLOPEN 1 +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_SETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_BSEARCH 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_STRLEN 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_VSSCANF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_M_PI 1 +#define HAVE_CEIL 1 +#define HAVE_COPYSIGN 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_EXP 1 +#define HAVE_FABS 1 +#define HAVE_FLOOR 1 +#define HAVE_LOG 1 +#define HAVE_LOG10 1 +#define HAVE_LROUND 1 +#define HAVE_LROUNDF 1 +#define HAVE_ROUND 1 +#define HAVE_ROUNDF 1 +#define HAVE_SCALBN 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#define HAVE_SQRTF 1 +#define HAVE_TAN 1 +#define HAVE_TANF 1 +#define HAVE_TRUNC 1 +#define HAVE_TRUNCF 1 +#define HAVE_SIGACTION 1 +#define HAVE_SETJMP 1 +#define HAVE_NANOSLEEP 1 + +#define SDL_AUDIO_DRIVER_DUMMY 1 +#define SDL_AUDIO_DRIVER_OSS 1 + +#define SDL_INPUT_LINUXEV 1 +#define SDL_JOYSTICK_LINUX 1 +#define SDL_JOYSTICK_VIRTUAL 1 +#define SDL_HAPTIC_LINUX 1 + +#define SDL_SENSOR_DUMMY 1 + +#define SDL_LOADSO_DLOPEN 1 + +#define SDL_THREAD_PTHREAD 1 +#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1 + +#define SDL_TIMER_UNIX 1 +#define SDL_FILESYSTEM_UNIX 1 + +#define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_X11 1 +#define SDL_VIDEO_DRIVER_PANDORA 1 +#define SDL_VIDEO_RENDER_OGL_ES 1 +#define SDL_VIDEO_OPENGL_ES 1 + +#endif /* SDL_config_pandora_h_ */ diff --git a/extlibs/sdl2/include/SDL_config_windows.h b/extlibs/sdl2/include/SDL_config_windows.h new file mode 100644 index 000000000..aae52ebc6 --- /dev/null +++ b/extlibs/sdl2/include/SDL_config_windows.h @@ -0,0 +1,333 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_config_windows_h_ +#define SDL_config_windows_h_ +#define SDL_config_h_ + +#include "SDL_platform.h" + +/* winsdkver.h defines _WIN32_MAXVER for SDK version detection. It is present since at least the Windows 7 SDK, + * but out of caution we'll only use it if the compiler supports __has_include() to confirm its presence. + * If your compiler doesn't support __has_include() but you have winsdkver.h, define HAVE_WINSDKVER_H. */ +#if !defined(HAVE_WINSDKVER_H) && defined(__has_include) +#if __has_include() +#define HAVE_WINSDKVER_H 1 +#endif +#endif + +#ifdef HAVE_WINSDKVER_H +#include +#endif + +/* sdkddkver.h defines more specific SDK version numbers. This is needed because older versions of the + * Windows 10 SDK have broken declarations for the C API for DirectX 12. */ +#if !defined(HAVE_SDKDDKVER_H) && defined(__has_include) +#if __has_include() +#define HAVE_SDKDDKVER_H 1 +#endif +#endif + +#ifdef HAVE_SDKDDKVER_H +#include +#endif + +/* This is a set of defines to configure the SDL features */ + +#if !defined(HAVE_STDINT_H) && !defined(_STDINT_H_) +/* Most everything except Visual Studio 2008 and earlier has stdint.h now */ +#if defined(_MSC_VER) && (_MSC_VER < 1600) +typedef signed __int8 int8_t; +typedef unsigned __int8 uint8_t; +typedef signed __int16 int16_t; +typedef unsigned __int16 uint16_t; +typedef signed __int32 int32_t; +typedef unsigned __int32 uint32_t; +typedef signed __int64 int64_t; +typedef unsigned __int64 uint64_t; +#ifndef _UINTPTR_T_DEFINED +#ifdef _WIN64 +typedef unsigned __int64 uintptr_t; +#else +typedef unsigned int uintptr_t; +#endif +#define _UINTPTR_T_DEFINED +#endif +#else +#define HAVE_STDINT_H 1 +#endif /* Visual Studio 2008 */ +#endif /* !_STDINT_H_ && !HAVE_STDINT_H */ + +#ifdef _WIN64 +# define SIZEOF_VOIDP 8 +#else +# define SIZEOF_VOIDP 4 +#endif + +#ifdef __clang__ +# define HAVE_GCC_ATOMICS 1 +#endif + +#define HAVE_DDRAW_H 1 +#define HAVE_DINPUT_H 1 +#define HAVE_DSOUND_H 1 +#ifndef __WATCOMC__ +#define HAVE_DXGI_H 1 +#define HAVE_XINPUT_H 1 +#if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0A00 /* Windows 10 SDK */ +#define HAVE_WINDOWS_GAMING_INPUT_H 1 +#endif +#if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0602 /* Windows 8 SDK */ +#define HAVE_D3D11_H 1 +#define HAVE_ROAPI_H 1 +#endif +#if defined(__has_include) +#if __has_include() && __has_include() +#define HAVE_D3D12_H 1 +#endif +#endif +#if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0603 /* Windows 8.1 SDK */ +#define HAVE_SHELLSCALINGAPI_H 1 +#endif +#define HAVE_MMDEVICEAPI_H 1 +#define HAVE_AUDIOCLIENT_H 1 +#define HAVE_TPCSHRD_H 1 +#define HAVE_SENSORSAPI_H 1 +#endif +#if (defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64)) && (defined(_MSC_VER) && _MSC_VER >= 1600) +#define HAVE_IMMINTRIN_H 1 +#elif defined(__has_include) && (defined(__i386__) || defined(__x86_64)) +# if __has_include() +# define HAVE_IMMINTRIN_H 1 +# endif +#endif + +/* This is disabled by default to avoid C runtime dependencies and manifest requirements */ +#ifdef HAVE_LIBC +/* Useful headers */ +#define STDC_HEADERS 1 +#define HAVE_CTYPE_H 1 +#define HAVE_FLOAT_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STRING_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +/* OpenWatcom requires specific calling conventions for qsort and bsearch */ +#ifndef __WATCOMC__ +#define HAVE_QSORT 1 +#define HAVE_BSEARCH 1 +#endif +#define HAVE_ABS 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE__STRREV 1 +/* These functions have security warnings, so we won't use them */ +/* #undef HAVE__STRUPR */ +/* #undef HAVE__STRLWR */ +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +/* #undef HAVE_STRTOK_R */ +/* These functions have security warnings, so we won't use them */ +/* #undef HAVE__LTOA */ +/* #undef HAVE__ULTOA */ +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE__STRICMP 1 +#define HAVE__STRNICMP 1 +#define HAVE__WCSICMP 1 +#define HAVE__WCSNICMP 1 +#define HAVE__WCSDUP 1 +#define HAVE_ACOS 1 +#define HAVE_ASIN 1 +#define HAVE_ATAN 1 +#define HAVE_ATAN2 1 +#define HAVE_CEIL 1 +#define HAVE_COS 1 +#define HAVE_EXP 1 +#define HAVE_FABS 1 +#define HAVE_FLOOR 1 +#define HAVE_FMOD 1 +#define HAVE_LOG 1 +#define HAVE_LOG10 1 +#define HAVE_POW 1 +#define HAVE_SIN 1 +#define HAVE_SQRT 1 +#define HAVE_TAN 1 +#ifndef __WATCOMC__ +#define HAVE_ACOSF 1 +#define HAVE_ASINF 1 +#define HAVE_ATANF 1 +#define HAVE_ATAN2F 1 +#define HAVE_CEILF 1 +#define HAVE__COPYSIGN 1 +#define HAVE_COSF 1 +#define HAVE_EXPF 1 +#define HAVE_FABSF 1 +#define HAVE_FLOORF 1 +#define HAVE_FMODF 1 +#define HAVE_LOGF 1 +#define HAVE_LOG10F 1 +#define HAVE_POWF 1 +#define HAVE_SINF 1 +#define HAVE_SQRTF 1 +#define HAVE_TANF 1 +#endif +#if defined(_MSC_VER) +/* These functions were added with the VC++ 2013 C runtime library */ +#if _MSC_VER >= 1800 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_VSSCANF 1 +#define HAVE_LROUND 1 +#define HAVE_LROUNDF 1 +#define HAVE_ROUND 1 +#define HAVE_ROUNDF 1 +#define HAVE_SCALBN 1 +#define HAVE_SCALBNF 1 +#define HAVE_TRUNC 1 +#define HAVE_TRUNCF 1 +#endif +/* This function is available with at least the VC++ 2008 C runtime library */ +#if _MSC_VER >= 1400 +#define HAVE__FSEEKI64 1 +#endif +#ifdef _USE_MATH_DEFINES +#define HAVE_M_PI 1 +#endif +#elif defined(__WATCOMC__) +#define HAVE__FSEEKI64 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_VSSCANF 1 +#define HAVE_ROUND 1 +#define HAVE_SCALBN 1 +#define HAVE_TRUNC 1 +#else +#define HAVE_M_PI 1 +#endif +#else +#define HAVE_STDARG_H 1 +#define HAVE_STDDEF_H 1 +#endif + +/* Enable various audio drivers */ +#if defined(HAVE_MMDEVICEAPI_H) && defined(HAVE_AUDIOCLIENT_H) +#define SDL_AUDIO_DRIVER_WASAPI 1 +#endif +#define SDL_AUDIO_DRIVER_DSOUND 1 +#define SDL_AUDIO_DRIVER_WINMM 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_DINPUT 1 +#define SDL_JOYSTICK_HIDAPI 1 +#ifndef __WINRT__ +#define SDL_JOYSTICK_RAWINPUT 1 +#endif +#define SDL_JOYSTICK_VIRTUAL 1 +#ifdef HAVE_WINDOWS_GAMING_INPUT_H +#define SDL_JOYSTICK_WGI 1 +#endif +#define SDL_JOYSTICK_XINPUT 1 +#define SDL_HAPTIC_DINPUT 1 +#define SDL_HAPTIC_XINPUT 1 + +/* Enable the sensor driver */ +#ifdef HAVE_SENSORSAPI_H +#define SDL_SENSOR_WINDOWS 1 +#else +#define SDL_SENSOR_DUMMY 1 +#endif + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_WINDOWS 1 + +/* Enable various threading systems */ +#define SDL_THREAD_GENERIC_COND_SUFFIX 1 +#define SDL_THREAD_WINDOWS 1 + +/* Enable various timer systems */ +#define SDL_TIMER_WINDOWS 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_WINDOWS 1 + +#ifndef SDL_VIDEO_RENDER_D3D +#define SDL_VIDEO_RENDER_D3D 1 +#endif +#if !defined(SDL_VIDEO_RENDER_D3D11) && defined(HAVE_D3D11_H) +#define SDL_VIDEO_RENDER_D3D11 1 +#endif +#if !defined(SDL_VIDEO_RENDER_D3D12) && defined(HAVE_D3D12_H) +#define SDL_VIDEO_RENDER_D3D12 1 +#endif + +/* Enable OpenGL support */ +#ifndef SDL_VIDEO_OPENGL +#define SDL_VIDEO_OPENGL 1 +#endif +#ifndef SDL_VIDEO_OPENGL_WGL +#define SDL_VIDEO_OPENGL_WGL 1 +#endif +#ifndef SDL_VIDEO_RENDER_OGL +#define SDL_VIDEO_RENDER_OGL 1 +#endif +#ifndef SDL_VIDEO_RENDER_OGL_ES2 +#define SDL_VIDEO_RENDER_OGL_ES2 1 +#endif +#ifndef SDL_VIDEO_OPENGL_ES2 +#define SDL_VIDEO_OPENGL_ES2 1 +#endif +#ifndef SDL_VIDEO_OPENGL_EGL +#define SDL_VIDEO_OPENGL_EGL 1 +#endif + +/* Enable Vulkan support */ +#define SDL_VIDEO_VULKAN 1 + +/* Enable system power support */ +#define SDL_POWER_WINDOWS 1 + +/* Enable filesystem support */ +#define SDL_FILESYSTEM_WINDOWS 1 + +#endif /* SDL_config_windows_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/extlibs/sdl2/include/SDL_config_wingdk.h b/extlibs/sdl2/include/SDL_config_wingdk.h new file mode 100644 index 000000000..c2a63b5ba --- /dev/null +++ b/extlibs/sdl2/include/SDL_config_wingdk.h @@ -0,0 +1,253 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_config_wingdk_h_ +#define SDL_config_wingdk_h_ +#define SDL_config_h_ + +#include "SDL_platform.h" + +/* Windows GDK does not need Windows SDK version checks because it requires + * a recent version of the Windows 10 SDK. */ + +/* GDK only supports 64-bit */ +# define SIZEOF_VOIDP 8 + +#ifdef __clang__ +# define HAVE_GCC_ATOMICS 1 +#endif + +#define HAVE_DDRAW_H 1 +#define HAVE_DINPUT_H 1 +#define HAVE_DSOUND_H 1 +/* No SDK version checks needed for these because the SDK has to be new. */ +#define HAVE_DXGI_H 1 +#define HAVE_XINPUT_H 1 +#define HAVE_WINDOWS_GAMING_INPUT_H 1 +#define HAVE_D3D11_H 1 +#define HAVE_ROAPI_H 1 +#define HAVE_D3D12_H 1 +#define HAVE_SHELLSCALINGAPI_H 1 +#define HAVE_MMDEVICEAPI_H 1 +#define HAVE_AUDIOCLIENT_H 1 +#define HAVE_TPCSHRD_H 1 +#define HAVE_SENSORSAPI_H 1 +#if (defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64)) && (defined(_MSC_VER) && _MSC_VER >= 1600) +#define HAVE_IMMINTRIN_H 1 +#elif defined(__has_include) && (defined(__i386__) || defined(__x86_64)) +# if __has_include() +# define HAVE_IMMINTRIN_H 1 +# endif +#endif + +/* This is disabled by default to avoid C runtime dependencies and manifest requirements */ +#ifdef HAVE_LIBC +/* Useful headers */ +#define STDC_HEADERS 1 +#define HAVE_CTYPE_H 1 +#define HAVE_FLOAT_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STRING_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_QSORT 1 +#define HAVE_BSEARCH 1 +#define HAVE_ABS 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE__STRREV 1 +/* These functions have security warnings, so we won't use them */ +/* #undef HAVE__STRUPR */ +/* #undef HAVE__STRLWR */ +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +/* #undef HAVE_STRTOK_R */ +/* These functions have security warnings, so we won't use them */ +/* #undef HAVE__LTOA */ +/* #undef HAVE__ULTOA */ +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE__STRICMP 1 +#define HAVE__STRNICMP 1 +#define HAVE__WCSICMP 1 +#define HAVE__WCSNICMP 1 +#define HAVE__WCSDUP 1 +#define HAVE_ACOS 1 +#define HAVE_ASIN 1 +#define HAVE_ATAN 1 +#define HAVE_ATAN2 1 +#define HAVE_CEIL 1 +#define HAVE_COS 1 +#define HAVE_EXP 1 +#define HAVE_FABS 1 +#define HAVE_FLOOR 1 +#define HAVE_FMOD 1 +#define HAVE_LOG 1 +#define HAVE_LOG10 1 +#define HAVE_POW 1 +#define HAVE_SIN 1 +#define HAVE_SQRT 1 +#define HAVE_TAN 1 +#define HAVE_ACOSF 1 +#define HAVE_ASINF 1 +#define HAVE_ATANF 1 +#define HAVE_ATAN2F 1 +#define HAVE_CEILF 1 +#define HAVE__COPYSIGN 1 +#define HAVE_COSF 1 +#define HAVE_EXPF 1 +#define HAVE_FABSF 1 +#define HAVE_FLOORF 1 +#define HAVE_FMODF 1 +#define HAVE_LOGF 1 +#define HAVE_LOG10F 1 +#define HAVE_POWF 1 +#define HAVE_SINF 1 +#define HAVE_SQRTF 1 +#define HAVE_TANF 1 +#if defined(_MSC_VER) +/* These functions were added with the VC++ 2013 C runtime library */ +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_VSSCANF 1 +#define HAVE_LROUND 1 +#define HAVE_LROUNDF 1 +#define HAVE_ROUND 1 +#define HAVE_ROUNDF 1 +#define HAVE_SCALBN 1 +#define HAVE_SCALBNF 1 +#define HAVE_TRUNC 1 +#define HAVE_TRUNCF 1 +#define HAVE__FSEEKI64 1 +#ifdef _USE_MATH_DEFINES +#define HAVE_M_PI 1 +#endif +#else +#define HAVE_M_PI 1 +#endif +#else +#define HAVE_STDARG_H 1 +#define HAVE_STDDEF_H 1 +#define HAVE_STDINT_H 1 +#endif + +/* Enable various audio drivers */ +#if defined(HAVE_MMDEVICEAPI_H) && defined(HAVE_AUDIOCLIENT_H) +#define SDL_AUDIO_DRIVER_WASAPI 1 +#endif +#define SDL_AUDIO_DRIVER_DSOUND 1 +#define SDL_AUDIO_DRIVER_WINMM 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_DINPUT 1 +#define SDL_JOYSTICK_HIDAPI 1 +#define SDL_JOYSTICK_RAWINPUT 1 +#define SDL_JOYSTICK_VIRTUAL 1 +#ifdef HAVE_WINDOWS_GAMING_INPUT_H +#define SDL_JOYSTICK_WGI 1 +#endif +#define SDL_JOYSTICK_XINPUT 1 +#define SDL_HAPTIC_DINPUT 1 +#define SDL_HAPTIC_XINPUT 1 + +/* Enable the sensor driver */ +#ifdef HAVE_SENSORSAPI_H +#define SDL_SENSOR_WINDOWS 1 +#else +#define SDL_SENSOR_DUMMY 1 +#endif + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_WINDOWS 1 + +/* Enable various threading systems */ +#define SDL_THREAD_GENERIC_COND_SUFFIX 1 +#define SDL_THREAD_WINDOWS 1 + +/* Enable various timer systems */ +#define SDL_TIMER_WINDOWS 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_WINDOWS 1 + +#ifndef SDL_VIDEO_RENDER_D3D +#define SDL_VIDEO_RENDER_D3D 1 +#endif +#if !defined(SDL_VIDEO_RENDER_D3D11) && defined(HAVE_D3D11_H) +#define SDL_VIDEO_RENDER_D3D11 1 +#endif +#if !defined(SDL_VIDEO_RENDER_D3D12) && defined(HAVE_D3D12_H) +#define SDL_VIDEO_RENDER_D3D12 1 +#endif + +/* Enable OpenGL support */ +#ifndef SDL_VIDEO_OPENGL +#define SDL_VIDEO_OPENGL 1 +#endif +#ifndef SDL_VIDEO_OPENGL_WGL +#define SDL_VIDEO_OPENGL_WGL 1 +#endif +#ifndef SDL_VIDEO_RENDER_OGL +#define SDL_VIDEO_RENDER_OGL 1 +#endif +#ifndef SDL_VIDEO_RENDER_OGL_ES2 +#define SDL_VIDEO_RENDER_OGL_ES2 1 +#endif +#ifndef SDL_VIDEO_OPENGL_ES2 +#define SDL_VIDEO_OPENGL_ES2 1 +#endif +#ifndef SDL_VIDEO_OPENGL_EGL +#define SDL_VIDEO_OPENGL_EGL 1 +#endif + +/* Enable Vulkan support */ +#define SDL_VIDEO_VULKAN 1 + +/* Enable system power support */ +#define SDL_POWER_WINDOWS 1 + +/* Enable filesystem support */ +#define SDL_FILESYSTEM_WINDOWS 1 + +#endif /* SDL_config_wingdk_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/extlibs/sdl2/include/SDL_config_winrt.h b/extlibs/sdl2/include/SDL_config_winrt.h new file mode 100644 index 000000000..3a1145643 --- /dev/null +++ b/extlibs/sdl2/include/SDL_config_winrt.h @@ -0,0 +1,220 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_config_winrt_h_ +#define SDL_config_winrt_h_ +#define SDL_config_h_ + +#include "SDL_platform.h" + +/* Make sure the Windows SDK's NTDDI_VERSION macro gets defined. This is used + by SDL to determine which version of the Windows SDK is being used. +*/ +#include + +/* Define possibly-undefined NTDDI values (used when compiling SDL against + older versions of the Windows SDK. +*/ +#ifndef NTDDI_WINBLUE +#define NTDDI_WINBLUE 0x06030000 +#endif +#ifndef NTDDI_WIN10 +#define NTDDI_WIN10 0x0A000000 +#endif + +/* This is a set of defines to configure the SDL features */ + +#ifdef _WIN64 +# define SIZEOF_VOIDP 8 +#else +# define SIZEOF_VOIDP 4 +#endif + +#ifdef __clang__ +# define HAVE_GCC_ATOMICS 1 +#endif + +/* Useful headers */ +#define HAVE_DXGI_H 1 +#if !SDL_WINAPI_FAMILY_PHONE +#define HAVE_XINPUT_H 1 +#endif + +#define HAVE_MMDEVICEAPI_H 1 +#define HAVE_AUDIOCLIENT_H 1 +#define HAVE_TPCSHRD_H 1 + +#define HAVE_LIBC 1 +#define STDC_HEADERS 1 +#define HAVE_CTYPE_H 1 +#define HAVE_FLOAT_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STRING_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_QSORT 1 +#define HAVE_BSEARCH 1 +#define HAVE_ABS 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE__STRREV 1 +#define HAVE__STRUPR 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +/* #undef HAVE_STRTOLL */ +/* #undef HAVE_STRTOULL */ +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE__STRICMP 1 +#define HAVE__STRNICMP 1 +#define HAVE_VSNPRINTF 1 +/* TODO, WinRT: consider using ??_s versions of the following */ +/* #undef HAVE__STRLWR */ +/* #undef HAVE_ITOA */ +/* #undef HAVE__LTOA */ +/* #undef HAVE__ULTOA */ +/* #undef HAVE_SSCANF */ +#define HAVE_M_PI 1 +#define HAVE_ACOS 1 +#define HAVE_ACOSF 1 +#define HAVE_ASIN 1 +#define HAVE_ASINF 1 +#define HAVE_ATAN 1 +#define HAVE_ATANF 1 +#define HAVE_ATAN2 1 +#define HAVE_ATAN2F 1 +#define HAVE_CEIL 1 +#define HAVE_CEILF 1 +#define HAVE__COPYSIGN 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_EXP 1 +#define HAVE_EXPF 1 +#define HAVE_FABS 1 +#define HAVE_FABSF 1 +#define HAVE_FLOOR 1 +#define HAVE_FLOORF 1 +#define HAVE_FMOD 1 +#define HAVE_FMODF 1 +#define HAVE_LOG 1 +#define HAVE_LOGF 1 +#define HAVE_LOG10 1 +#define HAVE_LOG10F 1 +#define HAVE_LROUND 1 +#define HAVE_LROUNDF 1 +#define HAVE_POW 1 +#define HAVE_POWF 1 +#define HAVE_ROUND 1 +#define HAVE_ROUNDF 1 +#define HAVE__SCALB 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#define HAVE_SQRTF 1 +#define HAVE_TAN 1 +#define HAVE_TANF 1 +#define HAVE_TRUNC 1 +#define HAVE_TRUNCF 1 +#define HAVE__FSEEKI64 1 + +#define HAVE_ROAPI_H 1 + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_WASAPI 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various input drivers */ +#if SDL_WINAPI_FAMILY_PHONE +#define SDL_JOYSTICK_DISABLED 1 +#define SDL_HAPTIC_DISABLED 1 +#else +#define SDL_JOYSTICK_VIRTUAL 1 +#if (NTDDI_VERSION >= NTDDI_WIN10) +#define SDL_JOYSTICK_WGI 1 +#define SDL_HAPTIC_DISABLED 1 +#else +#define SDL_JOYSTICK_XINPUT 1 +#define SDL_HAPTIC_XINPUT 1 +#endif /* WIN10 */ +#endif + +/* WinRT doesn't have HIDAPI available */ +#define SDL_HIDAPI_DISABLED 1 + +/* Enable the dummy sensor driver */ +#define SDL_SENSOR_DUMMY 1 + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_WINDOWS 1 + +/* Enable various threading systems */ +#if (NTDDI_VERSION >= NTDDI_WINBLUE) +#define SDL_THREAD_GENERIC_COND_SUFFIX 1 +#define SDL_THREAD_WINDOWS 1 +#else +/* WinRT on Windows 8.0 and Windows Phone 8.0 don't support CreateThread() */ +#define SDL_THREAD_STDCPP 1 +#endif + +/* Enable various timer systems */ +#define SDL_TIMER_WINDOWS 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_WINRT 1 +#define SDL_VIDEO_DRIVER_DUMMY 1 + +/* Enable OpenGL ES 2.0 (via a modified ANGLE library) */ +#define SDL_VIDEO_OPENGL_ES2 1 +#define SDL_VIDEO_OPENGL_EGL 1 + +/* Enable appropriate renderer(s) */ +#define SDL_VIDEO_RENDER_D3D11 1 + +/* Disable D3D12 as it's not implemented for WinRT */ +/* #undef SDL_VIDEO_RENDER_D3D12 */ + +#ifdef SDL_VIDEO_OPENGL_ES2 +#define SDL_VIDEO_RENDER_OGL_ES2 1 +#endif + +/* Enable system power support */ +#define SDL_POWER_WINRT 1 + +#endif /* SDL_config_winrt_h_ */ diff --git a/extlibs/sdl2/include/SDL_config_xbox.h b/extlibs/sdl2/include/SDL_config_xbox.h new file mode 100644 index 000000000..a2ea8cbac --- /dev/null +++ b/extlibs/sdl2/include/SDL_config_xbox.h @@ -0,0 +1,240 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_config_wingdk_h_ +#define SDL_config_wingdk_h_ +#define SDL_config_h_ + +#include "SDL_platform.h" + +/* Windows GDK does not need Windows SDK version checks because it requires + * a recent version of the Windows 10 SDK. */ + +/* GDK only supports 64-bit */ +# define SIZEOF_VOIDP 8 + +#ifdef __clang__ +# define HAVE_GCC_ATOMICS 1 +#endif + +/*#define HAVE_DDRAW_H 1*/ +/*#define HAVE_DINPUT_H 1*/ +/*#define HAVE_DSOUND_H 1*/ +/* No SDK version checks needed for these because the SDK has to be new. */ +/* #define HAVE_DXGI_H 1 */ +#define HAVE_XINPUT_H 1 +/*#define HAVE_WINDOWS_GAMING_INPUT_H 1*/ +/*#define HAVE_D3D11_H 1*/ +/*#define HAVE_ROAPI_H 1*/ +#define HAVE_D3D12_H 1 +/*#define HAVE_SHELLSCALINGAPI_H 1*/ +#define HAVE_MMDEVICEAPI_H 1 +#define HAVE_AUDIOCLIENT_H 1 +/*#define HAVE_TPCSHRD_H 1*/ +/*#define HAVE_SENSORSAPI_H 1*/ +#if (defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64)) && (defined(_MSC_VER) && _MSC_VER >= 1600) +#define HAVE_IMMINTRIN_H 1 +#elif defined(__has_include) && (defined(__i386__) || defined(__x86_64)) +# if __has_include() +# define HAVE_IMMINTRIN_H 1 +# endif +#endif + +/* This is disabled by default to avoid C runtime dependencies and manifest requirements */ +#ifdef HAVE_LIBC +/* Useful headers */ +#define STDC_HEADERS 1 +#define HAVE_CTYPE_H 1 +#define HAVE_FLOAT_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STRING_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_QSORT 1 +#define HAVE_BSEARCH 1 +#define HAVE_ABS 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE__STRREV 1 +/* These functions have security warnings, so we won't use them */ +/* #undef HAVE__STRUPR */ +/* #undef HAVE__STRLWR */ +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +/* #undef HAVE_STRTOK_R */ +/* These functions have security warnings, so we won't use them */ +/* #undef HAVE__LTOA */ +/* #undef HAVE__ULTOA */ +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE__STRICMP 1 +#define HAVE__STRNICMP 1 +#define HAVE__WCSICMP 1 +#define HAVE__WCSNICMP 1 +#define HAVE__WCSDUP 1 +#define HAVE_ACOS 1 +#define HAVE_ASIN 1 +#define HAVE_ATAN 1 +#define HAVE_ATAN2 1 +#define HAVE_CEIL 1 +#define HAVE_COS 1 +#define HAVE_EXP 1 +#define HAVE_FABS 1 +#define HAVE_FLOOR 1 +#define HAVE_FMOD 1 +#define HAVE_LOG 1 +#define HAVE_LOG10 1 +#define HAVE_POW 1 +#define HAVE_SIN 1 +#define HAVE_SQRT 1 +#define HAVE_TAN 1 +#define HAVE_ACOSF 1 +#define HAVE_ASINF 1 +#define HAVE_ATANF 1 +#define HAVE_ATAN2F 1 +#define HAVE_CEILF 1 +#define HAVE__COPYSIGN 1 +#define HAVE_COSF 1 +#define HAVE_EXPF 1 +#define HAVE_FABSF 1 +#define HAVE_FLOORF 1 +#define HAVE_FMODF 1 +#define HAVE_LOGF 1 +#define HAVE_LOG10F 1 +#define HAVE_POWF 1 +#define HAVE_SINF 1 +#define HAVE_SQRTF 1 +#define HAVE_TANF 1 +#if defined(_MSC_VER) +/* These functions were added with the VC++ 2013 C runtime library */ +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_VSSCANF 1 +#define HAVE_LROUND 1 +#define HAVE_LROUNDF 1 +#define HAVE_ROUND 1 +#define HAVE_ROUNDF 1 +#define HAVE_SCALBN 1 +#define HAVE_SCALBNF 1 +#define HAVE_TRUNC 1 +#define HAVE_TRUNCF 1 +#define HAVE__FSEEKI64 1 +#ifdef _USE_MATH_DEFINES +#define HAVE_M_PI 1 +#endif +#else +#define HAVE_M_PI 1 +#endif +#else +#define HAVE_STDARG_H 1 +#define HAVE_STDDEF_H 1 +#define HAVE_STDINT_H 1 +#endif + +/* Enable various audio drivers */ +#if defined(HAVE_MMDEVICEAPI_H) && defined(HAVE_AUDIOCLIENT_H) +#define SDL_AUDIO_DRIVER_WASAPI 1 +#endif +/*#define SDL_AUDIO_DRIVER_DSOUND 1*/ +/*#define SDL_AUDIO_DRIVER_WINMM 1*/ +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various input drivers */ +/*#define SDL_JOYSTICK_DINPUT 1*/ +/*#define SDL_JOYSTICK_HIDAPI 1*/ +/*#define SDL_JOYSTICK_RAWINPUT 1*/ +#define SDL_JOYSTICK_VIRTUAL 1 +#ifdef HAVE_WINDOWS_GAMING_INPUT_H +#define SDL_JOYSTICK_WGI 1 +#endif +#define SDL_JOYSTICK_XINPUT 1 +/*#define SDL_HAPTIC_DINPUT 1*/ +#define SDL_HAPTIC_XINPUT 1 + +/* Enable the sensor driver */ +#ifdef HAVE_SENSORSAPI_H +#define SDL_SENSOR_WINDOWS 1 +#else +#define SDL_SENSOR_DUMMY 1 +#endif + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_WINDOWS 1 + +/* Enable various threading systems */ +#define SDL_THREAD_GENERIC_COND_SUFFIX 1 +#define SDL_THREAD_WINDOWS 1 + +/* Enable various timer systems */ +#define SDL_TIMER_WINDOWS 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_WINDOWS 1 + +#if !defined(SDL_VIDEO_RENDER_D3D12) && defined(HAVE_D3D12_H) +#define SDL_VIDEO_RENDER_D3D12 1 +#endif + +/* Enable OpenGL support */ +#ifndef SDL_VIDEO_OPENGL +#define SDL_VIDEO_OPENGL 1 +#endif +#ifndef SDL_VIDEO_OPENGL_WGL +#define SDL_VIDEO_OPENGL_WGL 1 +#endif +#ifndef SDL_VIDEO_RENDER_OGL +#define SDL_VIDEO_RENDER_OGL 1 +#endif + +/* Enable system power support */ +/*#define SDL_POWER_WINDOWS 1*/ +#define SDL_POWER_HARDWIRED 1 + +/* Enable filesystem support */ +/* #define SDL_FILESYSTEM_WINDOWS 1*/ +#define SDL_FILESYSTEM_XBOX 1 + +/* Disable IME as not supported yet (TODO: Xbox IME?) */ +#define SDL_DISABLE_WINDOWS_IME 1 + +#endif /* SDL_config_wingdk_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/extlibs/sdl2/include/SDL_copying.h b/extlibs/sdl2/include/SDL_copying.h new file mode 100644 index 000000000..da9089312 --- /dev/null +++ b/extlibs/sdl2/include/SDL_copying.h @@ -0,0 +1,20 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ diff --git a/extlibs/sdl2/include/SDL_hints.h b/extlibs/sdl2/include/SDL_hints.h index e775a6509..8c38d86ed 100644 --- a/extlibs/sdl2/include/SDL_hints.h +++ b/extlibs/sdl2/include/SDL_hints.h @@ -1424,7 +1424,19 @@ extern "C" { #define SDL_HINT_MOUSE_RELATIVE_WARP_MOTION "SDL_MOUSE_RELATIVE_WARP_MOTION" /** - * \brief A variable controlling whether mouse events should generate synthetic touch events + * \brief A variable controlling whether the hardware cursor stays visible when relative mode is active. + * + * This variable can be set to the following values: + * "0" - The cursor will be hidden while relative mode is active (default) + * "1" - The cursor will remain visible while relative mode is active + * + * Note that for systems without raw hardware inputs, relative mode is implemented using warping, so the hardware cursor will visibly warp between frames if this is enabled on those systems. + */ +#define SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE "SDL_MOUSE_RELATIVE_CURSOR_VISIBLE" + +/** + * A variable controlling whether mouse events should generate synthetic touch + * events * * This variable can be set to the following values: * "0" - Mouse events will not generate touch events (default for desktop platforms) @@ -1900,6 +1912,7 @@ extern "C" { * Since it's driver-specific, it's only supported where possible and * implemented. Currently supported the following drivers: * + * - Wayland (wayland) * - KMSDRM (kmsdrm) * - Raspberry Pi (raspberrypi) */ diff --git a/extlibs/sdl2/include/SDL_joystick.h b/extlibs/sdl2/include/SDL_joystick.h index 561e01099..7a3faf841 100644 --- a/extlibs/sdl2/include/SDL_joystick.h +++ b/extlibs/sdl2/include/SDL_joystick.h @@ -790,12 +790,17 @@ extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void); * **WARNING**: Calling this function may delete all events currently in SDL's * event queue. * - * \param state can be one of `SDL_QUERY`, `SDL_IGNORE`, or `SDL_ENABLE` - * \returns 1 if enabled, 0 if disabled, or a negative error code on failure; - * call SDL_GetError() for more information. + * While `param` is meant to be one of `SDL_QUERY`, `SDL_IGNORE`, or + * `SDL_ENABLE`, this function accepts any value, with any non-zero value that + * isn't `SDL_QUERY` being treated as `SDL_ENABLE`. * - * If `state` is `SDL_QUERY` then the current state is returned, - * otherwise the new processing state is returned. + * If SDL was built with events disabled (extremely uncommon!), this will + * do nothing and always return `SDL_IGNORE`. + * + * \param state can be one of `SDL_QUERY`, `SDL_IGNORE`, or `SDL_ENABLE` + * \returns If `state` is `SDL_QUERY` then the current state is returned, + * otherwise `state` is returned (even if it was not one of the + * allowed values). * * \since This function is available since SDL 2.0.0. * diff --git a/extlibs/sdl2/include/SDL_platform.h b/extlibs/sdl2/include/SDL_platform.h index e8bf11acf..2b11bf201 100644 --- a/extlibs/sdl2/include/SDL_platform.h +++ b/extlibs/sdl2/include/SDL_platform.h @@ -73,7 +73,13 @@ #if defined(__APPLE__) /* lets us know what version of Mac OS X we're compiling on */ #include +#ifndef __has_extension /* Older compilers don't support this */ +#define __has_extension(x) 0 #include +#undef __has_extension +#else +#include +#endif /* Fix building with older SDKs that don't define these See this for more information: diff --git a/extlibs/sdl2/include/SDL_revision.h b/extlibs/sdl2/include/SDL_revision.h index fea1e8739..36691f553 100644 --- a/extlibs/sdl2/include/SDL_revision.h +++ b/extlibs/sdl2/include/SDL_revision.h @@ -1,7 +1,6 @@ -/* Generated by updaterev.sh, do not edit */ #ifdef SDL_VENDOR_INFO -#define SDL_REVISION "SDL-release-2.30.3-0-gfb1497566 (" SDL_VENDOR_INFO ")" +#define SDL_REVISION SDL_VENDOR_INFO #else -#define SDL_REVISION "SDL-release-2.30.3-0-gfb1497566" +#define SDL_REVISION "" #endif #define SDL_REVISION_NUMBER 0 diff --git a/extlibs/sdl2/include/SDL_revision.h.cmake b/extlibs/sdl2/include/SDL_revision.h.cmake new file mode 100644 index 000000000..84e5f414a --- /dev/null +++ b/extlibs/sdl2/include/SDL_revision.h.cmake @@ -0,0 +1,8 @@ +#cmakedefine SDL_VENDOR_INFO "@SDL_VENDOR_INFO@" +#define SDL_REVISION_NUMBER 0 + +#ifdef SDL_VENDOR_INFO +#define SDL_REVISION "@SDL_REVISION@ (" SDL_VENDOR_INFO ")" +#else +#define SDL_REVISION "@SDL_REVISION@" +#endif diff --git a/extlibs/sdl2/include/SDL_stdinc.h b/extlibs/sdl2/include/SDL_stdinc.h index 8c22283af..8113f453f 100644 --- a/extlibs/sdl2/include/SDL_stdinc.h +++ b/extlibs/sdl2/include/SDL_stdinc.h @@ -253,10 +253,10 @@ typedef uint64_t Uint64; * should define these but this is not true all platforms. * (for example win32) */ #ifndef SDL_PRIs64 -#ifdef PRIs64 -#define SDL_PRIs64 PRIs64 -#elif defined(__WIN32__) || defined(__GDK__) +#if defined(__WIN32__) || defined(__GDK__) #define SDL_PRIs64 "I64d" +#elif defined(PRIs64) +#define SDL_PRIs64 PRIs64 #elif defined(__LP64__) && !defined(__APPLE__) #define SDL_PRIs64 "ld" #else @@ -264,10 +264,10 @@ typedef uint64_t Uint64; #endif #endif #ifndef SDL_PRIu64 -#ifdef PRIu64 -#define SDL_PRIu64 PRIu64 -#elif defined(__WIN32__) || defined(__GDK__) +#if defined(__WIN32__) || defined(__GDK__) #define SDL_PRIu64 "I64u" +#elif defined(PRIu64) +#define SDL_PRIu64 PRIu64 #elif defined(__LP64__) && !defined(__APPLE__) #define SDL_PRIu64 "lu" #else @@ -275,10 +275,10 @@ typedef uint64_t Uint64; #endif #endif #ifndef SDL_PRIx64 -#ifdef PRIx64 -#define SDL_PRIx64 PRIx64 -#elif defined(__WIN32__) || defined(__GDK__) +#if defined(__WIN32__) || defined(__GDK__) #define SDL_PRIx64 "I64x" +#elif defined(PRIx64) +#define SDL_PRIx64 PRIx64 #elif defined(__LP64__) && !defined(__APPLE__) #define SDL_PRIx64 "lx" #else @@ -286,10 +286,10 @@ typedef uint64_t Uint64; #endif #endif #ifndef SDL_PRIX64 -#ifdef PRIX64 -#define SDL_PRIX64 PRIX64 -#elif defined(__WIN32__) || defined(__GDK__) +#if defined(__WIN32__) || defined(__GDK__) #define SDL_PRIX64 "I64X" +#elif defined(PRIX64) +#define SDL_PRIX64 PRIX64 #elif defined(__LP64__) && !defined(__APPLE__) #define SDL_PRIX64 "lX" #else @@ -377,9 +377,12 @@ typedef uint64_t Uint64; #ifndef SDL_COMPILE_TIME_ASSERT #if defined(__cplusplus) +/* Keep C++ case alone: Some versions of gcc will define __STDC_VERSION__ even when compiling in C++ mode. */ #if (__cplusplus >= 201103L) #define SDL_COMPILE_TIME_ASSERT(name, x) static_assert(x, #x) #endif +#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L) +#define SDL_COMPILE_TIME_ASSERT(name, x) static_assert(x, #x) #elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) #define SDL_COMPILE_TIME_ASSERT(name, x) _Static_assert(x, #x) #endif diff --git a/extlibs/sdl2/include/SDL_version.h b/extlibs/sdl2/include/SDL_version.h index b7b7f39b6..dc8a254fa 100644 --- a/extlibs/sdl2/include/SDL_version.h +++ b/extlibs/sdl2/include/SDL_version.h @@ -59,7 +59,7 @@ typedef struct SDL_version */ #define SDL_MAJOR_VERSION 2 #define SDL_MINOR_VERSION 30 -#define SDL_PATCHLEVEL 3 +#define SDL_PATCHLEVEL 8 /** * Macro to determine SDL version program was compiled against. diff --git a/extlibs/sdl2/lib/x64/SDL2.dll b/extlibs/sdl2/lib/x64/SDL2.dll index cdc850ffe..cebf26ff5 100644 Binary files a/extlibs/sdl2/lib/x64/SDL2.dll and b/extlibs/sdl2/lib/x64/SDL2.dll differ diff --git a/extlibs/sdl2/lib/x64/SDL2.lib b/extlibs/sdl2/lib/x64/SDL2.lib index 7257de638..cee536c1f 100644 Binary files a/extlibs/sdl2/lib/x64/SDL2.lib and b/extlibs/sdl2/lib/x64/SDL2.lib differ diff --git a/extlibs/sdl2/lib/x64/SDL2.pdb b/extlibs/sdl2/lib/x64/SDL2.pdb new file mode 100644 index 000000000..95d09bec2 Binary files /dev/null and b/extlibs/sdl2/lib/x64/SDL2.pdb differ diff --git a/extlibs/sdl2/lib/x64/SDL2main.lib b/extlibs/sdl2/lib/x64/SDL2main.lib index 1981305fc..402b4c75a 100644 Binary files a/extlibs/sdl2/lib/x64/SDL2main.lib and b/extlibs/sdl2/lib/x64/SDL2main.lib differ diff --git a/extlibs/sdl2/lib/x86/SDL2.dll b/extlibs/sdl2/lib/x86/SDL2.dll index c7acf7482..3b994ad4d 100644 Binary files a/extlibs/sdl2/lib/x86/SDL2.dll and b/extlibs/sdl2/lib/x86/SDL2.dll differ diff --git a/extlibs/sdl2/lib/x86/SDL2.lib b/extlibs/sdl2/lib/x86/SDL2.lib index 0ac84d292..f7f8d2c25 100644 Binary files a/extlibs/sdl2/lib/x86/SDL2.lib and b/extlibs/sdl2/lib/x86/SDL2.lib differ diff --git a/extlibs/sdl2/lib/x86/SDL2.pdb b/extlibs/sdl2/lib/x86/SDL2.pdb new file mode 100644 index 000000000..87f5be8b3 Binary files /dev/null and b/extlibs/sdl2/lib/x86/SDL2.pdb differ diff --git a/extlibs/sdl2/lib/x86/SDL2main.lib b/extlibs/sdl2/lib/x86/SDL2main.lib index 7cd691b62..93a5291b2 100644 Binary files a/extlibs/sdl2/lib/x86/SDL2main.lib and b/extlibs/sdl2/lib/x86/SDL2main.lib differ diff --git a/libsocial/include/AchievementIDs.hpp b/libsocial/include/AchievementIDs.hpp index 999d9e20c..6db7ed23d 100644 --- a/libsocial/include/AchievementIDs.hpp +++ b/libsocial/include/AchievementIDs.hpp @@ -171,6 +171,8 @@ namespace AchievementID FringeBenefit, TryTryAgain, + OffTheWall, + Count }; static_assert(Count <= 256, "Count exceeds maximum 256 Achievements!"); diff --git a/libsocial/include/AchievementStrings.hpp b/libsocial/include/AchievementStrings.hpp index b7c514601..aa02afa8e 100644 --- a/libsocial/include/AchievementStrings.hpp +++ b/libsocial/include/AchievementStrings.hpp @@ -158,7 +158,8 @@ static const std::array AchievementStrings = "punch_it", "top_flop", "fringe_benefit", - "mulligan" + "mulligan", + "off_the_wall" }; //appears on the notification @@ -275,7 +276,8 @@ static const std::array AchievementLabels = "Punch It Chewie!", "Top Of The Flops", "Fringe Benefit", - "Try, Try Again" + "Try, Try Again", + "Off The Wall" }; //description and whether or not the achievement is hidden until it is unlocked @@ -393,6 +395,7 @@ static const std::array, AchievementID::Count> Achi std::make_pair("Hole out with a Flop shot", false), std::make_pair("Sink a hole from the fringe using a putter", false), std::make_pair("Use at least one Mulligan in Career Mode", false), + std::make_pair("Use the far wall on hole 15, course 12 to stop the ball going out of bounds", false), }; //assuming trophies load correctly they are: @@ -545,6 +548,7 @@ static constexpr std::array AchievementTrophi /*110*/TrophyID::GoldFigure, /*111*/TrophyID::SilverCup, /*112*/TrophyID::BronzeCup, + /*113*/TrophyID::Platinum, }; //these are indexed by StatID, so do try to get them in the correct order ;) diff --git a/libsocial/include/Social.hpp b/libsocial/include/Social.hpp index 7fd63ca95..893517fe5 100644 --- a/libsocial/include/Social.hpp +++ b/libsocial/include/Social.hpp @@ -51,11 +51,11 @@ source distribution. //(player avatar data format changed 1153 -> 1160) //(player avatar data format changed 1170 -> 1180) //(course data changed 1180 -> 1181) -static constexpr std::uint16_t CURRENT_VER = 1181; +static constexpr std::uint16_t CURRENT_VER = 1182; #ifdef __APPLE__ -static const std::string StringVer("1.18.1 (macOS beta)"); +static const std::string StringVer("1.18.2 (macOS beta)"); #else -static const std::string StringVer("1.18.1"); +static const std::string StringVer("1.18.2"); #endif struct HallEntry final diff --git a/readme.md b/readme.md index 69af33e9c..9ca9b2c12 100644 --- a/readme.md +++ b/readme.md @@ -33,7 +33,7 @@ Portions of this software are copyright (c) 2019 SFML (www.sfml-dev.org). All ri ----------------------------------------------------------------------- -Matt Marchant 2017 - 2023 +Matt Marchant 2017 - 2024 http://trederia.blogspot.com crogine - Zlib license. diff --git a/samples/golf/buildnumber.h b/samples/golf/buildnumber.h index 130151080..b90cd9df5 100644 --- a/samples/golf/buildnumber.h +++ b/samples/golf/buildnumber.h @@ -3,7 +3,7 @@ #ifndef BUILD_NUMBER_H_ #define BUILD_NUMBER_H_ -#define BUILDNUMBER 7161 -#define BUILDNUMBER_STR "7161" +#define BUILDNUMBER 7176 +#define BUILDNUMBER_STR "7176" #endif /* BUILD_NUMBER_H_ */ diff --git a/samples/golf/golf.aps b/samples/golf/golf.aps index 93f437c54..0eafd92d5 100644 Binary files a/samples/golf/golf.aps and b/samples/golf/golf.aps differ diff --git a/samples/golf/golf.rc b/samples/golf/golf.rc index dc1e6d64e..0592ba1b3 100644 --- a/samples/golf/golf.rc +++ b/samples/golf/golf.rc @@ -61,8 +61,8 @@ IDI_ICON1 ICON "icon.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,18,1,0 - PRODUCTVERSION 1,18,1,0 + FILEVERSION 1,18,2,0 + PRODUCTVERSION 1,18,2,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -79,12 +79,12 @@ BEGIN BEGIN VALUE "CompanyName", "Trederia" VALUE "FileDescription", "Super Video Golf" - VALUE "FileVersion", "1.18.1.0" + VALUE "FileVersion", "1.18.2.0" VALUE "InternalName", "golf.exe" VALUE "LegalCopyright", "Copyright (C) 2024 Trederia Games" VALUE "OriginalFilename", "golf.exe" VALUE "ProductName", "Super Video Golf" - VALUE "ProductVersion", "1.18.1.0" + VALUE "ProductVersion", "1.18.2.0" END END BLOCK "VarFileInfo" diff --git a/samples/golf/golf.vcxproj b/samples/golf/golf.vcxproj index 4289c1426..b7c7f508b 100644 --- a/samples/golf/golf.vcxproj +++ b/samples/golf/golf.vcxproj @@ -627,6 +627,7 @@ + @@ -763,6 +764,7 @@ + @@ -915,6 +917,7 @@ + diff --git a/samples/golf/golf.vcxproj.filters b/samples/golf/golf.vcxproj.filters index 7f98d41b0..5bfab1967 100644 --- a/samples/golf/golf.vcxproj.filters +++ b/samples/golf/golf.vcxproj.filters @@ -465,6 +465,9 @@ Source Files\golf\client\systems + + Source Files\golf\client\systems + @@ -959,6 +962,9 @@ Header Files\golf\client\systems + + Header Files\golf\client\systems + @@ -1039,6 +1045,9 @@ Header Files\golf\client\shaders + + Header Files\golf\client\shaders + diff --git a/samples/golf/src/GolfGame.cpp b/samples/golf/src/GolfGame.cpp index 3bb6b2226..a89ba68c6 100644 --- a/samples/golf/src/GolfGame.cpp +++ b/samples/golf/src/GolfGame.cpp @@ -1201,6 +1201,9 @@ void GolfGame::convertPreferences() const void GolfGame::loadPreferences() { + //hack around preference files getting corrupted for some reason + bool restoreDefaults = false; + auto path = getPreferencePath() + "prefs.cfg"; if (cro::FileSystem::fileExists(path)) { @@ -1349,6 +1352,11 @@ void GolfGame::loadPreferences() } } } + + else + { + restoreDefaults = true; + } } @@ -1478,6 +1486,11 @@ void GolfGame::loadPreferences() }*/ } } + + else + { + restoreDefaults = true; + } } path = Social::getBaseContentPath() + "league_names.txt"; @@ -1543,6 +1556,10 @@ void GolfGame::loadPreferences() cro::FileSystem::createDirectory(Social::getBaseContentPath() + u8"music"); } loadMusic(); + + + //do this last so were saving any settings which were loaded successfully too + savePreferences(); } void GolfGame::savePreferences() diff --git a/samples/golf/src/golf/CMakeLists.txt b/samples/golf/src/golf/CMakeLists.txt index 4af713cae..50f9d2893 100644 --- a/samples/golf/src/golf/CMakeLists.txt +++ b/samples/golf/src/golf/CMakeLists.txt @@ -28,6 +28,7 @@ set(GOLF_SRC ${PROJECT_DIR}/golf/DrivingState.cpp ${PROJECT_DIR}/golf/DrivingStateUI.cpp ${PROJECT_DIR}/golf/ErrorState.cpp + ${PROJECT_DIR}/golf/FireworksSystem.cpp ${PROJECT_DIR}/golf/FloatingTextSystem.cpp ${PROJECT_DIR}/golf/FpsCameraSystem.cpp ${PROJECT_DIR}/golf/FreePlayState.cpp diff --git a/samples/golf/src/golf/CareerState.cpp b/samples/golf/src/golf/CareerState.cpp index fdb23c28e..b5dbc64ea 100644 --- a/samples/golf/src/golf/CareerState.cpp +++ b/samples/golf/src/golf/CareerState.cpp @@ -1934,7 +1934,7 @@ void CareerState::selectLeague(std::size_t idx) if (league.getCurrentScore() == 0) { - str += "\n"; + str += "\nProgress is automatically saved."; } else { diff --git a/samples/golf/src/golf/ClubhouseStateUI.cpp b/samples/golf/src/golf/ClubhouseStateUI.cpp index ce9b57fc9..269686ba7 100644 --- a/samples/golf/src/golf/ClubhouseStateUI.cpp +++ b/samples/golf/src/golf/ClubhouseStateUI.cpp @@ -2643,7 +2643,7 @@ void ClubhouseState::createStatMenu(cro::Entity parent, std::uint32_t mouseEnter }); //league - entity = createButton("Club League"); + entity = createButton("League Browser"); entity.getComponent().callbacks[cro::UIInput::ButtonUp] = m_uiScene.getSystem()->addCallback([&](cro::Entity, const cro::ButtonEvent& evt) { diff --git a/samples/golf/src/golf/DrivingState.cpp b/samples/golf/src/golf/DrivingState.cpp index 017311235..91567c240 100644 --- a/samples/golf/src/golf/DrivingState.cpp +++ b/samples/golf/src/golf/DrivingState.cpp @@ -1198,6 +1198,10 @@ void DrivingState::loadAssets() m_materialIDs[MaterialID::WireframeCulled] = m_resources.materials.add(m_resources.shaders.get(ShaderID::WireframeCulled)); m_resources.materials.get(m_materialIDs[MaterialID::WireframeCulled]).blendMode = cro::Material::BlendMode::Alpha; + m_resources.shaders.loadFromString(ShaderID::WireframeCulledPoint, WireframeVertex, WireframeFragment, "#define CULLED\n#define POINT_RADIUS\n"); + m_materialIDs[MaterialID::WireframeCulledPoint] = m_resources.materials.add(m_resources.shaders.get(ShaderID::WireframeCulledPoint)); + m_resources.materials.get(m_materialIDs[MaterialID::WireframeCulledPoint]).blendMode = cro::Material::BlendMode::Alpha; + m_resources.shaders.loadFromString(ShaderID::Beacon, BeaconVertex, BeaconFragment, "#define TEXTURED\n"); m_materialIDs[MaterialID::Beacon] = m_resources.materials.add(m_resources.shaders.get(ShaderID::Beacon)); @@ -2030,6 +2034,7 @@ void DrivingState::createScene() }; camEnt.getComponent().shadowMapBuffer.create(ShadowMapSize, ShadowMapSize); camEnt.getComponent().active = false; + camEnt.getComponent().setRenderFlags(cro::Camera::Pass::Final, ~RenderFlags::MiniMap); camEnt.getComponent().setMaxShadowDistance(20.f); camEnt.getComponent().setShadowExpansion(50.f); camEnt.addComponent(); @@ -2750,7 +2755,7 @@ void DrivingState::createBall() //at a distance, and as a model when closer //glCheck(glPointSize(BallPointSize)); - this is set in resize callback based on the buffer resolution/pixel scale - auto ballMaterialID = m_materialIDs[MaterialID::WireframeCulled]; + auto ballMaterialID = m_materialIDs[MaterialID::WireframeCulledPoint]; auto ballMeshID = m_resources.meshes.loadMesh(cro::DynamicMeshBuilder(cro::VertexProperty::Position | cro::VertexProperty::Colour, 1, GL_POINTS)); auto shadowMeshID = m_resources.meshes.loadMesh(cro::DynamicMeshBuilder(cro::VertexProperty::Position | cro::VertexProperty::Colour, 1, GL_POINTS)); @@ -2912,6 +2917,7 @@ void DrivingState::createBall() //ball shadow auto ballEnt = entity; + material = m_resources.materials.get(m_materialIDs[MaterialID::WireframeCulled]); material.setProperty("u_colour", cro::Colour::White); material.blendMode = cro::Material::BlendMode::Multiply; diff --git a/samples/golf/src/golf/DrivingState.hpp b/samples/golf/src/golf/DrivingState.hpp index 5734f837f..675590541 100644 --- a/samples/golf/src/golf/DrivingState.hpp +++ b/samples/golf/src/golf/DrivingState.hpp @@ -141,6 +141,7 @@ class DrivingState final : public cro::State, public cro::GuiClient, public cro: HairReflect, Wireframe, WireframeCulled, + WireframeCulledPoint, Beacon, Horizon, Trophy, diff --git a/samples/golf/src/golf/DrivingStateUI.cpp b/samples/golf/src/golf/DrivingStateUI.cpp index 918705d36..b8c3340a7 100644 --- a/samples/golf/src/golf/DrivingStateUI.cpp +++ b/samples/golf/src/golf/DrivingStateUI.cpp @@ -224,14 +224,14 @@ void DrivingState::createUI() entity.getComponent().setOrigin(glm::vec2(bounds.width / 2.f, bounds.height / 2.f)); entity.addComponent().function = [](cro::Entity e, float) - { - //this is activated once to make sure the - //sprite is up to date with any texture buffer resize - glm::vec2 texSize = e.getComponent().getTexture()->getSize(); - e.getComponent().setTextureRect({ glm::vec2(0.f), texSize }); - e.getComponent().setOrigin(texSize / 2.f); - e.getComponent().active = false; - }; + { + //this is activated once to make sure the + //sprite is up to date with any texture buffer resize + glm::vec2 texSize = e.getComponent().getTexture()->getSize(); + e.getComponent().setTextureRect({ glm::vec2(0.f), texSize }); + e.getComponent().setOrigin(texSize / 2.f); + e.getComponent().active = false; + }; auto courseEnt = entity; m_courseEntity = entity; createPlayer(); @@ -239,7 +239,7 @@ void DrivingState::createUI() //info panel background - vertices are set in resize callback entity = m_uiScene.createEntity(); - entity.addComponent(); + entity.addComponent().setPosition(glm::vec3(0.f, 0.f, 0.2f)); entity.addComponent(); auto infoEnt = entity; diff --git a/samples/golf/src/golf/FireworksSystem.cpp b/samples/golf/src/golf/FireworksSystem.cpp new file mode 100644 index 000000000..ded51f7d5 --- /dev/null +++ b/samples/golf/src/golf/FireworksSystem.cpp @@ -0,0 +1,155 @@ +/*----------------------------------------------------------------------- + +Matt Marchant 2024 +http://trederia.blogspot.com + +crogine - Zlib license. + +This software is provided 'as-is', without any express or +implied warranty.In no event will the authors be held +liable for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute +it freely, subject to the following restrictions : + +1. The origin of this software must not be misrepresented; +you must not claim that you wrote the original software. +If you use this software in a product, an acknowledgment +in the product documentation would be appreciated but +is not required. + +2. Altered source versions must be plainly marked as such, +and must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any +source distribution. + +-----------------------------------------------------------------------*/ + +#include "FireworksSystem.hpp" +#include "MessageIDs.hpp" +#include "GameConsts.hpp" +#include "../Colordome-32.hpp" + +#include +#include +#include + +#include +#include + +using namespace cl; +namespace +{ + static constexpr std::size_t MinSpawnCount = 6; + static constexpr std::size_t MaxSpawnCount = 15; + + static constexpr std::int32_t MinSpawnTime = 1; + static constexpr std::int32_t MaxSpawnTime = 3; + + static constexpr std::int32_t MinSize = 1; //actually a tenth of this - see randomiser + static constexpr std::int32_t MaxSize = 9; + + static constexpr std::array Colours = + { + CD32::Colours[CD32::BeigeLight], + CD32::Colours[CD32::GreyLight], + CD32::Colours[CD32::BlueLight], + CD32::Colours[CD32::GreenLight], + CD32::Colours[CD32::Yellow], + CD32::Colours[CD32::Orange], + CD32::Colours[CD32::Red], + + cro::Colour(1.f, 0.f, 1.f), + cro::Colour(0.f, 1.f, 1.f), + }; +} + +FireworksSystem::FireworksSystem(cro::MessageBus& mb, const cro::Mesh::Data& mesh, const cro::Material::Data& mat) + : cro::System (mb, typeid(FireworksSystem)), + m_meshData (mesh), + m_materialData (mat), + m_spawnIndex (0), + m_spawnCount (MinSpawnCount), + m_spawnTime (0.f) +{ + requireComponent(); + requireComponent(); +} + +//public +void FireworksSystem::process(float dt) +{ + for (auto entity : getEntities()) + { + auto& fw = entity.getComponent(); + auto& tx = entity.getComponent(); + + fw.prevProgress = fw.progress; + fw.progress = std::min(1.f, fw.progress + dt); + + const float materialProgress = std::max(0.f, fw.progress); + if (fw.progressProperty) + { + fw.progressProperty->numberValue = materialProgress; + fw.progressProperty->type = cro::Material::Property::Number; + } + + const float scale = cro::Util::Easing::easeOutExpo(materialProgress) * fw.maxRadius; + //const float scale = cro::Util::Easing::easeOutCirc(std::max(0.f, fw.progress)) * fw.maxRadius; + tx.setScale(glm::vec3(scale)); + + if (fw.progress == 1.f) + { + getScene()->destroyEntity(entity); + } + + //used by audio director + if (fw.progress >= 0 + && fw.prevProgress < 0) + { + auto* msg = postMessage(MessageID::EnviroMessage); + msg->position = (tx.getPosition() * 60.f) + glm::vec3(MapSizeFloat.x / 2.f, 0.f, -MapSizeFloat.y / 2.f); + msg->size = 0.7f + (0.3f - (fw.maxRadius / 3.f)); //controls the pitch + } + } + + //check time to spawn + if (m_spawnClock.elapsed().asSeconds() > m_spawnTime) + { + CRO_ASSERT(!m_positions.empty(), "No positions have been added"); + + for (auto i = 0u; i < m_spawnCount; ++i) + { + const float size = static_cast(cro::Util::Random::value(MinSize, MaxSize)) / 10.f; + auto entity = getScene()->createEntity(); + entity.addComponent().setPosition(m_positions[m_spawnIndex]); + entity.getComponent().setScale(glm::vec3(0.f)); + //nice idea but we need to fix gravity in the shader if we do this + /*entity.getComponent().rotate(cro::Transform::X_AXIS, cro::Util::Random::value(-cro::Util::Const::PI, cro::Util::Const::PI)); + entity.getComponent().rotate(cro::Transform::Y_AXIS, cro::Util::Random::value(-cro::Util::Const::PI, cro::Util::Const::PI)); + entity.getComponent().rotate(cro::Transform::Z_AXIS, cro::Util::Random::value(-cro::Util::Const::PI, cro::Util::Const::PI));*/ + entity.addComponent(m_meshData, m_materialData); + entity.addComponent().maxRadius = size; + entity.getComponent().progress = -static_cast(i) / 7.f; + entity.getComponent().progress -= cro::Util::Random::value(0.05f, 0.18f); + + //stash the material property so we can update it without having to do repeated lookups + auto& materialProperties = entity.getComponent().getMaterialData(cro::Mesh::IndexData::Final, 0).properties; + if (auto progressProperty = materialProperties.find("u_progress"); progressProperty != materialProperties.end()) + { + entity.getComponent().progressProperty = &progressProperty->second.second; + } + + entity.getComponent().setMaterialProperty(0, "u_colour", Colours[m_spawnIndex % Colours.size()]); + entity.getComponent().setMaterialProperty(0, "u_size", size); + + m_spawnIndex = (m_spawnIndex + 1) % m_positions.size(); + } + m_spawnCount = cro::Util::Random::value(MinSpawnCount, MaxSpawnCount); + + m_spawnClock.restart(); + m_spawnTime = static_cast(cro::Util::Random::value(MinSpawnTime, MaxSpawnTime)); + } +} \ No newline at end of file diff --git a/samples/golf/src/golf/FireworksSystem.hpp b/samples/golf/src/golf/FireworksSystem.hpp new file mode 100644 index 000000000..d333c9a69 --- /dev/null +++ b/samples/golf/src/golf/FireworksSystem.hpp @@ -0,0 +1,68 @@ +/*----------------------------------------------------------------------- + +Matt Marchant 2024 +http://trederia.blogspot.com + +crogine - Zlib license. + +This software is provided 'as-is', without any express or +implied warranty.In no event will the authors be held +liable for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute +it freely, subject to the following restrictions : + +1. The origin of this software must not be misrepresented; +you must not claim that you wrote the original software. +If you use this software in a product, an acknowledgment +in the product documentation would be appreciated but +is not required. + +2. Altered source versions must be plainly marked as such, +and must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any +source distribution. + +-----------------------------------------------------------------------*/ + +#pragma once + +#include +#include +#include +#include +#include + +#include + +struct Firework final +{ + float progress = 0.f; + float prevProgress = -1.f; + float maxRadius = 1.f; + + cro::Material::Property* progressProperty = nullptr; +}; + +class FireworksSystem final : public cro::System +{ +public: + FireworksSystem(cro::MessageBus&, const cro::Mesh::Data&, const cro::Material::Data&); + + void process(float) override; + + void addPosition(glm::vec3 p) { m_positions.push_back(p); } + +private: + const cro::Mesh::Data& m_meshData; + const cro::Material::Data m_materialData; + + std::vector m_positions; + std::size_t m_spawnIndex; + std::size_t m_spawnCount; + + cro::Clock m_spawnClock; + float m_spawnTime; +}; \ No newline at end of file diff --git a/samples/golf/src/golf/GameConsts.hpp b/samples/golf/src/golf/GameConsts.hpp index 388ada299..d1c39b282 100644 --- a/samples/golf/src/golf/GameConsts.hpp +++ b/samples/golf/src/golf/GameConsts.hpp @@ -293,6 +293,7 @@ struct ShaderID final TutorialSlope, Wireframe, WireframeCulled, + WireframeCulledPoint, Weather, Transition, Trophy, @@ -316,7 +317,7 @@ struct ShaderID final Glass, LensFlare, PointFlare, - + Firework, }; }; diff --git a/samples/golf/src/golf/GolfSoundDirector.cpp b/samples/golf/src/golf/GolfSoundDirector.cpp index f6a144e1b..0d38d8576 100644 --- a/samples/golf/src/golf/GolfSoundDirector.cpp +++ b/samples/golf/src/golf/GolfSoundDirector.cpp @@ -196,6 +196,9 @@ GolfSoundDirector::GolfSoundDirector(cro::AudioResource& ar, const SharedStateDa "assets/golf/sound/kudos/ntp01.wav", "assets/golf/sound/kudos/ntp02.wav", + "assets/golf/sound/ambience/fw01.wav", + "assets/golf/sound/ambience/fw02.wav", + "assets/golf/sound/ambience/fw03.wav", }; std::fill(m_audioSources.begin(), m_audioSources.end(), nullptr); @@ -230,6 +233,15 @@ void GolfSoundDirector::handleMessage(const cro::Message& msg) switch (msg.id) { default: break; + case MessageID::EnviroMessage: + { + const auto& data = msg.getData(); + auto ent = playSound(AudioID::Fw01 + cro::Util::Random::value(0, 2), data.position, 0.4f); + ent.getComponent().setPitch(data.size); + ent.getComponent().setMixerChannel(MixerChannel::Environment); + ent.getComponent().setRolloff(0.f); + } + break; case cro::Message::SystemMessage: { const auto& data = msg.getData(); diff --git a/samples/golf/src/golf/GolfSoundDirector.hpp b/samples/golf/src/golf/GolfSoundDirector.hpp index 357494013..c92f2ae51 100644 --- a/samples/golf/src/golf/GolfSoundDirector.hpp +++ b/samples/golf/src/golf/GolfSoundDirector.hpp @@ -173,6 +173,10 @@ class GolfSoundDirector final : public SoundEffectsDirector NTP01, NTP02, + Fw01, + Fw02, + Fw03, + Count }; }; diff --git a/samples/golf/src/golf/GolfState.cpp b/samples/golf/src/golf/GolfState.cpp index 9a139086f..51c7e3982 100644 --- a/samples/golf/src/golf/GolfState.cpp +++ b/samples/golf/src/golf/GolfState.cpp @@ -3650,6 +3650,7 @@ void GolfState::spawnBall(const ActorInfo& info) //ball shadow auto ballEnt = entity; + //material = m_resources.materials.get(m_materialIDs[MaterialID::WireFrameCulled]); material.setProperty("u_colour", cro::Colour::White); //material.blendMode = cro::Material::BlendMode::Multiply; //causes shadow to actually get darker as alpha reaches zero.. duh diff --git a/samples/golf/src/golf/GolfState.hpp b/samples/golf/src/golf/GolfState.hpp index 922187952..5f2687a53 100644 --- a/samples/golf/src/golf/GolfState.hpp +++ b/samples/golf/src/golf/GolfState.hpp @@ -254,6 +254,7 @@ class GolfState final : public cro::State, public cro::GuiClient, public cro::Co { WireFrame, WireFrameCulled, + WireFrameCulledPoint, Water, Horizon, HorizonSun, @@ -335,6 +336,7 @@ class GolfState final : public cro::State, public cro::GuiClient, public cro::Co void createWeather(std::int32_t); void setFog(float density); void createClouds(); + void createFireworks(); void buildBow(); void handleWeatherChange(std::uint8_t); diff --git a/samples/golf/src/golf/GolfStateAssets.cpp b/samples/golf/src/golf/GolfStateAssets.cpp index e6d2aa9a4..64f93f5a8 100644 --- a/samples/golf/src/golf/GolfStateAssets.cpp +++ b/samples/golf/src/golf/GolfStateAssets.cpp @@ -400,6 +400,11 @@ void GolfState::loadMap() auto colours = m_skyScene.getSkyboxColours(); colours.bottom = skyDark; m_skyScene.setSkyboxColours(colours); + + if (m_sharedData.weatherType == WeatherType::Clear) + { + createFireworks(); + } } #ifdef CRO_DEBUG_ @@ -1797,8 +1802,12 @@ void GolfState::loadMaterials() m_resources.shaders.loadFromString(ShaderID::WireframeCulled, WireframeVertex, WireframeFragment, "#define CULLED\n#define USE_MRT\n"); m_materialIDs[MaterialID::WireFrameCulled] = m_resources.materials.add(m_resources.shaders.get(ShaderID::WireframeCulled)); m_resources.materials.get(m_materialIDs[MaterialID::WireFrameCulled]).blendMode = cro::Material::BlendMode::Alpha; - //shader = &m_resources.shaders.get(ShaderID::WireframeCulled); - //m_resolutionBuffer.addShader(*shader); + + m_resources.shaders.loadFromString(ShaderID::WireframeCulledPoint, WireframeVertex, WireframeFragment, "#define CULLED\n#define USE_MRT\n#define POINT_RADIUS\n"); + m_materialIDs[MaterialID::WireFrameCulledPoint] = m_resources.materials.add(m_resources.shaders.get(ShaderID::WireframeCulledPoint)); + m_resources.materials.get(m_materialIDs[MaterialID::WireFrameCulledPoint]).blendMode = cro::Material::BlendMode::Alpha; + + m_resources.shaders.loadFromString(ShaderID::BallTrail, WireframeVertex, WireframeFragment, "#define HUE\n#define USE_MRT\n"); m_materialIDs[MaterialID::BallTrail] = m_resources.materials.add(m_resources.shaders.get(ShaderID::BallTrail)); @@ -2282,7 +2291,7 @@ void GolfState::loadModels() //ball resources - ball is rendered as a single point //at a distance, and as a model when closer //glCheck(glPointSize(BallPointSize)); - this is set in resize callback based on the buffer resolution/pixel scale - m_ballResources.materialID = m_materialIDs[MaterialID::WireFrameCulled]; + m_ballResources.materialID = m_materialIDs[MaterialID::WireFrameCulledPoint]; m_ballResources.ballMeshID = m_resources.meshes.loadMesh(cro::DynamicMeshBuilder(cro::VertexProperty::Position | cro::VertexProperty::Colour, 1, GL_POINTS)); m_ballResources.shadowMeshID = m_resources.meshes.loadMesh(cro::DynamicMeshBuilder(cro::VertexProperty::Position | cro::VertexProperty::Colour, 1, GL_POINTS)); diff --git a/samples/golf/src/golf/GolfStateScoring.cpp b/samples/golf/src/golf/GolfStateScoring.cpp index 64fdab4a9..48366ee03 100644 --- a/samples/golf/src/golf/GolfStateScoring.cpp +++ b/samples/golf/src/golf/GolfStateScoring.cpp @@ -109,6 +109,17 @@ void GolfState::updateHoleScore(std::uint16_t data) else { txt += " has won the pot!"; + + cro::Command cmd; + cmd.targetFlags = CommandID::UI::ScoreTitle; + cmd.action = [&, player](cro::Entity e, float) + { + auto str = m_courseTitle + " - Skins - Pot: 1"; + e.getComponent().setString(str); + centreText(e); + }; + m_uiScene.getSystem()->sendCommand(cmd); + } showNotification(txt); diff --git a/samples/golf/src/golf/GolfStateUI.cpp b/samples/golf/src/golf/GolfStateUI.cpp index 813aab4eb..ed2b6e0c0 100644 --- a/samples/golf/src/golf/GolfStateUI.cpp +++ b/samples/golf/src/golf/GolfStateUI.cpp @@ -1717,7 +1717,6 @@ void GolfState::buildUI() e.getComponent().setCroppingArea(miniBounds, true); }; mapEnt.getComponent().addChild(entity.getComponent()); - /*auto dbEnt = m_uiScene.createEntity(); dbEnt.addComponent().setPosition({ 0.f, 0.f, 0.1f }); @@ -5646,21 +5645,21 @@ void GolfState::retargetMinimap(bool reset) //if we have a tight dogleg, such as on the mini putt //check if the primary target is in between and shift //towards it to better centre the hole - auto targ = findTargetPos(player); + const auto targ = findTargetPos(player); glm::vec2 targDir(targ.x - player.x, -targ.z + player.z); - const auto d = glm::dot(glm::normalize(dir), glm::normalize(targDir)); + const auto dirNorm = glm::normalize(dir); + const auto d = glm::dot(dirNorm, glm::normalize(targDir)); const auto l2 = glm::length2(targDir); if (!isMultiTarget && (d > 0 && d < 0.8f && l2 > 2.25f && l2 < glm::length2(dir))) { - //project the target onto the current dir - //then move half way between projection and - //primary target - //auto p = dir * d * (1.f / glm::length2(dir)); - - //actually just moving towards the target seems to work better auto p = dir / 2.f; - p += (targDir - p) / 2.f; + + //find the distance to the target point and offset by perpendicular amount + const glm::vec2 perpNormal(dirNorm.y, -dirNorm.x); + const glm::vec2 targPos(targ.x, -targ.z); + const float offset = /*std::abs*/((targPos.x - target.end.pan.x) * dirNorm.y - (targPos.y - target.end.pan.y) * dirNorm.x) / 2.f; + p += perpNormal * offset; target.end.pan += p; } else @@ -5673,7 +5672,7 @@ void GolfState::retargetMinimap(bool reset) //get distance between flag and player and expand by 1.4 (about 3m around a putting hole) //TODO this should be fixed 3m - as a percentage it's HUGE on big maps when fully zoomed - float viewLength = std::max(glm::length(dir), m_inputParser.getEstimatedDistance()) * 1.4f; //remember this is world coords + float viewLength = std::max(glm::length(dir), m_inputParser.getEstimatedDistance()) * 1.45f; //remember this is world coords //scale zoom on long edge of map by box length and clamp to 32x target.end.zoom = std::clamp(static_cast(MiniMapSize.x) / viewLength, MinZoom, MaxZoom); diff --git a/samples/golf/src/golf/MessageIDs.hpp b/samples/golf/src/golf/MessageIDs.hpp index 34e4fedb7..e8950436e 100644 --- a/samples/golf/src/golf/MessageIDs.hpp +++ b/samples/golf/src/golf/MessageIDs.hpp @@ -47,6 +47,7 @@ namespace cl::MessageID BilliardsMessage, BilliardsCameraMessage, AIMessage, + EnviroMessage, Count }; @@ -215,4 +216,10 @@ struct AIEvent final Predict }type = BeginThink; float power = 0.f; +}; + +struct EnviroEvent final +{ + glm::vec3 position = glm::vec3(0.f); + float size = 0.f; }; \ No newline at end of file diff --git a/samples/golf/src/golf/OptionsState.cpp b/samples/golf/src/golf/OptionsState.cpp index 1f7e66c23..b612f68ef 100644 --- a/samples/golf/src/golf/OptionsState.cpp +++ b/samples/golf/src/golf/OptionsState.cpp @@ -91,6 +91,15 @@ using namespace cl; namespace { + struct LastInput final + { + enum + { + XBox, PS,Keyboard + }; + }; + std::int32_t lastInput = LastInput::Keyboard; + constexpr float CameraDepth = 3.f; constexpr float BackgroundDepth = -0.5f; @@ -313,6 +322,11 @@ OptionsState::OptionsState(cro::StateStack& ss, cro::State::Context ctx, SharedS m_viewScale (2.f), m_refreshControllers(false) { + if (Social::isSteamdeck()) + { + lastInput = LastInput::XBox; + } + ctx.mainWindow.setMouseCaptured(false); m_videoSettings.fullScreen = ctx.mainWindow.isFullscreen(); @@ -359,6 +373,8 @@ bool OptionsState::handleEvent(const cro::Event& evt) hasPSLayout(controllerID) ? LayoutID::PS : LayoutID::XBox; m_layoutEnt.getComponent().play(i); } + + lastInput = hasPSLayout(controllerID) ? LastInput::PS : LastInput::XBox; m_scene.getActiveCamera().getComponent().active = true; //forces refresh }; @@ -431,6 +447,8 @@ bool OptionsState::handleEvent(const cro::Event& evt) } else if (evt.type == SDL_KEYDOWN) { + lastInput = LastInput::Keyboard; + switch (evt.key.keysym.sym) { default: break; @@ -441,6 +459,21 @@ bool OptionsState::handleEvent(const cro::Event& evt) cro::App::getWindow().setMouseCaptured(true); break; } + + if (!m_updatingKeybind) + { + if (evt.key.keysym.sym == m_sharedData.inputBinding.keys[InputBinding::PrevClub]) + { + m_currentTabFunction = (m_currentTabFunction + (m_tabFunctions.size() - 1)) % m_tabFunctions.size(); + m_tabFunctions[m_currentTabFunction](); + } + else if (evt.key.keysym.sym == m_sharedData.inputBinding.keys[InputBinding::NextClub]) + { + m_currentTabFunction = (m_currentTabFunction + 1) % m_tabFunctions.size(); + m_tabFunctions[m_currentTabFunction](); + } + m_scene.getActiveCamera().getComponent().active = true; //forces refresh + } } else if (evt.type == SDL_CONTROLLERBUTTONUP) { @@ -496,22 +529,12 @@ bool OptionsState::handleEvent(const cro::Event& evt) toggleControllerIcon(cro::GameController::controllerID(evt.caxis.which)); cro::App::getWindow().setMouseCaptured(true); - - if (evt.caxis.axis == cro::GameController::AxisRightY) - { - /*if (evt.caxis.value > 0) - { - scrollMenu(1); - } - else - { - scrollMenu(0); - }*/ - } } } else if (evt.type == SDL_MOUSEBUTTONDOWN) { + lastInput = LastInput::Keyboard; + if (evt.button.button == SDL_BUTTON_LEFT && !m_updatingKeybind) { @@ -551,11 +574,15 @@ bool OptionsState::handleEvent(const cro::Event& evt) } else if (evt.type == SDL_MOUSEMOTION) { + lastInput = LastInput::Keyboard; + updateSlider(); cro::App::getWindow().setMouseCaptured(false); } else if (evt.type == SDL_MOUSEWHEEL) { + lastInput = LastInput::Keyboard; + if (evt.wheel.y > 0) { //up @@ -624,6 +651,40 @@ void OptionsState::handleMessage(const cro::Message& msg) bool OptionsState::simulate(float dt) { + for (auto i = 0u; i < m_scrollPresses.size(); ++i) + { + auto& press = m_scrollPresses[i]; + if (press.pressed) + { + press.pressedTimer += dt; + if (press.pressedTimer > ScrollPress::PressTime) + { + press.active = true; + } + } + + + if (press.active) + { + press.scrollTimer += dt; + if (press.scrollTimer > ScrollPress::ScrollTime) + { + press.scrollTimer -= ScrollPress::ScrollTime; + + //this is important we use the correct type of + //event here because only controller presses (not + //mouse presses) should latch the active state + cro::ButtonEvent fakeEvent; + /*fakeEvent.type = SDL_CONTROLLERBUTTONDOWN; + fakeEvent.cbutton.button = cro::GameController::ButtonA;*/ + fakeEvent.type = SDL_MOUSEBUTTONDOWN; + fakeEvent.button.button = SDL_BUTTON_LEFT; + m_scrollFunctions[i](cro::Entity(), fakeEvent); + } + } + } + + m_scene.simulate(dt); if (m_refreshControllers) @@ -920,6 +981,103 @@ void OptionsState::buildScene() auto bgEnt = entity; auto bgSize = glm::vec2(bounds.width, bounds.height); + const auto& largeFont = m_sharedData.sharedResources->fonts.get(FontID::UI); + + //icons for paging tabs + static constexpr float IconOffset = 30.f; + entity = m_scene.createEntity(); + entity.addComponent().setPosition({ IconOffset, 338.f, 0.f }); + entity.addComponent(); + entity.addComponent(largeFont).setCharacterSize(UITextSize); + entity.getComponent().setFillColour(TextNormalColour); + entity.getComponent().setString("<" + cro::Keyboard::keyString(m_sharedData.inputBinding.keys[InputBinding::PrevClub])); + entity.getComponent().setAlignment(cro::Text::Alignment::Centre); + entity.addComponent().active = true; + entity.getComponent().function = + [&](cro::Entity e, float) + { + if (lastInput == LastInput::Keyboard) + { + e.getComponent().setScale(glm::vec2(1.f)); + e.getComponent().setString("<" + cro::Keyboard::keyString(m_sharedData.inputBinding.keys[InputBinding::PrevClub])); + } + else + { + e.getComponent().setScale(glm::vec2(0.f)); + } + }; + bgEnt.getComponent().addChild(entity.getComponent()); + + entity = m_scene.createEntity(); + entity.addComponent().setPosition({ bgSize.x - IconOffset, 338.f, 0.f }); + entity.addComponent(); + entity.addComponent(largeFont).setCharacterSize(UITextSize); + entity.getComponent().setFillColour(TextNormalColour); + entity.getComponent().setString(cro::Keyboard::keyString(m_sharedData.inputBinding.keys[InputBinding::NextClub]) + ">"); + entity.getComponent().setAlignment(cro::Text::Alignment::Centre); + entity.addComponent().active = true; + entity.getComponent().function = + [&](cro::Entity e, float) + { + if (lastInput == LastInput::Keyboard) + { + e.getComponent().setScale(glm::vec2(1.f)); + e.getComponent().setString(cro::Keyboard::keyString(m_sharedData.inputBinding.keys[InputBinding::NextClub]) + ">"); + } + else + { + e.getComponent().setScale(glm::vec2(0.f)); + } + }; + bgEnt.getComponent().addChild(entity.getComponent()); + + + entity = m_scene.createEntity(); + entity.addComponent().setPosition({ IconOffset, 338.f, 0.f }); + entity.addComponent(); + entity.addComponent() = spriteSheet.getSprite("lb"); + entity.addComponent().play(1); + bounds = entity.getComponent().getTextureBounds(); + entity.getComponent().setOrigin({ bounds.width / 2.f, bounds.height }); + entity.addComponent().active = true; + entity.getComponent().function = + [](cro::Entity e, float) + { + if (lastInput != LastInput::Keyboard) + { + e.getComponent().setScale(glm::vec2(1.f)); + e.getComponent().play(lastInput); + } + else + { + e.getComponent().setScale(glm::vec2(0.f)); + } + }; + bgEnt.getComponent().addChild(entity.getComponent()); + + entity = m_scene.createEntity(); + entity.addComponent().setPosition({ bgSize.x - IconOffset, 338.f, 0.f }); + entity.addComponent(); + entity.addComponent() = spriteSheet.getSprite("rb"); + entity.addComponent().play(1); + bounds = entity.getComponent().getTextureBounds(); + entity.getComponent().setOrigin({ bounds.width / 2.f, bounds.height }); + entity.addComponent().active = true; + entity.getComponent().function = + [](cro::Entity e, float) + { + if (lastInput != LastInput::Keyboard) + { + e.getComponent().setScale(glm::vec2(1.f)); + e.getComponent().play(lastInput); + } + else + { + e.getComponent().setScale(glm::vec2(0.f)); + } + }; + bgEnt.getComponent().addChild(entity.getComponent()); + auto& uiSystem = *m_scene.getSystem(); auto selectedID = uiSystem.addCallback([](cro::Entity e) {e.getComponent().setColour(cro::Colour::White); e.getComponent().play(); }); @@ -933,6 +1091,7 @@ void OptionsState::buildScene() spriteSheet.loadFromFile("assets/golf/sprites/options.spt", m_sharedData.sharedResources->textures); + //video options entity = m_scene.createEntity(); entity.addComponent().setPosition(PanelPosition); @@ -1022,7 +1181,7 @@ void OptionsState::buildScene() entity.addComponent(); entity.addComponent() = spriteSheet.getSprite("ach_bar"); bounds = entity.getComponent().getTextureBounds(); - entity.getComponent().setPosition({ 53.f + HorizontalOffset, (bgSize.y - bounds.height) + VerticalOffset, TabBarDepth }); + entity.getComponent().setPosition({ 51.f + HorizontalOffset, (bgSize.y - bounds.height) + VerticalOffset, TabBarDepth }); achButtonEnt.getComponent().addChild(entity.getComponent()); auto hideAchievements = [achEnt]() mutable @@ -1060,7 +1219,7 @@ void OptionsState::buildScene() entity.addComponent(); entity.addComponent() = spriteSheet.getSprite("stat_bar"); bounds = entity.getComponent().getTextureBounds(); - entity.getComponent().setPosition({ 53.f + HorizontalOffset, (bgSize.y - bounds.height) + VerticalOffset, TabBarDepth }); + entity.getComponent().setPosition({ 51.f + HorizontalOffset, (bgSize.y - bounds.height) + VerticalOffset, TabBarDepth }); statsButtonEnt.getComponent().addChild(entity.getComponent()); auto hideStats = [statsEnt]() mutable @@ -1090,11 +1249,19 @@ void OptionsState::buildScene() { auto ent = m_scene.createEntity(); ent.addComponent().active = true; + ent.getComponent().setUserData(0.1f); ent.getComponent().function = - [&](cro::Entity e, float) + [&](cro::Entity e, float dt) { m_scene.getActiveCamera().getComponent().active = true; - m_scene.destroyEntity(e); + + //sometimes 1 frame isn't enough... + auto& t = e.getComponent().getUserData(); + t -= dt; + if (t < 0) + { + m_scene.destroyEntity(e); + } }; }; @@ -1231,28 +1398,28 @@ void OptionsState::buildScene() entity.getComponent().setPrevIndex(TabAchievements, WindowClose); entity = createTab(achButtonEnt, 0, MenuID::Achievements, TabAV); - entity.getComponent().move(glm::vec3(HorizontalOffset, VerticalOffset, 0.f)); + entity.getComponent().move(glm::vec3(HorizontalOffset - 2.f, VerticalOffset, 0.f)); entity.getComponent().setNextIndex(TabController, WindowAdvanced); entity.getComponent().setPrevIndex(TabStats, WindowAdvanced); entity = createTab(achButtonEnt, 1, MenuID::Achievements, TabController); - entity.getComponent().move(glm::vec3(HorizontalOffset, VerticalOffset, 0.f)); + entity.getComponent().move(glm::vec3(HorizontalOffset - 2.f, VerticalOffset, 0.f)); entity.getComponent().setNextIndex(TabStats, WindowCredits); entity.getComponent().setPrevIndex(TabAV, WindowCredits); entity = createTab(achButtonEnt, 3, MenuID::Achievements, TabStats); - entity.getComponent().move(glm::vec3(HorizontalOffset, VerticalOffset, 0.f)); + entity.getComponent().move(glm::vec3(HorizontalOffset - 2.f, VerticalOffset, 0.f)); entity.getComponent().setNextIndex(TabAV, ScrollUp); entity.getComponent().setPrevIndex(TabController, WindowClose); entity = createTab(statsButtonEnt, 0, MenuID::Stats, TabAV); - entity.getComponent().move(glm::vec3(HorizontalOffset, VerticalOffset, 0.f)); + entity.getComponent().move(glm::vec3(HorizontalOffset - 2.f, VerticalOffset, 0.f)); entity.getComponent().setNextIndex(TabController, WindowCredits); entity.getComponent().setPrevIndex(TabAchievements, WindowCredits); entity = createTab(statsButtonEnt, 1, MenuID::Stats, TabController); - entity.getComponent().move(glm::vec3(HorizontalOffset, VerticalOffset, 0.f)); + entity.getComponent().move(glm::vec3(HorizontalOffset - 2.f, VerticalOffset, 0.f)); entity.getComponent().setNextIndex(TabAchievements, ResetStats); entity.getComponent().setPrevIndex(TabAV, WindowAdvanced); entity = createTab(statsButtonEnt, 2, MenuID::Stats, TabAchievements); - entity.getComponent().move(glm::vec3(HorizontalOffset, VerticalOffset, 0.f)); + entity.getComponent().move(glm::vec3(HorizontalOffset - 2.f, VerticalOffset, 0.f)); entity.getComponent().setNextIndex(TabAV, ResetCareer); entity.getComponent().setPrevIndex(TabController, WindowApply); @@ -1309,7 +1476,7 @@ void OptionsState::buildScene() //tool tips for options - auto& font = m_sharedData.sharedResources->fonts.get(FontID::Info); + const auto& font = m_sharedData.sharedResources->fonts.get(FontID::Info); auto createToolTip = [&](const cro::String& tip) { auto entity = m_scene.createEntity(); @@ -4070,6 +4237,11 @@ void OptionsState::buildAchievementsMenu(cro::Entity parent, const cro::SpriteSh parent.getComponent().active = true; m_audioEnts[AudioID::Accept].getComponent().play(); } + + if (evt.type == SDL_CONTROLLERBUTTONDOWN) + { + m_scrollPresses[ScrollID::AchUp].pressed = true; + } } }; @@ -4085,6 +4257,11 @@ void OptionsState::buildAchievementsMenu(cro::Entity parent, const cro::SpriteSh parent.getComponent().active = true; m_audioEnts[AudioID::Accept].getComponent().play(); } + + if (evt.type == SDL_CONTROLLERBUTTONDOWN) + { + m_scrollPresses[ScrollID::AchDown].pressed = true; + } } }; @@ -4143,12 +4320,32 @@ void OptionsState::buildAchievementsMenu(cro::Entity parent, const cro::SpriteSh upHighlight.getComponent().setNextIndex(TabAV, ScrollDown); upHighlight.getComponent().setPrevIndex(TabStats, TabStats); upHighlight.getComponent().callbacks[cro::UIInput::ButtonDown] = uiSystem.addCallback(m_scrollFunctions[ScrollID::AchUp]); + upHighlight.getComponent().callbacks[cro::UIInput::ButtonUp] = + uiSystem.addCallback([&](cro::Entity, const cro::ButtonEvent& evt) + { + //if (deactivated(evt)) + { + m_scrollPresses[ScrollID::AchUp].pressed = false; + m_scrollPresses[ScrollID::AchUp].pressedTimer = 0.f; + m_scrollPresses[ScrollID::AchUp].active = false; + } + }); auto downHighlight = createHighlight({ cropping.width - 19.f, 7.f }); downHighlight.getComponent().setSelectionIndex(ScrollDown); downHighlight.getComponent().setNextIndex(WindowAdvanced, WindowClose); downHighlight.getComponent().setPrevIndex(WindowAdvanced, ScrollUp); downHighlight.getComponent().callbacks[cro::UIInput::ButtonDown] = uiSystem.addCallback(m_scrollFunctions[ScrollID::AchDown]); + downHighlight.getComponent().callbacks[cro::UIInput::ButtonUp] = + uiSystem.addCallback([&](cro::Entity, const cro::ButtonEvent& evt) + { + //if (deactivated(evt)) + { + m_scrollPresses[ScrollID::AchDown].pressed = false; + m_scrollPresses[ScrollID::AchDown].pressedTimer = 0.f; + m_scrollPresses[ScrollID::AchDown].active = false; + } + }); } void OptionsState::buildStatsMenu(cro::Entity parent, const cro::SpriteSheet& spriteSheet) @@ -4284,6 +4481,11 @@ void OptionsState::buildStatsMenu(cro::Entity parent, const cro::SpriteSheet& sp parent.getComponent().active = true; m_audioEnts[AudioID::Accept].getComponent().play(); } + + if (evt.type == SDL_CONTROLLERBUTTONDOWN) + { + m_scrollPresses[ScrollID::StatUp].pressed = true; + } } }; @@ -4299,6 +4501,11 @@ void OptionsState::buildStatsMenu(cro::Entity parent, const cro::SpriteSheet& sp parent.getComponent().active = true; m_audioEnts[AudioID::Accept].getComponent().play(); } + + if (evt.type == SDL_CONTROLLERBUTTONDOWN) + { + m_scrollPresses[ScrollID::StatDown].pressed = true; + } } }; @@ -4357,12 +4564,34 @@ void OptionsState::buildStatsMenu(cro::Entity parent, const cro::SpriteSheet& sp upHighlight.getComponent().setNextIndex(TabAV, ScrollDown); upHighlight.getComponent().setPrevIndex(TabAchievements, TabAchievements); upHighlight.getComponent().callbacks[cro::UIInput::ButtonDown] = uiSystem.addCallback(m_scrollFunctions[ScrollID::StatUp]); + upHighlight.getComponent().callbacks[cro::UIInput::ButtonUp] = + uiSystem.addCallback([&](cro::Entity, const cro::ButtonEvent& evt) + { + //if (deactivated(evt)) + { + m_scrollPresses[ScrollID::StatUp].pressed = false; + m_scrollPresses[ScrollID::StatUp].pressedTimer = 0.f; + m_scrollPresses[ScrollID::StatUp].active = false; + } + }); + auto downHighlight = createHighlight({ cropping.width - 19.f, 7.f }, "square_highlight"); downHighlight.getComponent().setSelectionIndex(ScrollDown); downHighlight.getComponent().setNextIndex(ResetStats, WindowClose); downHighlight.getComponent().setPrevIndex(ResetCareer, ScrollUp); downHighlight.getComponent().callbacks[cro::UIInput::ButtonDown] = uiSystem.addCallback(m_scrollFunctions[ScrollID::StatDown]); + downHighlight.getComponent().callbacks[cro::UIInput::ButtonUp] = + uiSystem.addCallback([&](cro::Entity, const cro::ButtonEvent& evt) + { + //if (deactivated(evt)) + { + m_scrollPresses[ScrollID::StatDown].pressed = false; + m_scrollPresses[ScrollID::StatDown].pressedTimer = 0.f; + m_scrollPresses[ScrollID::StatDown].active = false; + } + }); + //reset career button entity = m_scene.createEntity(); diff --git a/samples/golf/src/golf/OptionsState.hpp b/samples/golf/src/golf/OptionsState.hpp index b34e70886..e3067b9a6 100644 --- a/samples/golf/src/golf/OptionsState.hpp +++ b/samples/golf/src/golf/OptionsState.hpp @@ -103,7 +103,20 @@ class OptionsState final : public cro::State Count }; }; + + struct ScrollPress final + { + bool pressed = false; + float pressedTimer = 0.f; + static constexpr float PressTime = 0.5f; + + bool active = false; + float scrollTimer = 0.f; + static constexpr float ScrollTime = 0.05f; + }; + std::array, ScrollID::Count> m_scrollFunctions = {}; + std::array m_scrollPresses = {}; cro::RenderTexture m_achievementBuffer; cro::RenderTexture m_statsBuffer; diff --git a/samples/golf/src/golf/PauseState.cpp b/samples/golf/src/golf/PauseState.cpp index ed2bf5ca3..b4433cb0b 100644 --- a/samples/golf/src/golf/PauseState.cpp +++ b/samples/golf/src/golf/PauseState.cpp @@ -510,7 +510,7 @@ void PauseState::buildScene() m_audioEnts[AudioID::Back].getComponent().play(); } }); - + auto noText = entity; entity = createItem(glm::vec2(20.f, -12.f), "Yes", confirmEntity); entity.getComponent().setGroup(MenuID::Confirm); @@ -552,6 +552,7 @@ void PauseState::buildScene() m_audioEnts[AudioID::Accept].getComponent().play(); } }); + auto yesText = entity; entity = m_scene.createEntity(); entity.addComponent().setPosition(glm::vec2(0.f, 12.f)); @@ -561,7 +562,7 @@ void PauseState::buildScene() entity.getComponent().setFillColour(TextNormalColour); centreText(entity); confirmEntity.getComponent().addChild(entity.getComponent()); - + auto sureText = entity; resetConfirmation = [&, menuEntity, confirmEntity]() mutable { @@ -574,18 +575,30 @@ void PauseState::buildScene() if (m_sharedData.hosting - && m_sharedData.gameMode != GameMode::Tutorial - && m_sharedData.gameMode != GameMode::Career) + && m_sharedData.gameMode != GameMode::Tutorial) { auto& smallFont = m_sharedData.sharedResources->fonts.get(FontID::Info); entity = m_scene.createEntity(); - entity.addComponent().setPosition(glm::vec2(0.f, 2.f)); + entity.addComponent();// .setPosition(glm::vec2(0.f, 2.f)); entity.addComponent(); entity.addComponent(smallFont).setCharacterSize(InfoTextSize); - entity.getComponent().setString("This Will Kick All Players"); + if (m_sharedData.gameMode == GameMode::Career) + { + entity.getComponent().move({ 0.f, 10.f }); + entity.getComponent().setString("Your Progress Up To The\nCurrent Hole Will Be Saved."); + entity.getComponent().setAlignment(cro::Text::Alignment::Centre); + } + else + { + entity.getComponent().setString("This Will Kick All Players"); + centreText(entity); + } entity.getComponent().setFillColour(TextNormalColour); - centreText(entity); confirmEntity.getComponent().addChild(entity.getComponent()); + + sureText.getComponent().move({ 0.f, 14.f }); + noText.getComponent().move({ 0.f, -14.f }); + yesText.getComponent().move({ 0.f, -14.f }); } diff --git a/samples/golf/src/golf/Terrain.hpp b/samples/golf/src/golf/Terrain.hpp index e407ebf3e..6a25968a4 100644 --- a/samples/golf/src/golf/Terrain.hpp +++ b/samples/golf/src/golf/Terrain.hpp @@ -84,6 +84,7 @@ struct TriggerID final Volcano = 13, Boat, TennisCourt, + BackWall, //hole 12-15 Count }; diff --git a/samples/golf/src/golf/Weather.cpp b/samples/golf/src/golf/Weather.cpp index a051599bd..8cb47f5af 100644 --- a/samples/golf/src/golf/Weather.cpp +++ b/samples/golf/src/golf/Weather.cpp @@ -33,6 +33,7 @@ source distribution. #include "MenuConsts.hpp" #include "CloudSystem.hpp" #include "WeatherAnimationSystem.hpp" +#include "FireworksSystem.hpp" #include "../ErrorCheck.hpp" #include @@ -42,8 +43,11 @@ source distribution. #include #include +#include + #include #include +#include #include #include @@ -52,117 +56,8 @@ namespace { #include "shaders/WireframeShader.inl" #include "shaders/CloudShader.inl" +#include "shaders/Weather.inl" - const std::string WeatherVertex = R"( - ATTRIBUTE vec4 a_position; - ATTRIBUTE vec4 a_colour; - - uniform mat4 u_worldMatrix; - uniform mat4 u_worldViewMatrix; - uniform mat4 u_projectionMatrix; - uniform vec4 u_clipPlane; - - layout (std140) uniform WindValues - { - vec4 u_windData; //dirX, strength, dirZ, elapsedTime - }; - - layout (std140) uniform PixelScale - { - float u_pixelScale; - }; - -#if defined (CULLED) - uniform HIGH vec3 u_cameraWorldPosition; -#endif - - VARYING_OUT LOW vec4 v_colour; - - const float SystemHeight = 80.0; - -#if defined(EASE_SNOW) - const float PI = 3.1412; - float ease(float i) - { - return sin((i * PI) / 2.0); - } - - const float FallSpeed = 1.0; - const float WindEffect = 40.0; -#else - float ease(float i) - { - //return sqrt(1.0 - pow(i - 1.0, 2.0)); - return i; - } - const float FallSpeed = 32.0;//16.0; - const float WindEffect = 10.0; -#endif - - void main() - { - mat4 wvp = u_projectionMatrix * u_worldViewMatrix; - vec4 position = a_position; - - float p = position.y - (u_windData.w * FallSpeed); - p = mod(p, SystemHeight); - //p = ease(0.2 + ((p / SystemHeight) * 0.8)); - p = ease((p / SystemHeight)); - - position.y = p * SystemHeight; - - position.x -= p * u_windData.x * u_windData.y * WindEffect; - position.z -= p * u_windData.z * u_windData.y * WindEffect; - - - gl_Position = wvp * position; - gl_PointSize = u_projectionMatrix[1][1] / gl_Position.w * 10.0 * u_pixelScale * (FallSpeed); - - vec4 worldPos = u_worldMatrix * position; - v_colour = a_colour; - -#if defined (CULLED) - vec3 distance = worldPos.xyz - u_cameraWorldPosition; - v_colour.a *= smoothstep(12.25, 16.0, dot(distance, distance)); -#endif - - gl_ClipDistance[0] = dot(worldPos, u_clipPlane); - } -)"; - - static const std::string RainFragment = R"( - #define USE_MRT - #include OUTPUT_LOCATION - - uniform vec4 u_colour = vec4(1.0); - - VARYING_IN vec4 v_colour; - - float ease(float i) - { - //return sqrt(pow(i, 2.0)); - return pow(i, 5.0); - } - - void main() - { - vec4 colour = v_colour * u_colour; - - //if alpha blended - //colour.rgb += (1.0 - colour.a) * colour.rgb; - colour.a *= 0.5 + (0.5 * ease(gl_PointCoord.y)); - - float crop = step(0.495, gl_PointCoord.x); - crop *= 1.0 - step(0.505, gl_PointCoord.x); - - //if(crop < 0.05) discard; - - colour.a *= u_colour.a * crop; - FRAG_OUT = colour; - - LIGHT_OUT = vec4(vec3(0.0), colour.a); - } -)"; constexpr std::int32_t GridX = 3; constexpr std::int32_t GridY = 3; @@ -421,6 +316,84 @@ void GolfState::createClouds() //createSun(); } +void GolfState::createFireworks() +{ + auto mon = cro::SysTime::now().months(); + auto day = cro::SysTime::now().days(); + switch (mon) + { + default: return; + case 1: + if (day != 1) + { + return; + } + break; + case 2: + switch (day) + { + default: return; + case 2: + case 23: + break; + } + break; + case 10: + switch (day) + { + default: return; + //case 6: + case 14: + case 24: + case 31: + break; + } + break; + case 11: + switch (day) + { + default: return; + case 25: + break; + } + break; + } + + cro::SphereBuilder builder(1.f); + const auto meshID = m_resources.meshes.loadMesh(builder); + auto& meshData = m_resources.meshes.getMesh(meshID); + meshData.primitiveType = GL_POINTS; + meshData.indexData[0].primitiveType = GL_POINTS; + + + m_resources.shaders.loadFromString(ShaderID::Firework, FireworkVert, FireworkFragment); + auto& shader = m_resources.shaders.get(ShaderID::Firework); + m_scaleBuffer.addShader(shader); + auto materialID = m_resources.materials.add(shader); + + auto material = m_resources.materials.get(materialID); + material.blendMode = cro::Material::BlendMode::Additive; + auto* fireworkSystem = m_skyScene.addSystem(cro::App::getInstance().getMessageBus(), meshData, material); + + static constexpr float MinRadius = 5.f; + static constexpr float MaxRadius = 9.f; + + static constexpr std::array MinBounds = { -MaxRadius, 2.f, -MaxRadius }; + static constexpr std::array MaxBounds = { MaxRadius, MaxRadius, MaxRadius }; + + auto positions = pd::PoissonDiskSampling(1.75f, MinBounds, MaxBounds); + std::shuffle(positions.begin(), positions.end(), cro::Util::Random::rndEngine); + for (const auto& p : positions) + { + glm::vec3 worldPos(p[0], p[1], p[2]); + const auto l = glm::length(worldPos); + if (l < MaxRadius && l > MinRadius) + { + fireworkSystem->addPosition(worldPos); + } + } +} + void GolfState::buildBow() { if (Social::isGreyscale()) diff --git a/samples/golf/src/golf/server/ServerGolfRules.cpp b/samples/golf/src/golf/server/ServerGolfRules.cpp index f613f8391..4b55362e0 100644 --- a/samples/golf/src/golf/server/ServerGolfRules.cpp +++ b/samples/golf/src/golf/server/ServerGolfRules.cpp @@ -176,7 +176,7 @@ void GolfState::handleRules(std::int32_t groupID, const GolfBallEvent& data) //skins and match play are always in a single group //so we don't consider other players here const auto& currPlayer = playerInfo[0]; - for (auto i = 1; i < playerInfo.size(); ++i) + for (auto i = 1u; i < playerInfo.size(); ++i) { playerInfo[i].distanceToHole = 0.f; playerInfo[i].holeScore[m_currentHole] = currPlayer.holeScore[m_currentHole] + 1; @@ -194,9 +194,9 @@ void GolfState::handleRules(std::int32_t groupID, const GolfBallEvent& data) else { //eliminate anyone who can't beat this score - //again - assume all players exist in the dame group + //again - assume all players exist in the same group const auto& currPlayer = playerInfo[0]; - for (auto i = 1; i < playerInfo.size(); ++i) + for (auto i = 1u; i < playerInfo.size(); ++i) { if (playerInfo[i].holeScore[m_currentHole] >= currPlayer.holeScore[m_currentHole]) { @@ -230,7 +230,7 @@ void GolfState::handleRules(std::int32_t groupID, const GolfBallEvent& data) //force a draw by eliminating anyone who can't beat it if (currPlayer.holeScore[m_currentHole] == m_currentBest) { - for (auto i = 1; i < playerInfo.size(); ++i) + for (auto i = 1u; i < playerInfo.size(); ++i) { if (playerInfo[i].holeScore[m_currentHole] + 1 >= m_currentBest) { @@ -312,7 +312,7 @@ void GolfState::handleRules(std::int32_t groupID, const GolfBallEvent& data) { //skins / match play should always be in the same group const auto& currPlayer = m_playerInfo[groupID].playerInfo[0]; - for (auto i = 1; i < playerInfo.size(); ++i) + for (auto i = 1u; i < playerInfo.size(); ++i) { playerInfo[i].distanceToHole = 0.f; playerInfo[i].holeScore[m_currentHole] = currPlayer.holeScore[m_currentHole] + 1; @@ -332,7 +332,7 @@ void GolfState::handleRules(std::int32_t groupID, const GolfBallEvent& data) { //check if our score is even with anyone holed already and forfeit auto& currPlayer = m_playerInfo[groupID].playerInfo[0]; - for (auto i = 1; i < playerInfo.size(); ++i) + for (auto i = 1u; i < playerInfo.size(); ++i) { if (playerInfo[i].distanceToHole == 0 && playerInfo[i].holeScore[m_currentHole] < currPlayer.holeScore[m_currentHole]) diff --git a/samples/golf/src/golf/server/ServerGolfState.cpp b/samples/golf/src/golf/server/ServerGolfState.cpp index d61ed8b41..3bb4d0d18 100644 --- a/samples/golf/src/golf/server/ServerGolfState.cpp +++ b/samples/golf/src/golf/server/ServerGolfState.cpp @@ -69,6 +69,7 @@ namespace const cro::Time WarnTime = cro::seconds(10.f); bool hadTennisBounce = false; + bool hadWallBounce = false; //glm::vec3 randomOffset3() //{ @@ -344,6 +345,11 @@ void GolfState::handleMessage(const cro::Message& msg) //send tennis achievement sendAchievement(AchievementID::CauseARacket, playerInfo[0].client, playerInfo[0].player); } + + if (hadWallBounce && (data.terrain == TerrainID::Rough || data.terrain == TerrainID::Green || data.terrain == TerrainID::Fairway)) + { + sendAchievement(AchievementID::OffTheWall, playerInfo[0].client, playerInfo[0].player); + } } else if (data.type == GolfBallEvent::Gimme) { @@ -377,6 +383,10 @@ void GolfState::handleMessage(const cro::Message& msg) LogI << "Deuce!" << std::endl; hadTennisBounce = true; break; + case TriggerID::BackWall: + LogI << "FORE" << std::endl; + hadWallBounce = true; + break; } } else if (msg.id == sv::MessageID::BullsEyeMessage) @@ -934,6 +944,7 @@ void GolfState::setNextPlayer(std::int32_t groupID, bool newHole) }; hadTennisBounce = false; + hadWallBounce = false; auto& playerInfo = m_playerInfo[groupID].playerInfo; diff --git a/samples/golf/src/golf/shaders/Weather.inl b/samples/golf/src/golf/shaders/Weather.inl new file mode 100644 index 000000000..55d76341a --- /dev/null +++ b/samples/golf/src/golf/shaders/Weather.inl @@ -0,0 +1,187 @@ +/*----------------------------------------------------------------------- + +Matt Marchant 2021 - 2024 +http://trederia.blogspot.com + +Super Video Golf - zlib licence. + +This software is provided 'as-is', without any express or +implied warranty.In no event will the authors be held +liable for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute +it freely, subject to the following restrictions : + +1. The origin of this software must not be misrepresented; +you must not claim that you wrote the original software. +If you use this software in a product, an acknowledgment +in the product documentation would be appreciated but +is not required. + +2. Altered source versions must be plainly marked as such, +and must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any +source distribution. + +-----------------------------------------------------------------------*/ + +#pragma once + +#include + +static const inline std::string WeatherVertex = R"( + ATTRIBUTE vec4 a_position; + ATTRIBUTE vec4 a_colour; + + uniform mat4 u_worldMatrix; + uniform mat4 u_worldViewMatrix; + uniform mat4 u_projectionMatrix; + uniform vec4 u_clipPlane; + + layout (std140) uniform WindValues + { + vec4 u_windData; //dirX, strength, dirZ, elapsedTime + }; + + layout (std140) uniform PixelScale + { + float u_pixelScale; + }; + +#if defined (CULLED) + uniform HIGH vec3 u_cameraWorldPosition; +#endif + + VARYING_OUT LOW vec4 v_colour; + + const float SystemHeight = 80.0; + +#if defined(EASE_SNOW) + const float PI = 3.1412; + float ease(float i) + { + return sin((i * PI) / 2.0); + } + + const float FallSpeed = 1.0; + const float WindEffect = 40.0; +#else + float ease(float i) + { + //return sqrt(1.0 - pow(i - 1.0, 2.0)); + return i; + } + const float FallSpeed = 32.0;//16.0; + const float WindEffect = 10.0; +#endif + + void main() + { + mat4 wvp = u_projectionMatrix * u_worldViewMatrix; + vec4 position = a_position; + + float p = position.y - (u_windData.w * FallSpeed); + p = mod(p, SystemHeight); + //p = ease(0.2 + ((p / SystemHeight) * 0.8)); + p = ease((p / SystemHeight)); + + position.y = p * SystemHeight; + + position.x -= p * u_windData.x * u_windData.y * WindEffect; + position.z -= p * u_windData.z * u_windData.y * WindEffect; + + + gl_Position = wvp * position; + gl_PointSize = u_projectionMatrix[1][1] / gl_Position.w * 10.0 * u_pixelScale * (FallSpeed); + + vec4 worldPos = u_worldMatrix * position; + v_colour = a_colour; + +#if defined (CULLED) + vec3 distance = worldPos.xyz - u_cameraWorldPosition; + v_colour.a *= smoothstep(12.25, 16.0, dot(distance, distance)); +#endif + + gl_ClipDistance[0] = dot(worldPos, u_clipPlane); + } +)"; + +static const inline std::string RainFragment = R"( + #define USE_MRT + #include OUTPUT_LOCATION + + uniform vec4 u_colour = vec4(1.0); + + VARYING_IN vec4 v_colour; + + float ease(float i) + { + //return sqrt(pow(i, 2.0)); + return pow(i, 5.0); + } + + void main() + { + vec4 colour = v_colour * u_colour; + + //if alpha blended + //colour.rgb += (1.0 - colour.a) * colour.rgb; + colour.a *= 0.5 + (0.5 * ease(gl_PointCoord.y)); + + float crop = step(0.495, gl_PointCoord.x); + crop *= 1.0 - step(0.505, gl_PointCoord.x); + + //if(crop < 0.05) discard; + + colour.a *= u_colour.a * crop; + FRAG_OUT = colour; + + LIGHT_OUT = vec4(vec3(0.0), colour.a); + } +)"; + +static const inline std::string FireworkVert = R"( +ATTRIBUTE vec4 a_position; + +#include WVP_UNIFORMS + +uniform float u_size = 1.0; +uniform float u_progress = 0.0; + +layout (std140) uniform PixelScale +{ + float u_pixelScale; +}; + +const float Gravity = 0.06; +const float PointSize = 15.0; + +void main() +{ + vec4 position = a_position; + position.y -= (Gravity * u_progress) * u_progress; + + gl_Position = u_projectionMatrix * u_worldViewMatrix * position; + + gl_PointSize = u_progress * PointSize * u_size * u_pixelScale * (u_projectionMatrix[1][1] / gl_Position.w); +})"; + + +static const inline std::string FireworkFragment = R"( + +uniform float u_progress = 0.0; +uniform vec4 u_colour = vec4(1.0); + +OUTPUT + +const float stepPos = (0.499 * 0.499); + +void main() +{ + vec2 coord = gl_PointCoord - vec2(0.5); + float len2 = dot(coord, coord); + + FRAG_OUT = vec4(u_colour.rgb * pow(2.0, -8.0 * u_progress) * (1.0 - step(stepPos, len2)), 1.0); +})"; \ No newline at end of file diff --git a/samples/golf/src/golf/shaders/WireframeShader.inl b/samples/golf/src/golf/shaders/WireframeShader.inl index a27f4cf4c..c0add08bf 100644 --- a/samples/golf/src/golf/shaders/WireframeShader.inl +++ b/samples/golf/src/golf/shaders/WireframeShader.inl @@ -121,6 +121,7 @@ static inline const std::string WireframeFragment = R"( VARYING_IN vec2 v_texCoord; const float TAU = 6.28; + const float stepPos = (0.499 * 0.499); void main() { @@ -138,5 +139,11 @@ static inline const std::string WireframeFragment = R"( NORM_OUT = vec4(0.0); LIGHT_OUT = vec4(vec3(0.0), 1.0); #endif + +#if defined(POINT_RADIUS) + vec2 coord = gl_PointCoord - vec2(0.5); + float pos = dot(coord, coord); + FRAG_OUT.a *= 1.0 - step(stepPos, pos); +#endif } )"; \ No newline at end of file