diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 016ac951b..b21ce1b00 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -533,7 +533,7 @@ Debian stable Clang: artifacts: paths: - "build.clang/bin/" - - "build.clang/src/comptime.h" + - "build.clang/src/config.h" expose_as: "clang" name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-clang" @@ -564,7 +564,7 @@ Debian stable Clang: - - | # cmake echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles" - - cmake -B build.clang -D CPM_USE_LOCAL_PACKAGES:BOOL=ON -D SRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -D SRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -G "Unix Makefiles" + - cmake -B build.clang -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_USE_LIBGME:BOOL=OFF -G "Unix Makefiles" - | # cmake echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K" @@ -572,7 +572,7 @@ Debian stable Clang: - - | # make echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2" - - make --directory=build.clang --keep-going || make --directory=src --keep-going + - make --directory=build.clang --keep-going || make --directory=build.clang --keep-going - | # make echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K" @@ -589,7 +589,7 @@ Debian testing Clang: artifacts: paths: - "build.clang/bin/" - - "build.clang/src/comptime.h" + - "build.clang/src/config.h" expose_as: "testing-clang" name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-testing-clang" @@ -764,3 +764,85 @@ Alpine 3 GCC Dedicated: - | # make echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K" + +osxcross x86_64: + stage: build + + artifacts: + paths: + - "build.osxcross/bin/" + - "build.osxcross/src/config.h" + expose_as: "Mac x86_64" + name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-clang" + + variables: + OSXCROSS_HOST: x86_64-apple-darwin21.4 + LD: x86_64-apple-darwin21.4-ld + + script: + - - | + # apt_development + echo -e "\e[0Ksection_start:`date +%s`:macports_development[collapsed=true]\r\e[0KInstalling development packages" + - osxcross-macports install curl libopenmpt libsdl2_mixer + - | + # apt_development + echo -e "\e[0Ksection_end:`date +%s`:macports_development\r\e[0K" + + - - | + # make + echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KBuilding Makefiles" + - cmake -B build.osxcross --toolchain /osxcross/toolchain.cmake -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DOPENMPT_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/include" -DSDL2_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/lib" -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_CONFIG_USE_GME:BOOL=OFF -G "Unix Makefiles" + - | + # make + echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K" + + - - | + # make + echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2" + - make --directory=build.osxcross --keep-going || make --directory=build.osxcross --keep-going + - | + # make + echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K" + +osxcross arm64: + stage: build + + when: manual + + allow_failure: true + + artifacts: + paths: + - "build.osxcross/bin/" + - "build.osxcross/src/config.h" + expose_as: "Mac arm64" + name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-clang" + + variables: + OSXCROSS_HOST: arm64-apple-darwin21.4 + LD: arm64-apple-darwin21.4-ld + + script: + - - | + # apt_development + echo -e "\e[0Ksection_start:`date +%s`:macports_development[collapsed=true]\r\e[0KInstalling development packages" + - osxcross-macports install --arm64 curl libopenmpt libsdl2_mixer + - | + # apt_development + echo -e "\e[0Ksection_end:`date +%s`:macports_development\r\e[0K" + + - - | + # make + echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KBuilding Makefiles" + - cmake -B build.osxcross --toolchain /osxcross/toolchain.cmake -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DOPENMPT_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/include" -DSDL2_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/lib" -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_CONFIG_USE_GME:BOOL=OFF -G "Unix Makefiles" + - | + # make + echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K" + + - - | + # make + echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2" + - make --directory=build.osxcross --keep-going || make --directory=build.osxcross --keep-going + - | + # make + echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K" diff --git a/CMakeLists.txt b/CMakeLists.txt index 8803620e7..358e62cc4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,6 +70,7 @@ cmake_dependent_option( OFF ) option(SRB2_CONFIG_HWRENDER "Enable hardware render (OpenGL) support" ON) +option(SRB2_CONFIG_USE_GME "Enable GME playback support" OFF) option(SRB2_CONFIG_STATIC_OPENGL "Enable static linking GL (do not do this)" OFF) option(SRB2_CONFIG_ERRORMODE "Compile C code with warnings treated as errors." OFF) option(SRB2_CONFIG_DEBUGMODE "Compile with PARANOIA, ZDEBUG, RANGECHECK and PACKETDROP defined." OFF) diff --git a/libs/SDL2/WhatsNew.txt b/libs/SDL2/WhatsNew.txt index 4e17d25aa..28f60c98a 100644 --- a/libs/SDL2/WhatsNew.txt +++ b/libs/SDL2/WhatsNew.txt @@ -1,28 +1,9 @@ This is a list of major changes in SDL's version history. ---------------------------------------------------------------------------- -2.30.0: ---------------------------------------------------------------------------- - -General: -* Added support for 2 bits-per-pixel indexed surface formats -* Added the function SDL_GameControllerGetSteamHandle() to get the Steam API handle for a controller, if available -* Added the event SDL_CONTROLLERSTEAMHANDLEUPDATED which is sent when the Steam API handle for a controller changes. This could also change the name, VID, and PID of the controller. -* Added the environment variable SDL_LOGGING to control default log output - -macOS: -* Added the hint SDL_HINT_JOYSTICK_IOKIT to control whether the IOKit controller driver should be used -* Added the hint SDL_HINT_JOYSTICK_MFI to control whether the GCController controller driver should be used -* Added the hint SDL_HINT_RENDER_METAL_PREFER_LOW_POWER_DEVICE to choose whether high or low power GPU should be used for rendering, in the case where there are multiple GPUs available - -Xbox: -* Added the function SDL_GDKGetDefaultUser() - --------------------------------------------------------------------------- 2.28.2: --------------------------------------------------------------------------- - General: * Added the hint SDL_HINT_JOYSTICK_WGI to control whether to use Windows.Gaming.Input for controllers diff --git a/libs/SDL2/docs/README-android.md b/libs/SDL2/docs/README-android.md index 6b4307839..f08493529 100644 --- a/libs/SDL2/docs/README-android.md +++ b/libs/SDL2/docs/README-android.md @@ -72,7 +72,7 @@ done in the build directory for the app! For more complex projects, follow these instructions: 1. Get the source code for SDL and copy the 'android-project' directory located at SDL/android-project to a suitable location. Also make sure to rename it to your project name (In these examples: YOURPROJECT). - + (The 'android-project' directory can basically be seen as a sort of starting point for the android-port of your project. It contains the glue code between the Android Java 'frontend' and the SDL code 'backend'. It also contains some standard behaviour, like how events should be handled, which you will be able to change.) 2. Move or [symlink](https://en.wikipedia.org/wiki/Symbolic_link) the SDL directory into the "YOURPROJECT/app/jni" directory diff --git a/libs/SDL2/docs/README-dynapi.md b/libs/SDL2/docs/README-dynapi.md index 6d447eab6..8eb6fb21e 100644 --- a/libs/SDL2/docs/README-dynapi.md +++ b/libs/SDL2/docs/README-dynapi.md @@ -35,7 +35,7 @@ SDL now has, internally, a table of function pointers. So, this is what SDL_Init now looks like: ```c -Uint32 SDL_Init(Uint32 flags) +UInt32 SDL_Init(Uint32 flags) { return jump_table.SDL_Init(flags); } @@ -100,7 +100,7 @@ a shared library of its own). If so, it loads that library and looks for and calls a single function: ```c -Sint32 SDL_DYNAPI_entry(Uint32 version, void *table, Uint32 tablesize); +SInt32 SDL_DYNAPI_entry(Uint32 version, void *table, Uint32 tablesize); ``` That function takes a version number (more on that in a moment), the address of diff --git a/libs/SDL2/docs/README-emscripten.md b/libs/SDL2/docs/README-emscripten.md index cefad99c4..f952b08e4 100644 --- a/libs/SDL2/docs/README-emscripten.md +++ b/libs/SDL2/docs/README-emscripten.md @@ -1,187 +1,27 @@ # Emscripten -## The state of things +(This documentation is not very robust; we will update and expand this later.) -(As of September 2023, but things move quickly and we don't update this -document often.) - -In modern times, all the browsers you probably care about (Chrome, Firefox, -Edge, and Safari, on Windows, macOS, Linux, iOS and Android), support some -reasonable base configurations: - -- WebAssembly (don't bother with asm.js any more) -- WebGL (which will look like OpenGL ES 2 or 3 to your app). -- Threads (see caveats, though!) -- Game controllers -- Autoupdating (so you can assume they have a recent version of the browser) - -All this to say we're at the point where you don't have to make a lot of -concessions to get even a fairly complex SDL-based game up and running. - - -## RTFM - -This document is a quick rundown of some high-level details. The -documentation at [emscripten.org](https://emscripten.org/) is vast -and extremely detailed for a wide variety of topics, and you should at -least skim through it at some point. - - -## Porting your app to Emscripten - -Many many things just need some simple adjustments and they'll compile -like any other C/C++ code, as long as SDL was handling the platform-specific -work for your program. - -First, you probably need this in at least one of your source files: - -```c -#ifdef __EMSCRIPTEN__ -#include -#endif -``` - -Second: assembly language code has to go. Replace it with C. You can even use -[x86 SIMD intrinsic functions in Emscripten](https://emscripten.org/docs/porting/simd.html)! - -Third: Middleware has to go. If you have a third-party library you link -against, you either need an Emscripten port of it, or the source code to it -to compile yourself, or you need to remove it. - -Fourth: You still start in a function called main(), but you need to get out of -it and into a function that gets called repeatedly, and returns quickly, -called a mainloop. - -Somewhere in your program, you probably have something that looks like a more -complicated version of this: - -```c -void main(void) -{ - initialize_the_game(); - while (game_is_still_running) { - check_for_new_input(); - think_about_stuff(); - draw_the_next_frame(); - } - deinitialize_the_game(); -} -``` - -This will not work on Emscripten, because the main thread needs to be free -to do stuff and can't sit in this loop forever. So Emscripten lets you set up -a [mainloop](https://emscripten.org/docs/porting/emscripten-runtime-environment.html#browser-main-loop). - -```c -static void mainloop(void) /* this will run often, possibly at the monitor's refresh rate */ -{ - if (!game_is_still_running) { - deinitialize_the_game(); - #ifdef __EMSCRIPTEN__ - emscripten_cancel_main_loop(); /* this should "kill" the app. */ - #else - exit(0); - #endif - } - - check_for_new_input(); - think_about_stuff(); - draw_the_next_frame(); -} - -void main(void) -{ - initialize_the_game(); - #ifdef __EMSCRIPTEN__ - emscripten_set_main_loop(mainloop, 0, 1); - #else - while (1) { mainloop(); } - #endif -} -``` - -Basically, `emscripten_set_main_loop(mainloop, 0, 1);` says "run -`mainloop` over and over until I end the program." The function will -run, and return, freeing the main thread for other tasks, and then -run again when it's time. The `1` parameter does some magic to make -your main() function end immediately; this is useful because you -don't want any shutdown code that might be sitting below this code -to actually run if main() were to continue on, since we're just -getting started. - -There's a lot of little details that are beyond the scope of this -document, but that's the biggest intial set of hurdles to porting -your app to the web. - - -## Do you need threads? - -If you plan to use threads, they work on all major browsers now. HOWEVER, -they bring with them a lot of careful considerations. Rendering _must_ -be done on the main thread. This is a general guideline for many -platforms, but a hard requirement on the web. - -Many other things also must happen on the main thread; often times SDL -and Emscripten make efforts to "proxy" work to the main thread that -must be there, but you have to be careful (and read more detailed -documentation than this for the finer points). - -Even when using threads, your main thread needs to set an Emscripten -mainloop that runs quickly and returns, or things will fail to work -correctly. - -You should definitely read [Emscripten's pthreads docs](https://emscripten.org/docs/porting/pthreads.html) -for all the finer points. Mostly SDL's thread API will work as expected, -but is built on pthreads, so it shares the same little incompatibilities -that are documented there, such as where you can use a mutex, and when -a thread will start running, etc. - - -IMPORTANT: You have to decide to either build something that uses -threads or something that doesn't; you can't have one build -that works everywhere. This is an Emscripten (or maybe WebAssembly? -Or just web browsers in general?) limitation. If you aren't using -threads, it's easier to not enable them at all, at build time. - -If you use threads, you _have to_ run from a web server that has -[COOP/COEP headers set correctly](https://web.dev/why-coop-coep/) -or your program will fail to start at all. - -If building with threads, `__EMSCRIPTEN_PTHREADS__` will be defined -for checking with the C preprocessor, so you can build something -different depending on what sort of build you're compiling. - - -## Audio - -Audio works as expected at the API level, but not exactly like other -platforms. - -You'll only see a single default audio device. Audio capture also works; -if the browser pops up a prompt to ask for permission to access the -microphone, the SDL_OpenAudioDevice call will succeed and start producing -silence at a regular interval. Once the user approves the request, real -audio data will flow. If the user denies it, the app is not informed and -will just continue to receive silence. +## A quick note about audio Modern web browsers will not permit web pages to produce sound before the -user has interacted with them (clicked or tapped on them, usually); this is -for several reasons, not the least of which being that no one likes when a -random browser tab suddenly starts making noise and the user has to scramble -to figure out which and silence it. +user has interacted with them; this is for several reasons, not the least +of which being that no one likes when a random browser tab suddenly starts +making noise and the user has to scramble to figure out which and silence +it. -SDL will allow you to open the audio device for playback in this -circumstance, and your audio callback will fire, but SDL will throw the audio -data away until the user interacts with the page. This helps apps that depend -on the audio callback to make progress, and also keeps audio playback in sync -once the app is finally allowed to make noise. +To solve this, most browsers will refuse to let a web app use the audio +subsystem at all before the user has interacted with (clicked on) the page +in a meaningful way. SDL-based apps also have to deal with this problem; if +the user hasn't interacted with the page, SDL_OpenAudioDevice will fail. -There are two reasonable ways to deal with the silence at the app level: -if you are writing some sort of media player thing, where the user expects -there to be a volume control when you mouseover the canvas, just default -that control to a muted state; if the user clicks on the control to unmute -it, on this first click, open the audio device. This allows the media to -play at start, and the user can reasonably opt-in to listening. +There are two reasonable ways to deal with this: if you are writing some +sort of media player thing, where the user expects there to be a volume +control when you mouseover the canvas, just default that control to a muted +state; if the user clicks on the control to unmute it, on this first click, +open the audio device. This allows the media to play at start, the user can +reasonably opt-in to listening, and you never get access denied to the audio +device. Many games do not have this sort of UI, and are more rigid about starting audio along with everything else at the start of the process. For these, your @@ -196,179 +36,41 @@ Please see the discussion at https://github.com/libsdl-org/SDL/issues/6385 for some Javascript code to steal for this approach. -## Rendering - -If you use SDL's 2D render API, it will use GLES2 internally, which -Emscripten will turn into WebGL calls. You can also use OpenGL ES 2 -directly by creating a GL context and drawing into it. - -Calling SDL_RenderPresent (or SDL_GL_SwapWindow) will not actually -present anything on the screen until your return from your mainloop -function. - - ## Building SDL/emscripten -First: do you _really_ need to build SDL from source? - -If you aren't developing SDL itself, have a desire to mess with its source -code, or need something on the bleeding edge, don't build SDL. Just use -Emscripten's packaged version! - -Compile and link your app with `-sUSE_SDL=2` and it'll use a build of -SDL packaged with Emscripten. This comes from the same source code and -fixes the Emscripten project makes to SDL are generally merged into SDL's -revision control, so often this is much easier for app developers. - -`-sUSE_SDL=1` will select Emscripten's JavaScript reimplementation of SDL -1.2 instead; if you need SDL 1.2, this might be fine, but we generally -recommend you don't use SDL 1.2 in modern times. - - -If you want to build SDL, though... - SDL currently requires at least Emscripten 3.1.35 to build. Newer versions are likely to work, as well. Build: -This works on Linux/Unix and macOS. Please send comments about Windows. - -Make sure you've [installed emsdk](https://emscripten.org/docs/getting_started/downloads.html) -first, and run `source emsdk_env.sh` at the command line so it finds the -tools. - -(These configure options might be overkill, but this has worked for me.) - -```bash -cd SDL -mkdir build -cd build -emconfigure ../configure --host=wasm32-unknown-emscripten --disable-pthreads --disable-assembly --disable-cpuinfo CFLAGS="-sUSE_SDL=0 -O3" -emmake make -j4 -``` - -If you want to build with thread support, something like this works: - -```bash -emconfigure ../configure --host=wasm32-unknown-emscripten --enable-pthreads --disable-assembly --disable-cpuinfo CFLAGS="-sUSE_SDL=0 -O3 -pthread" LDFLAGS="-pthread" -``` + $ mkdir build + $ cd build + $ emconfigure ../configure --host=asmjs-unknown-emscripten --disable-assembly --disable-threads --disable-cpuinfo CFLAGS="-O2" + $ emmake make Or with cmake: -```bash -mkdir build -cd build -emcmake cmake .. -emmake make -j4 -``` + $ mkdir build + $ cd build + $ emcmake cmake .. + $ emmake make To build one of the tests: -```bash -cd test/ -emcc -O2 --js-opts 0 -g4 testdraw2.c -I../include ../build/.libs/libSDL2.a ../build/libSDL2_test.a -o a.html -``` + $ cd test/ + $ emcc -O2 --js-opts 0 -g4 testdraw2.c -I../include ../build/.libs/libSDL2.a ../build/libSDL2_test.a -o a.html -## Building your app +Uses GLES2 renderer or software -You need to compile with `emcc` instead of `gcc` or `clang` or whatever, but -mostly it uses the same command line arguments as Clang. +Some other SDL2 libraries can be easily built (assuming SDL2 is installed somewhere): -Link against the SDL/build/.libs/libSDL2.a file you generated by building SDL, -link with `-sUSE_SDL=2` to use Emscripten's prepackaged SDL2 build. - -Usually you would produce a binary like this: - -```bash -gcc -o mygame mygame.c # or whatever -``` - -But for Emscripten, you want to output something else: - -```bash -emcc -o index.html mygame.c -``` - -This will produce several files...support Javascript and WebAssembly (.wasm) -files. The `-o index.html` will produce a simple HTML page that loads and -runs your app. You will (probably) eventually want to replace or customize -that file and do `-o index.js` instead to just build the code pieces. - -If you're working on a program of any serious size, you'll likely need to -link with `-sALLOW_MEMORY_GROWTH=1 -sMAXIMUM_MEMORY=1gb` to get access -to more memory. If using pthreads, you'll need the `-sMAXIMUM_MEMORY=1gb` -or the app will fail to start on iOS browsers, but this might be a bug that -goes away in the future. - - -## Data files - -Your game probably has data files. Here's how to access them. - -Filesystem access works like a Unix filesystem; you have a single directory -tree, possibly interpolated from several mounted locations, no drive letters, -'/' for a path separator. You can access them with standard file APIs like -open() or fopen() or SDL_RWops. You can read or write from the filesystem. - -By default, you probably have a "MEMFS" filesystem (all files are stored in -memory, but access to them is immediate and doesn't need to block). There are -other options, like "IDBFS" (files are stored in a local database, so they -don't need to be in RAM all the time and they can persist between runs of the -program, but access is not synchronous). You can mix and match these file -systems, mounting a MEMFS filesystem at one place and idbfs elsewhere, etc, -but that's beyond the scope of this document. Please refer to Emscripten's -[page on the topic](https://emscripten.org/docs/porting/files/file_systems_overview.html) -for more info. - -The _easiest_ (but not the best) way to get at your data files is to embed -them in the app itself. Emscripten's linker has support for automating this. - -```bash -emcc -o index.html loopwave.c --embed-file=../test/sample.wav@/sounds/sample.wav -``` - -This will pack ../test/sample.wav in your app, and make it available at -"/sounds/sample.wav" at runtime. Emscripten makes sure this data is available -before your main() function runs, and since it's in MEMFS, you can just -read it like you do on other platforms. `--embed-file` can also accept a -directory to pack an entire tree, and you can specify the argument multiple -times to pack unrelated things into the final installation. - -Note that this is absolutely the best approach if you have a few small -files to include and shouldn't worry about the issue further. However, if you -have hundreds of megabytes and/or thousands of files, this is not so great, -since the user will download it all every time they load your page, and it -all has to live in memory at runtime. - -[Emscripten's documentation on the matter](https://emscripten.org/docs/porting/files/packaging_files.html) -gives other options and details, and is worth a read. - - -## Debugging - -Debugging web apps is a mixed bag. You should compile and link with -`-gsource-map`, which embeds a ton of source-level debugging information into -the build, and make sure _the app source code is available on the web server_, -which is often a scary proposition for various reasons. - -When you debug from the browser's tools and hit a breakpoint, you can step -through the actual C/C++ source code, though, which can be nice. - -If you try debugging in Firefox and it doesn't work well for no apparent -reason, try Chrome, and vice-versa. These tools are still relatively new, -and improving all the time. - -SDL_Log() (or even plain old printf) will write to the Javascript console, -and honestly I find printf-style debugging to be easier than setting up a build -for proper debugging, so use whatever tools work best for you. - - -## Questions? - -Please give us feedback on this document at [the SDL bug tracker](https://github.com/libsdl-org/SDL/issues). -If something is wrong or unclear, we want to know! +SDL_mixer (http://www.libsdl.org/projects/SDL_mixer/): + $ EMCONFIGURE_JS=1 emconfigure ../configure + build as usual... +SDL_gfx (http://cms.ferzkopp.net/index.php/software/13-sdl-gfx): + $ EMCONFIGURE_JS=1 emconfigure ../configure --disable-mmx + build as usual... diff --git a/libs/SDL2/docs/README-gdk.md b/libs/SDL2/docs/README-gdk.md index 7997c065b..903265f32 100644 --- a/libs/SDL2/docs/README-gdk.md +++ b/libs/SDL2/docs/README-gdk.md @@ -3,7 +3,7 @@ GDK This port allows SDL applications to run via Microsoft's Game Development Kit (GDK). -Windows (GDK) and Xbox One/Xbox Series (GDKX) are both supported and all the required code is included in this public SDL release. However, only licensed Xbox developers have access to the GDKX libraries which will allow you to build the Xbox targets. +Windows (GDK) and Xbox One/Xbox Series (GDKX) are supported. Although most of the Xbox code is included in the public SDL source code, NDA access is required for a small number of source files. If you have access to GDKX, these required Xbox files are posted on the GDK forums [here](https://forums.xboxlive.com/questions/130003/). Requirements @@ -11,7 +11,6 @@ Requirements * Microsoft Visual Studio 2022 (in theory, it should also work in 2017 or 2019, but this has not been tested) * Microsoft GDK June 2022 or newer (public release [here](https://github.com/microsoft/GDK/releases/tag/June_2022)) -* For Xbox, you will need the corresponding GDKX version (licensed developers only) * To publish a package or successfully authenticate a user, you will need to create an app id/configure services in Partner Center. However, for local testing purposes (without authenticating on Xbox Live), the identifiers used by the GDK test programs in the included solution will work. @@ -30,12 +29,6 @@ The Windows GDK port supports the full set of Win32 APIs, renderers, controllers * Global task queue callbacks are dispatched during `SDL_PumpEvents` (which is also called internally if using `SDL_PollEvent`). * You can get the handle of the global task queue through `SDL_GDKGetTaskQueue`, if needed. When done with the queue, be sure to use `XTaskQueueCloseHandle` to decrement the reference count (otherwise it will cause a resource leak). -* Single-player games have some additional features available: - * Call `SDL_GDKGetDefaultUser` to get the default XUserHandle pointer. - * `SDL_GetPrefPath` still works, but only for single-player titles. - - These functions mostly wrap around async APIs, and thus should be treated as synchronous alternatives. Also note that the single-player functions return on any OS errors, so be sure to validate the return values! - * What doesn't work: * Compilation with anything other than through the included Visual C++ solution file @@ -146,20 +139,6 @@ To create the package: 6. Once the package is installed, you can run it from the start menu. 7. As with when running from Visual Studio, if you need to test any Xbox Live functionality you must switch to the correct sandbox. -Xbox GDKX Setup ---------------------- -In general, the same process in the Windows GDK instructions work. There are just a few additional notes: -* For Xbox One consoles, use the Gaming.Xbox.XboxOne.x64 target -* For Xbox Series consoles, use the Gaming.Xbox.Scarlett.x64 target -* The Xbox One target sets the `__XBOXONE__` define and the Xbox Series target sets the `__XBOXSERIES__` define -* You don't need to link against the Xbox.Services Thunks lib nor include that dll in your package (it doesn't exist for Xbox) -* The shader blobs for Xbox are created in a pre-build step for the Xbox targets, rather than included in the source (due to NDA and version compatability reasons) -* To create a package, use: - `makepkg pack /f PackageLayout.xml /lt /d . /pd Package` -* To install the package, use: - `xbapp install [PACKAGE].xvc` -* For some reason, if you make changes that require SDL2.dll to build, and you are running through the debugger (instead of a package), you have to rebuild your .exe target for the debugger to recognize the dll has changed and needs to be transferred to the console again -* While there are successful releases of Xbox titles using this port, it is not as extensively tested as other targets Troubleshooting --------------- diff --git a/libs/SDL2/docs/README-ios.md b/libs/SDL2/docs/README-ios.md index 8fb90de46..f5a3a83bf 100644 --- a/libs/SDL2/docs/README-ios.md +++ b/libs/SDL2/docs/README-ios.md @@ -273,7 +273,7 @@ e.g. { ... initialize game ... - #ifdef __IPHONEOS__ + #if __IPHONEOS__ // Initialize the Game Center for scoring and matchmaking InitGameCenter(); diff --git a/libs/SDL2/i686-w64-mingw32/bin/SDL2.dll b/libs/SDL2/i686-w64-mingw32/bin/SDL2.dll index 3265fb2f3..573225cab 100755 Binary files a/libs/SDL2/i686-w64-mingw32/bin/SDL2.dll and b/libs/SDL2/i686-w64-mingw32/bin/SDL2.dll differ diff --git a/libs/SDL2/i686-w64-mingw32/bin/sdl2-config b/libs/SDL2/i686-w64-mingw32/bin/sdl2-config index fc399f745..aa99b065a 100755 --- a/libs/SDL2/i686-w64-mingw32/bin/sdl2-config +++ b/libs/SDL2/i686-w64-mingw32/bin/sdl2-config @@ -43,7 +43,7 @@ while test $# -gt 0; do echo $exec_prefix ;; --version) - echo 2.30.0 + echo 2.28.5 ;; --cflags) echo -I${prefix}/include/SDL2 -Dmain=SDL_main diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL.h index 20c903b2f..9ba8f68c6 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_assert.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_assert.h index a396d4e02..7ce823ec5 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_assert.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_assert.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_atomic.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_atomic.h index 1fa18f49f..1dd816a38 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_atomic.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_atomic.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -209,7 +209,7 @@ typedef void (*SDL_KernelMemoryBarrierFunc)(); #if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) || defined(__ARM_ARCH_8A__) #define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory") #define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory") -#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) +#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_5TE__) #ifdef __thumb__ /* The mcr instruction isn't available in thumb mode, use real functions */ #define SDL_MEMORY_BARRIER_USES_FUNCTION diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_audio.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_audio.h index bd8e7ab6f..ccd35982d 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_audio.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_audio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_bits.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_bits.h index 83e8a78c7..81161ae5f 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_bits.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_bits.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_blendmode.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_blendmode.h index 09d01477d..4ecbe5078 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_blendmode.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_blendmode.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -65,8 +65,8 @@ typedef enum typedef enum { SDL_BLENDOPERATION_ADD = 0x1, /**< dst + src: supported by all renderers */ - SDL_BLENDOPERATION_SUBTRACT = 0x2, /**< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES */ - SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, /**< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES */ + SDL_BLENDOPERATION_SUBTRACT = 0x2, /**< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES */ + SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, /**< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES */ SDL_BLENDOPERATION_MINIMUM = 0x4, /**< min(dst, src) : supported by D3D9, D3D11 */ SDL_BLENDOPERATION_MAXIMUM = 0x5 /**< max(dst, src) : supported by D3D9, D3D11 */ } SDL_BlendOperation; diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_clipboard.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_clipboard.h index bd4b044c6..7c351fbb9 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_clipboard.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_clipboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_config.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_config.h index dba780860..01322c182 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_config.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_config.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_cpuinfo.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_cpuinfo.h index 2a9dd380c..ed5e97915 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_cpuinfo.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_cpuinfo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_egl.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_egl.h index a4276e681..6f51c0831 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_egl.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_egl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_endian.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_endian.h index 591ccac42..71bc06729 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_endian.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_endian.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_error.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_error.h index 2df6463ad..31c22616c 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_error.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_error.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_events.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_events.h index eccbba255..9d0970318 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_events.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_events.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -131,8 +131,6 @@ typedef enum SDL_CONTROLLERTOUCHPADMOTION, /**< Game controller touchpad finger was moved */ SDL_CONTROLLERTOUCHPADUP, /**< Game controller touchpad finger was lifted */ SDL_CONTROLLERSENSORUPDATE, /**< Game controller sensor was updated */ - SDL_CONTROLLERUPDATECOMPLETE_RESERVED_FOR_SDL3, - SDL_CONTROLLERSTEAMHANDLEUPDATED, /**< Game controller Steam handle has changed */ /* Touch events */ SDL_FINGERDOWN = 0x700, @@ -448,7 +446,7 @@ typedef struct SDL_ControllerButtonEvent */ typedef struct SDL_ControllerDeviceEvent { - Uint32 type; /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, ::SDL_CONTROLLERDEVICEREMAPPED, or ::SDL_CONTROLLERSTEAMHANDLEUPDATED */ + Uint32 type; /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, or ::SDL_CONTROLLERDEVICEREMAPPED */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */ } SDL_ControllerDeviceEvent; @@ -582,6 +580,15 @@ typedef struct SDL_QuitEvent Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ } SDL_QuitEvent; +/** + * \brief OS Specific event + */ +typedef struct SDL_OSEvent +{ + Uint32 type; /**< ::SDL_QUIT */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ +} SDL_OSEvent; + /** * \brief A user-defined event type (event.user.*) */ diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_filesystem.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_filesystem.h index 07498898d..4cad657ec 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_filesystem.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_filesystem.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -64,7 +64,7 @@ extern "C" { * directory of the application as it is uncommon to store resources outside * the executable. As such it is not a writable directory. * - * The returned path is guaranteed to end with a path separator ('\\' on + * The returned path is guaranteed to end with a path separator ('\' on * Windows, '/' on most other platforms). * * The pointer returned is owned by the caller. Please call SDL_free() on the @@ -120,7 +120,7 @@ extern DECLSPEC char *SDLCALL SDL_GetBasePath(void); * - ...only use letters, numbers, and spaces. Avoid punctuation like "Game * Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient. * - * The returned path is guaranteed to end with a path separator ('\\' on + * The returned path is guaranteed to end with a path separator ('\' on * Windows, '/' on most other platforms). * * The pointer returned is owned by the caller. Please call SDL_free() on the diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_gamecontroller.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_gamecontroller.h index 281fa356c..140054d36 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_gamecontroller.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_gamecontroller.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -73,8 +73,7 @@ typedef enum SDL_CONTROLLER_TYPE_NVIDIA_SHIELD, SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_LEFT, SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT, - SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_PAIR, - SDL_CONTROLLER_TYPE_MAX + SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_PAIR } SDL_GameControllerType; typedef enum @@ -524,20 +523,6 @@ extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetFirmwareVersion(SDL_GameCont */ extern DECLSPEC const char * SDLCALL SDL_GameControllerGetSerial(SDL_GameController *gamecontroller); -/** - * Get the Steam Input handle of an opened controller, if available. - * - * Returns an InputHandle_t for the controller that can be used with Steam Input API: - * https://partner.steamgames.com/doc/api/ISteamInput - * - * \param gamecontroller the game controller object to query. - * \returns the gamepad handle, or 0 if unavailable. - * - * \since This function is available since SDL 2.30.0. - */ -extern DECLSPEC Uint64 SDLCALL SDL_GameControllerGetSteamHandle(SDL_GameController *gamecontroller); - - /** * Check if a controller has been opened and is currently connected. * @@ -613,9 +598,7 @@ extern DECLSPEC void SDLCALL SDL_GameControllerUpdate(void); * and are centered within ~8000 of zero, though advanced UI will allow users to set * or autodetect the dead zone, which varies between controllers. * - * Trigger axis values range from 0 (released) to SDL_JOYSTICK_AXIS_MAX - * (fully pressed) when reported by SDL_GameControllerGetAxis(). Note that this is not the - * same range that will be reported by the lower-level SDL_GetJoystickAxis(). + * Trigger axis values range from 0 to SDL_JOYSTICK_AXIS_MAX. */ typedef enum { @@ -704,13 +687,8 @@ SDL_GameControllerHasAxis(SDL_GameController *gamecontroller, SDL_GameController * * The axis indices start at index 0. * - * For thumbsticks, the state is a value ranging from -32768 (up/left) - * to 32767 (down/right). - * - * Triggers range from 0 when released to 32767 when fully pressed, and - * never return a negative value. Note that this differs from the value - * reported by the lower-level SDL_GetJoystickAxis(), which normally uses - * the full range. + * The state is a value ranging from -32768 to 32767. Triggers, however, range + * from 0 to 32767 (they never return a negative value). * * \param gamecontroller a game controller * \param axis an axis index (one of the SDL_GameControllerAxis values) diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_gesture.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_gesture.h index 4fffa5f3e..db70b4dd8 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_gesture.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_gesture.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_guid.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_guid.h index 7daa5f1f5..d964223c6 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_guid.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_guid.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_haptic.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_haptic.h index c9ed847df..2462a1e47 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_haptic.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_haptic.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_hidapi.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_hidapi.h index b9d8ffac3..057510035 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_hidapi.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_hidapi.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_hints.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_hints.h index e775a6509..00beef51e 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_hints.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_hints.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -631,110 +631,6 @@ extern "C" { */ #define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS" -/** - * A variable containing a list of arcade stick style controllers. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_ARCADESTICK_DEVICES "SDL_JOYSTICK_ARCADESTICK_DEVICES" - -/** - * A variable containing a list of devices that are not arcade stick style controllers. This will override SDL_HINT_JOYSTICK_ARCADESTICK_DEVICES and the built in device list. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_ARCADESTICK_DEVICES_EXCLUDED "SDL_JOYSTICK_ARCADESTICK_DEVICES_EXCLUDED" - -/** - * A variable containing a list of devices that should not be considerd joysticks. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_BLACKLIST_DEVICES "SDL_JOYSTICK_BLACKLIST_DEVICES" - -/** - * A variable containing a list of devices that should be considered joysticks. This will override SDL_HINT_JOYSTICK_BLACKLIST_DEVICES and the built in device list. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_BLACKLIST_DEVICES_EXCLUDED "SDL_JOYSTICK_BLACKLIST_DEVICES_EXCLUDED" - -/** - * A variable containing a list of flightstick style controllers. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES "SDL_JOYSTICK_FLIGHTSTICK_DEVICES" - -/** - * A variable containing a list of devices that are not flightstick style controllers. This will override SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES and the built in device list. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED "SDL_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED" - -/** - * A variable containing a list of devices known to have a GameCube form factor. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_GAMECUBE_DEVICES "SDL_JOYSTICK_GAMECUBE_DEVICES" - -/** - * A variable containing a list of devices known not to have a GameCube form factor. This will override SDL_HINT_JOYSTICK_GAMECUBE_DEVICES and the built in device list. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_GAMECUBE_DEVICES_EXCLUDED "SDL_JOYSTICK_GAMECUBE_DEVICES_EXCLUDED" - /** * \brief A variable controlling whether the HIDAPI joystick drivers should be used. * @@ -943,17 +839,6 @@ extern "C" { */ #define SDL_HINT_JOYSTICK_HIDAPI_STEAM "SDL_JOYSTICK_HIDAPI_STEAM" -/** - * \brief A variable controlling whether the HIDAPI driver for the Steam Deck builtin controller should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI - */ -#define SDL_HINT_JOYSTICK_HIDAPI_STEAMDECK "SDL_JOYSTICK_HIDAPI_STEAMDECK" - /** * \brief A variable controlling whether the HIDAPI driver for Nintendo Switch controllers should be used. * @@ -1080,24 +965,6 @@ extern "C" { */ #define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED "SDL_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED" -/** - * A variable controlling whether IOKit should be used for controller handling. - * - * This variable can be set to the following values: - * "0" - IOKit is not used - * "1" - IOKit is used (the default) - */ -#define SDL_HINT_JOYSTICK_IOKIT "SDL_JOYSTICK_IOKIT" - -/** - * A variable controlling whether GCController should be used for controller handling. - * - * This variable can be set to the following values: - * "0" - GCController is not used - * "1" - GCController is used (the default) - */ -#define SDL_HINT_JOYSTICK_MFI "SDL_JOYSTICK_MFI" - /** * \brief A variable controlling whether the RAWINPUT joystick drivers should be used for better handling XInput-capable devices. * @@ -1140,32 +1007,6 @@ extern "C" { */ #define SDL_HINT_JOYSTICK_THREAD "SDL_JOYSTICK_THREAD" -/** - * A variable containing a list of throttle style controllers. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_THROTTLE_DEVICES "SDL_JOYSTICK_THROTTLE_DEVICES" - -/** - * A variable containing a list of devices that are not throttle style controllers. This will override SDL_HINT_JOYSTICK_THROTTLE_DEVICES and the built in device list. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_THROTTLE_DEVICES_EXCLUDED "SDL_JOYSTICK_THROTTLE_DEVICES_EXCLUDED" - /** * \brief A variable controlling whether Windows.Gaming.Input should be used for controller handling. * @@ -1175,45 +1016,6 @@ extern "C" { */ #define SDL_HINT_JOYSTICK_WGI "SDL_JOYSTICK_WGI" -/** - * A variable containing a list of wheel style controllers. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_WHEEL_DEVICES "SDL_JOYSTICK_WHEEL_DEVICES" - -/** - * A variable containing a list of devices that are not wheel style controllers. This will override SDL_HINT_JOYSTICK_WHEEL_DEVICES and the built in device list. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_WHEEL_DEVICES_EXCLUDED "SDL_JOYSTICK_WHEEL_DEVICES_EXCLUDED" - -/** - * A variable containing a list of devices known to have all axes centered at zero. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_ZERO_CENTERED_DEVICES "SDL_JOYSTICK_ZERO_CENTERED_DEVICES" - /** * \brief Determines whether SDL enforces that DRM master is required in order * to initialize the KMSDRM video backend. @@ -1282,22 +1084,6 @@ extern "C" { */ #define SDL_HINT_LINUX_JOYSTICK_DEADZONES "SDL_LINUX_JOYSTICK_DEADZONES" -/** - * \brief A variable controlling the default SDL log levels. - * - * This variable is a comma separated set of category=level tokens that define the default logging levels for SDL applications. - * - * The category can be a numeric category, one of "app", "error", "assert", "system", "audio", "video", "render", "input", "test", or `*` for any unspecified category. - * - * The level can be a numeric level, one of "verbose", "debug", "info", "warn", "error", "critical", or "quiet" to disable that category. - * - * You can omit the category if you want to set the logging level for all categories. - * - * If this hint isn't set, the default log levels are equivalent to: - * "app=info,assert=warn,test=verbose,*=error" - */ -#define SDL_HINT_LOGGING "SDL_LOGGING" - /** * \brief When set don't force the SDL app to become a foreground process * @@ -1699,32 +1485,6 @@ extern "C" { */ #define SDL_HINT_RENDER_METAL_PREFER_LOW_POWER_DEVICE "SDL_RENDER_METAL_PREFER_LOW_POWER_DEVICE" -/** - * A variable containing a list of ROG gamepad capable mice. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_ROG_GAMEPAD_MICE "SDL_ROG_GAMEPAD_MICE" - -/** - * A variable containing a list of devices that are not ROG gamepad capable mice. This will override SDL_HINT_ROG_GAMEPAD_MICE and the built in device list. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_ROG_GAMEPAD_MICE_EXCLUDED "SDL_ROG_GAMEPAD_MICE_EXCLUDED" - /** * \brief A variable controlling if VSYNC is automatically disable if doesn't reach the enough FPS * @@ -2682,22 +2442,6 @@ extern "C" { */ #define SDL_HINT_TRACKPAD_IS_TOUCH_ONLY "SDL_TRACKPAD_IS_TOUCH_ONLY" -/** - * Cause SDL to call dbus_shutdown() on quit. - * - * This is useful as a debug tool to validate memory leaks, but shouldn't ever - * be set in production applications, as other libraries used by the application - * might use dbus under the hood and this cause cause crashes if they continue - * after SDL_Quit(). - * - * This variable can be set to the following values: - * "0" - SDL will not call dbus_shutdown() on quit (default) - * "1" - SDL will call dbus_shutdown() on quit - * - * This hint is available since SDL 2.30.0. - */ -#define SDL_HINT_SHUTDOWN_DBUS_ON_QUIT "SDL_SHUTDOWN_DBUS_ON_QUIT" - /** * \brief An enumeration of hint priorities diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_joystick.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_joystick.h index 561e01099..b9b4f6228 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_joystick.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_joystick.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_keyboard.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_keyboard.h index 03c7b5a37..86a37ad1a 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_keyboard.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_keyboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -298,10 +298,8 @@ extern DECLSPEC void SDLCALL SDL_ClearComposition(void); extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputShown(void); /** - * Set the rectangle used to type Unicode text inputs. Native input methods - * will place a window with word suggestions near it, without covering the - * text being inputted. - * + * Set the rectangle used to type Unicode text inputs. + * * To start text input in a given location, this function is intended to be * called before SDL_StartTextInput, although some platforms support moving * the rectangle even while text input (and a composition) is active. diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_keycode.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_keycode.h index 57a71bd79..710622302 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_keycode.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_keycode.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_loadso.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_loadso.h index 4edc22e9e..ca59b681c 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_loadso.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_loadso.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_locale.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_locale.h index 0b6118f0e..482dbefe7 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_locale.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_locale.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_log.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_log.h index bd030c6d2..da733c402 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_log.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_log.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -59,7 +59,7 @@ extern "C" { * By default the application category is enabled at the INFO level, * the assert category is enabled at the WARN level, test is enabled * at the VERBOSE level and all other categories are enabled at the - * ERROR level. + * CRITICAL level. */ typedef enum { @@ -352,7 +352,7 @@ extern DECLSPEC void SDLCALL SDL_LogMessage(int category, */ extern DECLSPEC void SDLCALL SDL_LogMessageV(int category, SDL_LogPriority priority, - SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap) SDL_PRINTF_VARARG_FUNCV(3); + const char *fmt, va_list ap); /** * The prototype for the log output callback function. diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_main.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_main.h index a66c84b4e..5cc8e5913 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_main.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_main.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_messagebox.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_messagebox.h index 5ace6f2dd..7896fd129 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_messagebox.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_messagebox.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_metal.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_metal.h index 50f7b2aeb..f36e34878 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_metal.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_metal.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_misc.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_misc.h index 113ba7a15..13ed9c771 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_misc.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_misc.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_mouse.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_mouse.h index 687ff122d..aa0757573 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_mouse.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_mouse.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_mutex.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_mutex.h index eaa21f293..e679d3808 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_mutex.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_mutex.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_name.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_name.h index 71e935455..5c3e07ab7 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_name.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_name.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_opengl.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_opengl.h index 2bb38c5c0..0ba89127a 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_opengl.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_opengl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_opengles.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_opengles.h index 7e9a1ab8d..f4465eaa9 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_opengles.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_opengles.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_opengles2.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_opengles2.h index 96971344d..5e3b717de 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_opengles2.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_opengles2.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_pixels.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_pixels.h index 44757cdcf..9abd57b42 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_pixels.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_pixels.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -61,10 +61,7 @@ typedef enum SDL_PIXELTYPE_ARRAYU16, SDL_PIXELTYPE_ARRAYU32, SDL_PIXELTYPE_ARRAYF16, - SDL_PIXELTYPE_ARRAYF32, - - /* This must be at the end of the list to avoid breaking the existing ABI */ - SDL_PIXELTYPE_INDEX2 + SDL_PIXELTYPE_ARRAYF32 } SDL_PixelType; /** Bitmap pixel order, high bit -> low bit. */ @@ -137,7 +134,6 @@ typedef enum #define SDL_ISPIXELFORMAT_INDEXED(format) \ (!SDL_ISPIXELFORMAT_FOURCC(format) && \ ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX2) || \ (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \ (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8))) @@ -181,12 +177,6 @@ typedef enum SDL_PIXELFORMAT_INDEX1MSB = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_1234, 0, 1, 0), - SDL_PIXELFORMAT_INDEX2LSB = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX2, SDL_BITMAPORDER_4321, 0, - 2, 0), - SDL_PIXELFORMAT_INDEX2MSB = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX2, SDL_BITMAPORDER_1234, 0, - 2, 0), SDL_PIXELFORMAT_INDEX4LSB = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0, 4, 0), @@ -286,19 +276,11 @@ typedef enum SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_ABGR8888, - SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_RGBX8888, - SDL_PIXELFORMAT_XRGB32 = SDL_PIXELFORMAT_XRGB8888, - SDL_PIXELFORMAT_BGRX32 = SDL_PIXELFORMAT_BGRX8888, - SDL_PIXELFORMAT_XBGR32 = SDL_PIXELFORMAT_XBGR8888, #else SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_RGBA8888, - SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_XBGR8888, - SDL_PIXELFORMAT_XRGB32 = SDL_PIXELFORMAT_BGRX8888, - SDL_PIXELFORMAT_BGRX32 = SDL_PIXELFORMAT_XRGB8888, - SDL_PIXELFORMAT_XBGR32 = SDL_PIXELFORMAT_RGBX8888, #endif SDL_PIXELFORMAT_YV12 = /**< Planar mode: Y + V + U (3 planes) */ diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_platform.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_platform.h index 6e67b4577..d2a7e052d 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_platform.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_platform.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -166,12 +166,6 @@ #define WINAPI_FAMILY_WINRT 0 #endif /* HAVE_WINAPIFAMILY_H */ -#if (HAVE_WINAPIFAMILY_H) && defined(WINAPI_FAMILY_PHONE_APP) -#define SDL_WINAPI_FAMILY_PHONE (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) -#else -#define SDL_WINAPI_FAMILY_PHONE 0 -#endif - #if WINAPI_FAMILY_WINRT #undef __WINRT__ #define __WINRT__ 1 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_power.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_power.h index 0520065ce..1d75704c4 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_power.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_power.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_quit.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_quit.h index 3f69dc9f2..d8ceb8943 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_quit.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_quit.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_rect.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_rect.h index 5ce1f0b45..9611a311c 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_rect.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_rect.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_render.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_render.h index b7135bb9d..2d3f07366 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_render.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_render.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -42,7 +42,7 @@ * of the many good 3D engines. * * These functions must be called from the main thread. - * See this bug for details: https://github.com/libsdl-org/SDL/issues/986 + * See this bug for details: http://bugzilla.libsdl.org/show_bug.cgi?id=1995 */ #ifndef SDL_render_h_ diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_revision.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_revision.h index ee42f8421..4455a08b6 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_revision.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_revision.h @@ -1,7 +1,7 @@ /* Generated by updaterev.sh, do not edit */ #ifdef SDL_VENDOR_INFO -#define SDL_REVISION "SDL-release-2.30.0-0-g859844eae (" SDL_VENDOR_INFO ")" +#define SDL_REVISION "SDL-release-2.28.5-0-g15ead9a40 (" SDL_VENDOR_INFO ")" #else -#define SDL_REVISION "SDL-release-2.30.0-0-g859844eae" +#define SDL_REVISION "SDL-release-2.28.5-0-g15ead9a40" #endif #define SDL_REVISION_NUMBER 0 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_rwops.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_rwops.h index 9dd99f92b..8615cb542 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_rwops.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_rwops.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_scancode.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_scancode.h index fe13d5b7a..a960a7991 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_scancode.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_scancode.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_sensor.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_sensor.h index 8b89ef6a5..9ecce44b1 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_sensor.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_sensor.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_shape.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_shape.h index 4783cf290..f66babc01 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_shape.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_shape.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_stdinc.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_stdinc.h index 0035a357c..182ed86ee 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_stdinc.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_stdinc.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -257,7 +257,7 @@ typedef uint64_t Uint64; #define SDL_PRIs64 PRIs64 #elif defined(__WIN32__) || defined(__GDK__) #define SDL_PRIs64 "I64d" -#elif defined(__LP64__) && !defined(__APPLE__) +#elif defined(__LINUX__) && defined(__LP64__) #define SDL_PRIs64 "ld" #else #define SDL_PRIs64 "lld" @@ -268,7 +268,7 @@ typedef uint64_t Uint64; #define SDL_PRIu64 PRIu64 #elif defined(__WIN32__) || defined(__GDK__) #define SDL_PRIu64 "I64u" -#elif defined(__LP64__) && !defined(__APPLE__) +#elif defined(__LINUX__) && defined(__LP64__) #define SDL_PRIu64 "lu" #else #define SDL_PRIu64 "llu" @@ -279,7 +279,7 @@ typedef uint64_t Uint64; #define SDL_PRIx64 PRIx64 #elif defined(__WIN32__) || defined(__GDK__) #define SDL_PRIx64 "I64x" -#elif defined(__LP64__) && !defined(__APPLE__) +#elif defined(__LINUX__) && defined(__LP64__) #define SDL_PRIx64 "lx" #else #define SDL_PRIx64 "llx" @@ -290,7 +290,7 @@ typedef uint64_t Uint64; #define SDL_PRIX64 PRIX64 #elif defined(__WIN32__) || defined(__GDK__) #define SDL_PRIX64 "I64X" -#elif defined(__LP64__) && !defined(__APPLE__) +#elif defined(__LINUX__) && defined(__LP64__) #define SDL_PRIX64 "lX" #else #define SDL_PRIX64 "llX" @@ -336,9 +336,7 @@ typedef uint64_t Uint64; #define SDL_PRINTF_FORMAT_STRING #define SDL_SCANF_FORMAT_STRING #define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) -#define SDL_PRINTF_VARARG_FUNCV( fmtargnumber ) #define SDL_SCANF_VARARG_FUNC( fmtargnumber ) -#define SDL_SCANF_VARARG_FUNCV( fmtargnumber ) #else #if defined(_MSC_VER) && (_MSC_VER >= 1600) /* VS 2010 and above */ #include @@ -364,14 +362,10 @@ typedef uint64_t Uint64; #endif #if defined(__GNUC__) #define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __printf__, fmtargnumber, fmtargnumber+1 ))) -#define SDL_PRINTF_VARARG_FUNCV( fmtargnumber ) __attribute__(( format( __printf__, fmtargnumber, 0 ))) #define SDL_SCANF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __scanf__, fmtargnumber, fmtargnumber+1 ))) -#define SDL_SCANF_VARARG_FUNCV( fmtargnumber ) __attribute__(( format( __scanf__, fmtargnumber, 0 ))) #else #define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) -#define SDL_PRINTF_VARARG_FUNCV( fmtargnumber ) #define SDL_SCANF_VARARG_FUNC( fmtargnumber ) -#define SDL_SCANF_VARARG_FUNCV( fmtargnumber ) #endif #endif /* SDL_DISABLE_ANALYZE_MACROS */ @@ -609,11 +603,11 @@ extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2); extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t len); extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, ...) SDL_SCANF_VARARG_FUNC(2); -extern DECLSPEC int SDLCALL SDL_vsscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, va_list ap) SDL_SCANF_VARARG_FUNCV(2); +extern DECLSPEC int SDLCALL SDL_vsscanf(const char *text, const char *fmt, va_list ap); extern DECLSPEC int SDLCALL SDL_snprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ... ) SDL_PRINTF_VARARG_FUNC(3); -extern DECLSPEC int SDLCALL SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap) SDL_PRINTF_VARARG_FUNCV(3); +extern DECLSPEC int SDLCALL SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt, va_list ap); extern DECLSPEC int SDLCALL SDL_asprintf(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); -extern DECLSPEC int SDLCALL SDL_vasprintf(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap) SDL_PRINTF_VARARG_FUNCV(2); +extern DECLSPEC int SDLCALL SDL_vasprintf(char **strp, const char *fmt, va_list ap); #ifndef HAVE_M_PI #ifndef M_PI @@ -694,8 +688,8 @@ extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, size_t * outbytesleft); /** - * This function converts a buffer or string between encodings in one pass, - * returning a string that must be freed with SDL_free() or NULL on error. + * This function converts a buffer or string between encodings in one pass, returning a + * string that must be freed with SDL_free() or NULL on error. * * \since This function is available since SDL 2.0.0. */ @@ -704,8 +698,8 @@ extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode, const char *inbuf, size_t inbytesleft); #define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1) -#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1) -#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1) +#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2-INTERNAL", "UTF-8", S, SDL_strlen(S)+1) +#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4-INTERNAL", "UTF-8", S, SDL_strlen(S)+1) #define SDL_iconv_wchar_utf8(S) SDL_iconv_string("UTF-8", "WCHAR_T", (char *)S, (SDL_wcslen(S)+1)*sizeof(wchar_t)) /* force builds using Clang's static analysis tools to use literal C runtime diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_surface.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_surface.h index ceeb86bd8..d6ee615c5 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_surface.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_surface.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_system.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_system.h index ddae4f8cc..4b7eaddcc 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_system.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_system.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -593,8 +593,7 @@ extern DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void /* Functions used only by GDK */ #if defined(__GDK__) -typedef struct XTaskQueueObject *XTaskQueueHandle; -typedef struct XUser *XUserHandle; +typedef struct XTaskQueueObject * XTaskQueueHandle; /** * Gets a reference to the global async task queue handle for GDK, @@ -611,20 +610,6 @@ typedef struct XUser *XUserHandle; */ extern DECLSPEC int SDLCALL SDL_GDKGetTaskQueue(XTaskQueueHandle * outTaskQueue); -/** - * Gets a reference to the default user handle for GDK. - * - * This is effectively a synchronous version of XUserAddAsync, which always - * prefers the default user and allows a sign-in UI. - * - * \param outUserHandle a pointer to be filled in with the default user - * handle. - * \returns 0 if success, -1 if any error occurs. - * - * \since This function is available since SDL 2.28.0. - */ -extern DECLSPEC int SDLCALL SDL_GDKGetDefaultUser(XUserHandle * outUserHandle); - #endif /* Ends C function definitions when using C++ */ diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_syswm.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_syswm.h index 7b8bd6ef9..b35734deb 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_syswm.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_syswm.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test.h index e5acbee4e..80daaafbd 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_assert.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_assert.h index 4f983350a..341e490fa 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_assert.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_assert.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_common.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_common.h index d977e463f..6de63cad6 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_common.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_common.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_compare.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_compare.h index 61a38d090..5fce25ca1 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_compare.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_compare.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_crc32.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_crc32.h index e3478318d..bf3478210 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_crc32.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_crc32.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_font.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_font.h index 620c82116..18a82ffc8 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_font.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_font.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_fuzzer.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_fuzzer.h index a847ccb01..cfe6a14f2 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_fuzzer.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_fuzzer.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_harness.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_harness.h index bd9e4f8de..26231dcd6 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_harness.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_harness.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_images.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_images.h index b5bcb0a00..121137175 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_images.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_images.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_log.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_log.h index ea9ae5e1c..a27ffc209 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_log.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_log.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_md5.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_md5.h index 3764b0425..538c7ae3e 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_md5.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_md5.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_memory.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_memory.h index 9bd143252..f959177d2 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_memory.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_memory.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_random.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_random.h index 344646aa8..0035a8030 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_random.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_test_random.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_thread.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_thread.h index dc7f5363a..b829bbad5 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_thread.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_thread.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_timer.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_timer.h index 8123e432f..98f9ad16c 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_timer.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_timer.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_touch.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_touch.h index f6a5db413..c12d4a1c8 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_touch.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_touch.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_types.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_types.h index e8d33c651..b5d7192ff 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_types.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_types.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_version.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_version.h index 02143ff7a..7585eece5 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_version.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_version.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -58,8 +58,8 @@ typedef struct SDL_version /* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL */ #define SDL_MAJOR_VERSION 2 -#define SDL_MINOR_VERSION 30 -#define SDL_PATCHLEVEL 0 +#define SDL_MINOR_VERSION 28 +#define SDL_PATCHLEVEL 5 /** * Macro to determine SDL version program was compiled against. diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_video.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_video.h index fa47d3099..c8b2d7a0d 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_video.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/SDL_video.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -1278,8 +1278,7 @@ extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window * window, /** * Return whether the window has a surface associated with it. * - * \returns SDL_TRUE if there is a surface associated with the window, or - * SDL_FALSE otherwise. + * \returns SDL_TRUE if there is a surface associated with the window, or SDL_FALSE otherwise. * * \since This function is available since SDL 2.28.0. * @@ -1341,11 +1340,6 @@ extern DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window * window); * * This function is equivalent to the SDL 1.2 API SDL_UpdateRects(). * - * Note that this function will update _at least_ the rectangles specified, - * but this is only intended as an optimization; in practice, this might - * update more of the screen (or all of the screen!), depending on what - * method SDL uses to send pixels to the system. - * * \param window the window to update * \param rects an array of SDL_Rect structures representing areas of the * surface to copy, in pixels diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/begin_code.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/begin_code.h index a47a7d2b6..4142ffeba 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/begin_code.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/begin_code.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -36,8 +36,6 @@ #ifndef SDL_DEPRECATED # if defined(__GNUC__) && (__GNUC__ >= 4) /* technically, this arrived in gcc 3.1, but oh well. */ # define SDL_DEPRECATED __attribute__((deprecated)) -# elif defined(_MSC_VER) -# define SDL_DEPRECATED __declspec(deprecated) # else # define SDL_DEPRECATED # endif diff --git a/libs/SDL2/i686-w64-mingw32/include/SDL2/close_code.h b/libs/SDL2/i686-w64-mingw32/include/SDL2/close_code.h index 50a0e6f3b..b5ff3e204 100644 --- a/libs/SDL2/i686-w64-mingw32/include/SDL2/close_code.h +++ b/libs/SDL2/i686-w64-mingw32/include/SDL2/close_code.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/i686-w64-mingw32/lib/cmake/SDL2/sdl2-config-version.cmake b/libs/SDL2/i686-w64-mingw32/lib/cmake/SDL2/sdl2-config-version.cmake index 82dfeab12..0e6382995 100644 --- a/libs/SDL2/i686-w64-mingw32/lib/cmake/SDL2/sdl2-config-version.cmake +++ b/libs/SDL2/i686-w64-mingw32/lib/cmake/SDL2/sdl2-config-version.cmake @@ -1,6 +1,6 @@ # sdl2 cmake project-config-version input for ./configure scripts -set(PACKAGE_VERSION "2.30.0") +set(PACKAGE_VERSION "2.28.5") if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) set(PACKAGE_VERSION_COMPATIBLE FALSE) diff --git a/libs/SDL2/i686-w64-mingw32/lib/libSDL2.a b/libs/SDL2/i686-w64-mingw32/lib/libSDL2.a index 927fd51a7..57a097cbf 100644 Binary files a/libs/SDL2/i686-w64-mingw32/lib/libSDL2.a and b/libs/SDL2/i686-w64-mingw32/lib/libSDL2.a differ diff --git a/libs/SDL2/i686-w64-mingw32/lib/libSDL2.dll.a b/libs/SDL2/i686-w64-mingw32/lib/libSDL2.dll.a index 65add3aa8..64f541cd8 100755 Binary files a/libs/SDL2/i686-w64-mingw32/lib/libSDL2.dll.a and b/libs/SDL2/i686-w64-mingw32/lib/libSDL2.dll.a differ diff --git a/libs/SDL2/i686-w64-mingw32/lib/libSDL2.la b/libs/SDL2/i686-w64-mingw32/lib/libSDL2.la index 0f885324b..9687a5e29 100644 --- a/libs/SDL2/i686-w64-mingw32/lib/libSDL2.la +++ b/libs/SDL2/i686-w64-mingw32/lib/libSDL2.la @@ -23,9 +23,9 @@ dependency_libs=' -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 - weak_library_names='' # Version information for libSDL2. -current=3000 -age=3000 -revision=0 +current=2800 +age=2800 +revision=5 # Is this an already installed library? installed=yes @@ -38,4 +38,4 @@ dlopen='' dlpreopen='' # Directory that this library needs to be installed in: -libdir='/Users/valve/release/SDL2/SDL2-2.30.0/i686-w64-mingw32/lib' +libdir='/Users/valve/release/SDL2/SDL2-2.28.5/i686-w64-mingw32/lib' diff --git a/libs/SDL2/i686-w64-mingw32/lib/libSDL2_test.a b/libs/SDL2/i686-w64-mingw32/lib/libSDL2_test.a index 4fcf88772..71c766c1c 100644 Binary files a/libs/SDL2/i686-w64-mingw32/lib/libSDL2_test.a and b/libs/SDL2/i686-w64-mingw32/lib/libSDL2_test.a differ diff --git a/libs/SDL2/i686-w64-mingw32/lib/libSDL2_test.la b/libs/SDL2/i686-w64-mingw32/lib/libSDL2_test.la index b048909ca..2e2e296e9 100644 --- a/libs/SDL2/i686-w64-mingw32/lib/libSDL2_test.la +++ b/libs/SDL2/i686-w64-mingw32/lib/libSDL2_test.la @@ -38,4 +38,4 @@ dlopen='' dlpreopen='' # Directory that this library needs to be installed in: -libdir='/Users/valve/release/SDL2/SDL2-2.30.0/i686-w64-mingw32/lib' +libdir='/Users/valve/release/SDL2/SDL2-2.28.5/i686-w64-mingw32/lib' diff --git a/libs/SDL2/i686-w64-mingw32/lib/libSDL2main.a b/libs/SDL2/i686-w64-mingw32/lib/libSDL2main.a index 79a835a40..9f64593a6 100644 Binary files a/libs/SDL2/i686-w64-mingw32/lib/libSDL2main.a and b/libs/SDL2/i686-w64-mingw32/lib/libSDL2main.a differ diff --git a/libs/SDL2/i686-w64-mingw32/lib/libSDL2main.la b/libs/SDL2/i686-w64-mingw32/lib/libSDL2main.la index 128a7f5b1..6e12ee786 100644 --- a/libs/SDL2/i686-w64-mingw32/lib/libSDL2main.la +++ b/libs/SDL2/i686-w64-mingw32/lib/libSDL2main.la @@ -38,4 +38,4 @@ dlopen='' dlpreopen='' # Directory that this library needs to be installed in: -libdir='/Users/valve/release/SDL2/SDL2-2.30.0/i686-w64-mingw32/lib' +libdir='/Users/valve/release/SDL2/SDL2-2.28.5/i686-w64-mingw32/lib' diff --git a/libs/SDL2/i686-w64-mingw32/lib/pkgconfig/sdl2.pc b/libs/SDL2/i686-w64-mingw32/lib/pkgconfig/sdl2.pc index e28b4803f..d52c268ea 100644 --- a/libs/SDL2/i686-w64-mingw32/lib/pkgconfig/sdl2.pc +++ b/libs/SDL2/i686-w64-mingw32/lib/pkgconfig/sdl2.pc @@ -1,13 +1,13 @@ # sdl pkg-config source file -prefix=/usr/local/i686-w64-mingw32 +prefix=/i686-w64-mingw32 exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include Name: sdl2 Description: Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer. -Version: 2.30.0 +Version: 2.28.5 Requires.private: Conflicts: Libs: -L${libdir} -lmingw32 -lSDL2main -lSDL2 -mwindows diff --git a/libs/SDL2/i686-w64-mingw32/share/aclocal/sdl2.m4 b/libs/SDL2/i686-w64-mingw32/share/aclocal/sdl2.m4 index 274753b11..75b60f6ea 100644 --- a/libs/SDL2/i686-w64-mingw32/share/aclocal/sdl2.m4 +++ b/libs/SDL2/i686-w64-mingw32/share/aclocal/sdl2.m4 @@ -9,9 +9,8 @@ # * also look for SDL2.framework under Mac OS X # * removed HP/UX 9 support. # * updated for newer autoconf. -# * (v3) use $PKG_CONFIG for pkg-config cross-compiling support -# serial 3 +# serial 2 dnl AM_PATH_SDL2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS @@ -55,7 +54,7 @@ AC_ARG_VAR(SDL2_FRAMEWORK, [Path to SDL2.framework]) if test "x$sdl_pc" = xyes ; then no_sdl="" - SDL2_CONFIG="$PKG_CONFIG sdl2" + SDL2_CONFIG="pkg-config sdl2" else as_save_PATH="$PATH" if test "x$prefix" != xNONE && test "$cross_compiling" != yes; then diff --git a/libs/SDL2/include/SDL.h b/libs/SDL2/include/SDL.h index 20c903b2f..9ba8f68c6 100644 --- a/libs/SDL2/include/SDL.h +++ b/libs/SDL2/include/SDL.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_assert.h b/libs/SDL2/include/SDL_assert.h index a396d4e02..7ce823ec5 100644 --- a/libs/SDL2/include/SDL_assert.h +++ b/libs/SDL2/include/SDL_assert.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_atomic.h b/libs/SDL2/include/SDL_atomic.h index 1fa18f49f..1dd816a38 100644 --- a/libs/SDL2/include/SDL_atomic.h +++ b/libs/SDL2/include/SDL_atomic.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -209,7 +209,7 @@ typedef void (*SDL_KernelMemoryBarrierFunc)(); #if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) || defined(__ARM_ARCH_8A__) #define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory") #define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory") -#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) +#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_5TE__) #ifdef __thumb__ /* The mcr instruction isn't available in thumb mode, use real functions */ #define SDL_MEMORY_BARRIER_USES_FUNCTION diff --git a/libs/SDL2/include/SDL_audio.h b/libs/SDL2/include/SDL_audio.h index bd8e7ab6f..ccd35982d 100644 --- a/libs/SDL2/include/SDL_audio.h +++ b/libs/SDL2/include/SDL_audio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_bits.h b/libs/SDL2/include/SDL_bits.h index 83e8a78c7..81161ae5f 100644 --- a/libs/SDL2/include/SDL_bits.h +++ b/libs/SDL2/include/SDL_bits.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_blendmode.h b/libs/SDL2/include/SDL_blendmode.h index 09d01477d..4ecbe5078 100644 --- a/libs/SDL2/include/SDL_blendmode.h +++ b/libs/SDL2/include/SDL_blendmode.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -65,8 +65,8 @@ typedef enum typedef enum { SDL_BLENDOPERATION_ADD = 0x1, /**< dst + src: supported by all renderers */ - SDL_BLENDOPERATION_SUBTRACT = 0x2, /**< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES */ - SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, /**< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES */ + SDL_BLENDOPERATION_SUBTRACT = 0x2, /**< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES */ + SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, /**< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES */ SDL_BLENDOPERATION_MINIMUM = 0x4, /**< min(dst, src) : supported by D3D9, D3D11 */ SDL_BLENDOPERATION_MAXIMUM = 0x5 /**< max(dst, src) : supported by D3D9, D3D11 */ } SDL_BlendOperation; diff --git a/libs/SDL2/include/SDL_clipboard.h b/libs/SDL2/include/SDL_clipboard.h index bd4b044c6..7c351fbb9 100644 --- a/libs/SDL2/include/SDL_clipboard.h +++ b/libs/SDL2/include/SDL_clipboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_config.h b/libs/SDL2/include/SDL_config.h index dba780860..01322c182 100644 --- a/libs/SDL2/include/SDL_config.h +++ b/libs/SDL2/include/SDL_config.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_cpuinfo.h b/libs/SDL2/include/SDL_cpuinfo.h index 2a9dd380c..ed5e97915 100644 --- a/libs/SDL2/include/SDL_cpuinfo.h +++ b/libs/SDL2/include/SDL_cpuinfo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_egl.h b/libs/SDL2/include/SDL_egl.h index a4276e681..6f51c0831 100644 --- a/libs/SDL2/include/SDL_egl.h +++ b/libs/SDL2/include/SDL_egl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_endian.h b/libs/SDL2/include/SDL_endian.h index 591ccac42..71bc06729 100644 --- a/libs/SDL2/include/SDL_endian.h +++ b/libs/SDL2/include/SDL_endian.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_error.h b/libs/SDL2/include/SDL_error.h index 2df6463ad..31c22616c 100644 --- a/libs/SDL2/include/SDL_error.h +++ b/libs/SDL2/include/SDL_error.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_events.h b/libs/SDL2/include/SDL_events.h index eccbba255..9d0970318 100644 --- a/libs/SDL2/include/SDL_events.h +++ b/libs/SDL2/include/SDL_events.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -131,8 +131,6 @@ typedef enum SDL_CONTROLLERTOUCHPADMOTION, /**< Game controller touchpad finger was moved */ SDL_CONTROLLERTOUCHPADUP, /**< Game controller touchpad finger was lifted */ SDL_CONTROLLERSENSORUPDATE, /**< Game controller sensor was updated */ - SDL_CONTROLLERUPDATECOMPLETE_RESERVED_FOR_SDL3, - SDL_CONTROLLERSTEAMHANDLEUPDATED, /**< Game controller Steam handle has changed */ /* Touch events */ SDL_FINGERDOWN = 0x700, @@ -448,7 +446,7 @@ typedef struct SDL_ControllerButtonEvent */ typedef struct SDL_ControllerDeviceEvent { - Uint32 type; /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, ::SDL_CONTROLLERDEVICEREMAPPED, or ::SDL_CONTROLLERSTEAMHANDLEUPDATED */ + Uint32 type; /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, or ::SDL_CONTROLLERDEVICEREMAPPED */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */ } SDL_ControllerDeviceEvent; @@ -582,6 +580,15 @@ typedef struct SDL_QuitEvent Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ } SDL_QuitEvent; +/** + * \brief OS Specific event + */ +typedef struct SDL_OSEvent +{ + Uint32 type; /**< ::SDL_QUIT */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ +} SDL_OSEvent; + /** * \brief A user-defined event type (event.user.*) */ diff --git a/libs/SDL2/include/SDL_filesystem.h b/libs/SDL2/include/SDL_filesystem.h index 07498898d..4cad657ec 100644 --- a/libs/SDL2/include/SDL_filesystem.h +++ b/libs/SDL2/include/SDL_filesystem.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -64,7 +64,7 @@ extern "C" { * directory of the application as it is uncommon to store resources outside * the executable. As such it is not a writable directory. * - * The returned path is guaranteed to end with a path separator ('\\' on + * The returned path is guaranteed to end with a path separator ('\' on * Windows, '/' on most other platforms). * * The pointer returned is owned by the caller. Please call SDL_free() on the @@ -120,7 +120,7 @@ extern DECLSPEC char *SDLCALL SDL_GetBasePath(void); * - ...only use letters, numbers, and spaces. Avoid punctuation like "Game * Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient. * - * The returned path is guaranteed to end with a path separator ('\\' on + * The returned path is guaranteed to end with a path separator ('\' on * Windows, '/' on most other platforms). * * The pointer returned is owned by the caller. Please call SDL_free() on the diff --git a/libs/SDL2/include/SDL_gamecontroller.h b/libs/SDL2/include/SDL_gamecontroller.h index 281fa356c..140054d36 100644 --- a/libs/SDL2/include/SDL_gamecontroller.h +++ b/libs/SDL2/include/SDL_gamecontroller.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -73,8 +73,7 @@ typedef enum SDL_CONTROLLER_TYPE_NVIDIA_SHIELD, SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_LEFT, SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT, - SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_PAIR, - SDL_CONTROLLER_TYPE_MAX + SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_PAIR } SDL_GameControllerType; typedef enum @@ -524,20 +523,6 @@ extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetFirmwareVersion(SDL_GameCont */ extern DECLSPEC const char * SDLCALL SDL_GameControllerGetSerial(SDL_GameController *gamecontroller); -/** - * Get the Steam Input handle of an opened controller, if available. - * - * Returns an InputHandle_t for the controller that can be used with Steam Input API: - * https://partner.steamgames.com/doc/api/ISteamInput - * - * \param gamecontroller the game controller object to query. - * \returns the gamepad handle, or 0 if unavailable. - * - * \since This function is available since SDL 2.30.0. - */ -extern DECLSPEC Uint64 SDLCALL SDL_GameControllerGetSteamHandle(SDL_GameController *gamecontroller); - - /** * Check if a controller has been opened and is currently connected. * @@ -613,9 +598,7 @@ extern DECLSPEC void SDLCALL SDL_GameControllerUpdate(void); * and are centered within ~8000 of zero, though advanced UI will allow users to set * or autodetect the dead zone, which varies between controllers. * - * Trigger axis values range from 0 (released) to SDL_JOYSTICK_AXIS_MAX - * (fully pressed) when reported by SDL_GameControllerGetAxis(). Note that this is not the - * same range that will be reported by the lower-level SDL_GetJoystickAxis(). + * Trigger axis values range from 0 to SDL_JOYSTICK_AXIS_MAX. */ typedef enum { @@ -704,13 +687,8 @@ SDL_GameControllerHasAxis(SDL_GameController *gamecontroller, SDL_GameController * * The axis indices start at index 0. * - * For thumbsticks, the state is a value ranging from -32768 (up/left) - * to 32767 (down/right). - * - * Triggers range from 0 when released to 32767 when fully pressed, and - * never return a negative value. Note that this differs from the value - * reported by the lower-level SDL_GetJoystickAxis(), which normally uses - * the full range. + * The state is a value ranging from -32768 to 32767. Triggers, however, range + * from 0 to 32767 (they never return a negative value). * * \param gamecontroller a game controller * \param axis an axis index (one of the SDL_GameControllerAxis values) diff --git a/libs/SDL2/include/SDL_gesture.h b/libs/SDL2/include/SDL_gesture.h index 4fffa5f3e..db70b4dd8 100644 --- a/libs/SDL2/include/SDL_gesture.h +++ b/libs/SDL2/include/SDL_gesture.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_guid.h b/libs/SDL2/include/SDL_guid.h index 7daa5f1f5..d964223c6 100644 --- a/libs/SDL2/include/SDL_guid.h +++ b/libs/SDL2/include/SDL_guid.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_haptic.h b/libs/SDL2/include/SDL_haptic.h index c9ed847df..2462a1e47 100644 --- a/libs/SDL2/include/SDL_haptic.h +++ b/libs/SDL2/include/SDL_haptic.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_hidapi.h b/libs/SDL2/include/SDL_hidapi.h index b9d8ffac3..057510035 100644 --- a/libs/SDL2/include/SDL_hidapi.h +++ b/libs/SDL2/include/SDL_hidapi.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_hints.h b/libs/SDL2/include/SDL_hints.h index e775a6509..00beef51e 100644 --- a/libs/SDL2/include/SDL_hints.h +++ b/libs/SDL2/include/SDL_hints.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -631,110 +631,6 @@ extern "C" { */ #define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS" -/** - * A variable containing a list of arcade stick style controllers. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_ARCADESTICK_DEVICES "SDL_JOYSTICK_ARCADESTICK_DEVICES" - -/** - * A variable containing a list of devices that are not arcade stick style controllers. This will override SDL_HINT_JOYSTICK_ARCADESTICK_DEVICES and the built in device list. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_ARCADESTICK_DEVICES_EXCLUDED "SDL_JOYSTICK_ARCADESTICK_DEVICES_EXCLUDED" - -/** - * A variable containing a list of devices that should not be considerd joysticks. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_BLACKLIST_DEVICES "SDL_JOYSTICK_BLACKLIST_DEVICES" - -/** - * A variable containing a list of devices that should be considered joysticks. This will override SDL_HINT_JOYSTICK_BLACKLIST_DEVICES and the built in device list. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_BLACKLIST_DEVICES_EXCLUDED "SDL_JOYSTICK_BLACKLIST_DEVICES_EXCLUDED" - -/** - * A variable containing a list of flightstick style controllers. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES "SDL_JOYSTICK_FLIGHTSTICK_DEVICES" - -/** - * A variable containing a list of devices that are not flightstick style controllers. This will override SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES and the built in device list. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED "SDL_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED" - -/** - * A variable containing a list of devices known to have a GameCube form factor. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_GAMECUBE_DEVICES "SDL_JOYSTICK_GAMECUBE_DEVICES" - -/** - * A variable containing a list of devices known not to have a GameCube form factor. This will override SDL_HINT_JOYSTICK_GAMECUBE_DEVICES and the built in device list. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_GAMECUBE_DEVICES_EXCLUDED "SDL_JOYSTICK_GAMECUBE_DEVICES_EXCLUDED" - /** * \brief A variable controlling whether the HIDAPI joystick drivers should be used. * @@ -943,17 +839,6 @@ extern "C" { */ #define SDL_HINT_JOYSTICK_HIDAPI_STEAM "SDL_JOYSTICK_HIDAPI_STEAM" -/** - * \brief A variable controlling whether the HIDAPI driver for the Steam Deck builtin controller should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI - */ -#define SDL_HINT_JOYSTICK_HIDAPI_STEAMDECK "SDL_JOYSTICK_HIDAPI_STEAMDECK" - /** * \brief A variable controlling whether the HIDAPI driver for Nintendo Switch controllers should be used. * @@ -1080,24 +965,6 @@ extern "C" { */ #define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED "SDL_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED" -/** - * A variable controlling whether IOKit should be used for controller handling. - * - * This variable can be set to the following values: - * "0" - IOKit is not used - * "1" - IOKit is used (the default) - */ -#define SDL_HINT_JOYSTICK_IOKIT "SDL_JOYSTICK_IOKIT" - -/** - * A variable controlling whether GCController should be used for controller handling. - * - * This variable can be set to the following values: - * "0" - GCController is not used - * "1" - GCController is used (the default) - */ -#define SDL_HINT_JOYSTICK_MFI "SDL_JOYSTICK_MFI" - /** * \brief A variable controlling whether the RAWINPUT joystick drivers should be used for better handling XInput-capable devices. * @@ -1140,32 +1007,6 @@ extern "C" { */ #define SDL_HINT_JOYSTICK_THREAD "SDL_JOYSTICK_THREAD" -/** - * A variable containing a list of throttle style controllers. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_THROTTLE_DEVICES "SDL_JOYSTICK_THROTTLE_DEVICES" - -/** - * A variable containing a list of devices that are not throttle style controllers. This will override SDL_HINT_JOYSTICK_THROTTLE_DEVICES and the built in device list. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_THROTTLE_DEVICES_EXCLUDED "SDL_JOYSTICK_THROTTLE_DEVICES_EXCLUDED" - /** * \brief A variable controlling whether Windows.Gaming.Input should be used for controller handling. * @@ -1175,45 +1016,6 @@ extern "C" { */ #define SDL_HINT_JOYSTICK_WGI "SDL_JOYSTICK_WGI" -/** - * A variable containing a list of wheel style controllers. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_WHEEL_DEVICES "SDL_JOYSTICK_WHEEL_DEVICES" - -/** - * A variable containing a list of devices that are not wheel style controllers. This will override SDL_HINT_JOYSTICK_WHEEL_DEVICES and the built in device list. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_WHEEL_DEVICES_EXCLUDED "SDL_JOYSTICK_WHEEL_DEVICES_EXCLUDED" - -/** - * A variable containing a list of devices known to have all axes centered at zero. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_ZERO_CENTERED_DEVICES "SDL_JOYSTICK_ZERO_CENTERED_DEVICES" - /** * \brief Determines whether SDL enforces that DRM master is required in order * to initialize the KMSDRM video backend. @@ -1282,22 +1084,6 @@ extern "C" { */ #define SDL_HINT_LINUX_JOYSTICK_DEADZONES "SDL_LINUX_JOYSTICK_DEADZONES" -/** - * \brief A variable controlling the default SDL log levels. - * - * This variable is a comma separated set of category=level tokens that define the default logging levels for SDL applications. - * - * The category can be a numeric category, one of "app", "error", "assert", "system", "audio", "video", "render", "input", "test", or `*` for any unspecified category. - * - * The level can be a numeric level, one of "verbose", "debug", "info", "warn", "error", "critical", or "quiet" to disable that category. - * - * You can omit the category if you want to set the logging level for all categories. - * - * If this hint isn't set, the default log levels are equivalent to: - * "app=info,assert=warn,test=verbose,*=error" - */ -#define SDL_HINT_LOGGING "SDL_LOGGING" - /** * \brief When set don't force the SDL app to become a foreground process * @@ -1699,32 +1485,6 @@ extern "C" { */ #define SDL_HINT_RENDER_METAL_PREFER_LOW_POWER_DEVICE "SDL_RENDER_METAL_PREFER_LOW_POWER_DEVICE" -/** - * A variable containing a list of ROG gamepad capable mice. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_ROG_GAMEPAD_MICE "SDL_ROG_GAMEPAD_MICE" - -/** - * A variable containing a list of devices that are not ROG gamepad capable mice. This will override SDL_HINT_ROG_GAMEPAD_MICE and the built in device list. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_ROG_GAMEPAD_MICE_EXCLUDED "SDL_ROG_GAMEPAD_MICE_EXCLUDED" - /** * \brief A variable controlling if VSYNC is automatically disable if doesn't reach the enough FPS * @@ -2682,22 +2442,6 @@ extern "C" { */ #define SDL_HINT_TRACKPAD_IS_TOUCH_ONLY "SDL_TRACKPAD_IS_TOUCH_ONLY" -/** - * Cause SDL to call dbus_shutdown() on quit. - * - * This is useful as a debug tool to validate memory leaks, but shouldn't ever - * be set in production applications, as other libraries used by the application - * might use dbus under the hood and this cause cause crashes if they continue - * after SDL_Quit(). - * - * This variable can be set to the following values: - * "0" - SDL will not call dbus_shutdown() on quit (default) - * "1" - SDL will call dbus_shutdown() on quit - * - * This hint is available since SDL 2.30.0. - */ -#define SDL_HINT_SHUTDOWN_DBUS_ON_QUIT "SDL_SHUTDOWN_DBUS_ON_QUIT" - /** * \brief An enumeration of hint priorities diff --git a/libs/SDL2/include/SDL_joystick.h b/libs/SDL2/include/SDL_joystick.h index 561e01099..b9b4f6228 100644 --- a/libs/SDL2/include/SDL_joystick.h +++ b/libs/SDL2/include/SDL_joystick.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_keyboard.h b/libs/SDL2/include/SDL_keyboard.h index 03c7b5a37..86a37ad1a 100644 --- a/libs/SDL2/include/SDL_keyboard.h +++ b/libs/SDL2/include/SDL_keyboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -298,10 +298,8 @@ extern DECLSPEC void SDLCALL SDL_ClearComposition(void); extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputShown(void); /** - * Set the rectangle used to type Unicode text inputs. Native input methods - * will place a window with word suggestions near it, without covering the - * text being inputted. - * + * Set the rectangle used to type Unicode text inputs. + * * To start text input in a given location, this function is intended to be * called before SDL_StartTextInput, although some platforms support moving * the rectangle even while text input (and a composition) is active. diff --git a/libs/SDL2/include/SDL_keycode.h b/libs/SDL2/include/SDL_keycode.h index 57a71bd79..710622302 100644 --- a/libs/SDL2/include/SDL_keycode.h +++ b/libs/SDL2/include/SDL_keycode.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_loadso.h b/libs/SDL2/include/SDL_loadso.h index 4edc22e9e..ca59b681c 100644 --- a/libs/SDL2/include/SDL_loadso.h +++ b/libs/SDL2/include/SDL_loadso.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_locale.h b/libs/SDL2/include/SDL_locale.h index 0b6118f0e..482dbefe7 100644 --- a/libs/SDL2/include/SDL_locale.h +++ b/libs/SDL2/include/SDL_locale.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_log.h b/libs/SDL2/include/SDL_log.h index bd030c6d2..da733c402 100644 --- a/libs/SDL2/include/SDL_log.h +++ b/libs/SDL2/include/SDL_log.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -59,7 +59,7 @@ extern "C" { * By default the application category is enabled at the INFO level, * the assert category is enabled at the WARN level, test is enabled * at the VERBOSE level and all other categories are enabled at the - * ERROR level. + * CRITICAL level. */ typedef enum { @@ -352,7 +352,7 @@ extern DECLSPEC void SDLCALL SDL_LogMessage(int category, */ extern DECLSPEC void SDLCALL SDL_LogMessageV(int category, SDL_LogPriority priority, - SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap) SDL_PRINTF_VARARG_FUNCV(3); + const char *fmt, va_list ap); /** * The prototype for the log output callback function. diff --git a/libs/SDL2/include/SDL_main.h b/libs/SDL2/include/SDL_main.h index a66c84b4e..5cc8e5913 100644 --- a/libs/SDL2/include/SDL_main.h +++ b/libs/SDL2/include/SDL_main.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_messagebox.h b/libs/SDL2/include/SDL_messagebox.h index 5ace6f2dd..7896fd129 100644 --- a/libs/SDL2/include/SDL_messagebox.h +++ b/libs/SDL2/include/SDL_messagebox.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_metal.h b/libs/SDL2/include/SDL_metal.h index 50f7b2aeb..f36e34878 100644 --- a/libs/SDL2/include/SDL_metal.h +++ b/libs/SDL2/include/SDL_metal.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_misc.h b/libs/SDL2/include/SDL_misc.h index 113ba7a15..13ed9c771 100644 --- a/libs/SDL2/include/SDL_misc.h +++ b/libs/SDL2/include/SDL_misc.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_mouse.h b/libs/SDL2/include/SDL_mouse.h index 687ff122d..aa0757573 100644 --- a/libs/SDL2/include/SDL_mouse.h +++ b/libs/SDL2/include/SDL_mouse.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_mutex.h b/libs/SDL2/include/SDL_mutex.h index eaa21f293..e679d3808 100644 --- a/libs/SDL2/include/SDL_mutex.h +++ b/libs/SDL2/include/SDL_mutex.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_name.h b/libs/SDL2/include/SDL_name.h index 71e935455..5c3e07ab7 100644 --- a/libs/SDL2/include/SDL_name.h +++ b/libs/SDL2/include/SDL_name.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_opengl.h b/libs/SDL2/include/SDL_opengl.h index 2bb38c5c0..0ba89127a 100644 --- a/libs/SDL2/include/SDL_opengl.h +++ b/libs/SDL2/include/SDL_opengl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_opengles.h b/libs/SDL2/include/SDL_opengles.h index 7e9a1ab8d..f4465eaa9 100644 --- a/libs/SDL2/include/SDL_opengles.h +++ b/libs/SDL2/include/SDL_opengles.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_opengles2.h b/libs/SDL2/include/SDL_opengles2.h index 96971344d..5e3b717de 100644 --- a/libs/SDL2/include/SDL_opengles2.h +++ b/libs/SDL2/include/SDL_opengles2.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_pixels.h b/libs/SDL2/include/SDL_pixels.h index 44757cdcf..9abd57b42 100644 --- a/libs/SDL2/include/SDL_pixels.h +++ b/libs/SDL2/include/SDL_pixels.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -61,10 +61,7 @@ typedef enum SDL_PIXELTYPE_ARRAYU16, SDL_PIXELTYPE_ARRAYU32, SDL_PIXELTYPE_ARRAYF16, - SDL_PIXELTYPE_ARRAYF32, - - /* This must be at the end of the list to avoid breaking the existing ABI */ - SDL_PIXELTYPE_INDEX2 + SDL_PIXELTYPE_ARRAYF32 } SDL_PixelType; /** Bitmap pixel order, high bit -> low bit. */ @@ -137,7 +134,6 @@ typedef enum #define SDL_ISPIXELFORMAT_INDEXED(format) \ (!SDL_ISPIXELFORMAT_FOURCC(format) && \ ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX2) || \ (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \ (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8))) @@ -181,12 +177,6 @@ typedef enum SDL_PIXELFORMAT_INDEX1MSB = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_1234, 0, 1, 0), - SDL_PIXELFORMAT_INDEX2LSB = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX2, SDL_BITMAPORDER_4321, 0, - 2, 0), - SDL_PIXELFORMAT_INDEX2MSB = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX2, SDL_BITMAPORDER_1234, 0, - 2, 0), SDL_PIXELFORMAT_INDEX4LSB = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0, 4, 0), @@ -286,19 +276,11 @@ typedef enum SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_ABGR8888, - SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_RGBX8888, - SDL_PIXELFORMAT_XRGB32 = SDL_PIXELFORMAT_XRGB8888, - SDL_PIXELFORMAT_BGRX32 = SDL_PIXELFORMAT_BGRX8888, - SDL_PIXELFORMAT_XBGR32 = SDL_PIXELFORMAT_XBGR8888, #else SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_RGBA8888, - SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_XBGR8888, - SDL_PIXELFORMAT_XRGB32 = SDL_PIXELFORMAT_BGRX8888, - SDL_PIXELFORMAT_BGRX32 = SDL_PIXELFORMAT_XRGB8888, - SDL_PIXELFORMAT_XBGR32 = SDL_PIXELFORMAT_RGBX8888, #endif SDL_PIXELFORMAT_YV12 = /**< Planar mode: Y + V + U (3 planes) */ diff --git a/libs/SDL2/include/SDL_platform.h b/libs/SDL2/include/SDL_platform.h index 6e67b4577..d2a7e052d 100644 --- a/libs/SDL2/include/SDL_platform.h +++ b/libs/SDL2/include/SDL_platform.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -166,12 +166,6 @@ #define WINAPI_FAMILY_WINRT 0 #endif /* HAVE_WINAPIFAMILY_H */ -#if (HAVE_WINAPIFAMILY_H) && defined(WINAPI_FAMILY_PHONE_APP) -#define SDL_WINAPI_FAMILY_PHONE (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) -#else -#define SDL_WINAPI_FAMILY_PHONE 0 -#endif - #if WINAPI_FAMILY_WINRT #undef __WINRT__ #define __WINRT__ 1 diff --git a/libs/SDL2/include/SDL_power.h b/libs/SDL2/include/SDL_power.h index 0520065ce..1d75704c4 100644 --- a/libs/SDL2/include/SDL_power.h +++ b/libs/SDL2/include/SDL_power.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_quit.h b/libs/SDL2/include/SDL_quit.h index 3f69dc9f2..d8ceb8943 100644 --- a/libs/SDL2/include/SDL_quit.h +++ b/libs/SDL2/include/SDL_quit.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_rect.h b/libs/SDL2/include/SDL_rect.h index 5ce1f0b45..9611a311c 100644 --- a/libs/SDL2/include/SDL_rect.h +++ b/libs/SDL2/include/SDL_rect.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_render.h b/libs/SDL2/include/SDL_render.h index b7135bb9d..2d3f07366 100644 --- a/libs/SDL2/include/SDL_render.h +++ b/libs/SDL2/include/SDL_render.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -42,7 +42,7 @@ * of the many good 3D engines. * * These functions must be called from the main thread. - * See this bug for details: https://github.com/libsdl-org/SDL/issues/986 + * See this bug for details: http://bugzilla.libsdl.org/show_bug.cgi?id=1995 */ #ifndef SDL_render_h_ diff --git a/libs/SDL2/include/SDL_revision.h b/libs/SDL2/include/SDL_revision.h index ee42f8421..4455a08b6 100644 --- a/libs/SDL2/include/SDL_revision.h +++ b/libs/SDL2/include/SDL_revision.h @@ -1,7 +1,7 @@ /* Generated by updaterev.sh, do not edit */ #ifdef SDL_VENDOR_INFO -#define SDL_REVISION "SDL-release-2.30.0-0-g859844eae (" SDL_VENDOR_INFO ")" +#define SDL_REVISION "SDL-release-2.28.5-0-g15ead9a40 (" SDL_VENDOR_INFO ")" #else -#define SDL_REVISION "SDL-release-2.30.0-0-g859844eae" +#define SDL_REVISION "SDL-release-2.28.5-0-g15ead9a40" #endif #define SDL_REVISION_NUMBER 0 diff --git a/libs/SDL2/include/SDL_rwops.h b/libs/SDL2/include/SDL_rwops.h index 9dd99f92b..8615cb542 100644 --- a/libs/SDL2/include/SDL_rwops.h +++ b/libs/SDL2/include/SDL_rwops.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_scancode.h b/libs/SDL2/include/SDL_scancode.h index fe13d5b7a..a960a7991 100644 --- a/libs/SDL2/include/SDL_scancode.h +++ b/libs/SDL2/include/SDL_scancode.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_sensor.h b/libs/SDL2/include/SDL_sensor.h index 8b89ef6a5..9ecce44b1 100644 --- a/libs/SDL2/include/SDL_sensor.h +++ b/libs/SDL2/include/SDL_sensor.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_shape.h b/libs/SDL2/include/SDL_shape.h index 4783cf290..f66babc01 100644 --- a/libs/SDL2/include/SDL_shape.h +++ b/libs/SDL2/include/SDL_shape.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_stdinc.h b/libs/SDL2/include/SDL_stdinc.h index 0035a357c..182ed86ee 100644 --- a/libs/SDL2/include/SDL_stdinc.h +++ b/libs/SDL2/include/SDL_stdinc.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -257,7 +257,7 @@ typedef uint64_t Uint64; #define SDL_PRIs64 PRIs64 #elif defined(__WIN32__) || defined(__GDK__) #define SDL_PRIs64 "I64d" -#elif defined(__LP64__) && !defined(__APPLE__) +#elif defined(__LINUX__) && defined(__LP64__) #define SDL_PRIs64 "ld" #else #define SDL_PRIs64 "lld" @@ -268,7 +268,7 @@ typedef uint64_t Uint64; #define SDL_PRIu64 PRIu64 #elif defined(__WIN32__) || defined(__GDK__) #define SDL_PRIu64 "I64u" -#elif defined(__LP64__) && !defined(__APPLE__) +#elif defined(__LINUX__) && defined(__LP64__) #define SDL_PRIu64 "lu" #else #define SDL_PRIu64 "llu" @@ -279,7 +279,7 @@ typedef uint64_t Uint64; #define SDL_PRIx64 PRIx64 #elif defined(__WIN32__) || defined(__GDK__) #define SDL_PRIx64 "I64x" -#elif defined(__LP64__) && !defined(__APPLE__) +#elif defined(__LINUX__) && defined(__LP64__) #define SDL_PRIx64 "lx" #else #define SDL_PRIx64 "llx" @@ -290,7 +290,7 @@ typedef uint64_t Uint64; #define SDL_PRIX64 PRIX64 #elif defined(__WIN32__) || defined(__GDK__) #define SDL_PRIX64 "I64X" -#elif defined(__LP64__) && !defined(__APPLE__) +#elif defined(__LINUX__) && defined(__LP64__) #define SDL_PRIX64 "lX" #else #define SDL_PRIX64 "llX" @@ -336,9 +336,7 @@ typedef uint64_t Uint64; #define SDL_PRINTF_FORMAT_STRING #define SDL_SCANF_FORMAT_STRING #define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) -#define SDL_PRINTF_VARARG_FUNCV( fmtargnumber ) #define SDL_SCANF_VARARG_FUNC( fmtargnumber ) -#define SDL_SCANF_VARARG_FUNCV( fmtargnumber ) #else #if defined(_MSC_VER) && (_MSC_VER >= 1600) /* VS 2010 and above */ #include @@ -364,14 +362,10 @@ typedef uint64_t Uint64; #endif #if defined(__GNUC__) #define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __printf__, fmtargnumber, fmtargnumber+1 ))) -#define SDL_PRINTF_VARARG_FUNCV( fmtargnumber ) __attribute__(( format( __printf__, fmtargnumber, 0 ))) #define SDL_SCANF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __scanf__, fmtargnumber, fmtargnumber+1 ))) -#define SDL_SCANF_VARARG_FUNCV( fmtargnumber ) __attribute__(( format( __scanf__, fmtargnumber, 0 ))) #else #define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) -#define SDL_PRINTF_VARARG_FUNCV( fmtargnumber ) #define SDL_SCANF_VARARG_FUNC( fmtargnumber ) -#define SDL_SCANF_VARARG_FUNCV( fmtargnumber ) #endif #endif /* SDL_DISABLE_ANALYZE_MACROS */ @@ -609,11 +603,11 @@ extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2); extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t len); extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, ...) SDL_SCANF_VARARG_FUNC(2); -extern DECLSPEC int SDLCALL SDL_vsscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, va_list ap) SDL_SCANF_VARARG_FUNCV(2); +extern DECLSPEC int SDLCALL SDL_vsscanf(const char *text, const char *fmt, va_list ap); extern DECLSPEC int SDLCALL SDL_snprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ... ) SDL_PRINTF_VARARG_FUNC(3); -extern DECLSPEC int SDLCALL SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap) SDL_PRINTF_VARARG_FUNCV(3); +extern DECLSPEC int SDLCALL SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt, va_list ap); extern DECLSPEC int SDLCALL SDL_asprintf(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); -extern DECLSPEC int SDLCALL SDL_vasprintf(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap) SDL_PRINTF_VARARG_FUNCV(2); +extern DECLSPEC int SDLCALL SDL_vasprintf(char **strp, const char *fmt, va_list ap); #ifndef HAVE_M_PI #ifndef M_PI @@ -694,8 +688,8 @@ extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, size_t * outbytesleft); /** - * This function converts a buffer or string between encodings in one pass, - * returning a string that must be freed with SDL_free() or NULL on error. + * This function converts a buffer or string between encodings in one pass, returning a + * string that must be freed with SDL_free() or NULL on error. * * \since This function is available since SDL 2.0.0. */ @@ -704,8 +698,8 @@ extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode, const char *inbuf, size_t inbytesleft); #define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1) -#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1) -#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1) +#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2-INTERNAL", "UTF-8", S, SDL_strlen(S)+1) +#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4-INTERNAL", "UTF-8", S, SDL_strlen(S)+1) #define SDL_iconv_wchar_utf8(S) SDL_iconv_string("UTF-8", "WCHAR_T", (char *)S, (SDL_wcslen(S)+1)*sizeof(wchar_t)) /* force builds using Clang's static analysis tools to use literal C runtime diff --git a/libs/SDL2/include/SDL_surface.h b/libs/SDL2/include/SDL_surface.h index ceeb86bd8..d6ee615c5 100644 --- a/libs/SDL2/include/SDL_surface.h +++ b/libs/SDL2/include/SDL_surface.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_system.h b/libs/SDL2/include/SDL_system.h index ddae4f8cc..4b7eaddcc 100644 --- a/libs/SDL2/include/SDL_system.h +++ b/libs/SDL2/include/SDL_system.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -593,8 +593,7 @@ extern DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void /* Functions used only by GDK */ #if defined(__GDK__) -typedef struct XTaskQueueObject *XTaskQueueHandle; -typedef struct XUser *XUserHandle; +typedef struct XTaskQueueObject * XTaskQueueHandle; /** * Gets a reference to the global async task queue handle for GDK, @@ -611,20 +610,6 @@ typedef struct XUser *XUserHandle; */ extern DECLSPEC int SDLCALL SDL_GDKGetTaskQueue(XTaskQueueHandle * outTaskQueue); -/** - * Gets a reference to the default user handle for GDK. - * - * This is effectively a synchronous version of XUserAddAsync, which always - * prefers the default user and allows a sign-in UI. - * - * \param outUserHandle a pointer to be filled in with the default user - * handle. - * \returns 0 if success, -1 if any error occurs. - * - * \since This function is available since SDL 2.28.0. - */ -extern DECLSPEC int SDLCALL SDL_GDKGetDefaultUser(XUserHandle * outUserHandle); - #endif /* Ends C function definitions when using C++ */ diff --git a/libs/SDL2/include/SDL_syswm.h b/libs/SDL2/include/SDL_syswm.h index 7b8bd6ef9..b35734deb 100644 --- a/libs/SDL2/include/SDL_syswm.h +++ b/libs/SDL2/include/SDL_syswm.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_test.h b/libs/SDL2/include/SDL_test.h index e5acbee4e..80daaafbd 100644 --- a/libs/SDL2/include/SDL_test.h +++ b/libs/SDL2/include/SDL_test.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_test_assert.h b/libs/SDL2/include/SDL_test_assert.h index 4f983350a..341e490fa 100644 --- a/libs/SDL2/include/SDL_test_assert.h +++ b/libs/SDL2/include/SDL_test_assert.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_test_common.h b/libs/SDL2/include/SDL_test_common.h index d977e463f..6de63cad6 100644 --- a/libs/SDL2/include/SDL_test_common.h +++ b/libs/SDL2/include/SDL_test_common.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_test_compare.h b/libs/SDL2/include/SDL_test_compare.h index 61a38d090..5fce25ca1 100644 --- a/libs/SDL2/include/SDL_test_compare.h +++ b/libs/SDL2/include/SDL_test_compare.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_test_crc32.h b/libs/SDL2/include/SDL_test_crc32.h index e3478318d..bf3478210 100644 --- a/libs/SDL2/include/SDL_test_crc32.h +++ b/libs/SDL2/include/SDL_test_crc32.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_test_font.h b/libs/SDL2/include/SDL_test_font.h index 620c82116..18a82ffc8 100644 --- a/libs/SDL2/include/SDL_test_font.h +++ b/libs/SDL2/include/SDL_test_font.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_test_fuzzer.h b/libs/SDL2/include/SDL_test_fuzzer.h index a847ccb01..cfe6a14f2 100644 --- a/libs/SDL2/include/SDL_test_fuzzer.h +++ b/libs/SDL2/include/SDL_test_fuzzer.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_test_harness.h b/libs/SDL2/include/SDL_test_harness.h index bd9e4f8de..26231dcd6 100644 --- a/libs/SDL2/include/SDL_test_harness.h +++ b/libs/SDL2/include/SDL_test_harness.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_test_images.h b/libs/SDL2/include/SDL_test_images.h index b5bcb0a00..121137175 100644 --- a/libs/SDL2/include/SDL_test_images.h +++ b/libs/SDL2/include/SDL_test_images.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_test_log.h b/libs/SDL2/include/SDL_test_log.h index ea9ae5e1c..a27ffc209 100644 --- a/libs/SDL2/include/SDL_test_log.h +++ b/libs/SDL2/include/SDL_test_log.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_test_md5.h b/libs/SDL2/include/SDL_test_md5.h index 3764b0425..538c7ae3e 100644 --- a/libs/SDL2/include/SDL_test_md5.h +++ b/libs/SDL2/include/SDL_test_md5.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_test_memory.h b/libs/SDL2/include/SDL_test_memory.h index 9bd143252..f959177d2 100644 --- a/libs/SDL2/include/SDL_test_memory.h +++ b/libs/SDL2/include/SDL_test_memory.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_test_random.h b/libs/SDL2/include/SDL_test_random.h index 344646aa8..0035a8030 100644 --- a/libs/SDL2/include/SDL_test_random.h +++ b/libs/SDL2/include/SDL_test_random.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_thread.h b/libs/SDL2/include/SDL_thread.h index dc7f5363a..b829bbad5 100644 --- a/libs/SDL2/include/SDL_thread.h +++ b/libs/SDL2/include/SDL_thread.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_timer.h b/libs/SDL2/include/SDL_timer.h index 8123e432f..98f9ad16c 100644 --- a/libs/SDL2/include/SDL_timer.h +++ b/libs/SDL2/include/SDL_timer.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_touch.h b/libs/SDL2/include/SDL_touch.h index f6a5db413..c12d4a1c8 100644 --- a/libs/SDL2/include/SDL_touch.h +++ b/libs/SDL2/include/SDL_touch.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_types.h b/libs/SDL2/include/SDL_types.h index e8d33c651..b5d7192ff 100644 --- a/libs/SDL2/include/SDL_types.h +++ b/libs/SDL2/include/SDL_types.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/include/SDL_version.h b/libs/SDL2/include/SDL_version.h index 02143ff7a..7585eece5 100644 --- a/libs/SDL2/include/SDL_version.h +++ b/libs/SDL2/include/SDL_version.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -58,8 +58,8 @@ typedef struct SDL_version /* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL */ #define SDL_MAJOR_VERSION 2 -#define SDL_MINOR_VERSION 30 -#define SDL_PATCHLEVEL 0 +#define SDL_MINOR_VERSION 28 +#define SDL_PATCHLEVEL 5 /** * Macro to determine SDL version program was compiled against. diff --git a/libs/SDL2/include/SDL_video.h b/libs/SDL2/include/SDL_video.h index fa47d3099..c8b2d7a0d 100644 --- a/libs/SDL2/include/SDL_video.h +++ b/libs/SDL2/include/SDL_video.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -1278,8 +1278,7 @@ extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window * window, /** * Return whether the window has a surface associated with it. * - * \returns SDL_TRUE if there is a surface associated with the window, or - * SDL_FALSE otherwise. + * \returns SDL_TRUE if there is a surface associated with the window, or SDL_FALSE otherwise. * * \since This function is available since SDL 2.28.0. * @@ -1341,11 +1340,6 @@ extern DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window * window); * * This function is equivalent to the SDL 1.2 API SDL_UpdateRects(). * - * Note that this function will update _at least_ the rectangles specified, - * but this is only intended as an optimization; in practice, this might - * update more of the screen (or all of the screen!), depending on what - * method SDL uses to send pixels to the system. - * * \param window the window to update * \param rects an array of SDL_Rect structures representing areas of the * surface to copy, in pixels diff --git a/libs/SDL2/include/begin_code.h b/libs/SDL2/include/begin_code.h index a47a7d2b6..4142ffeba 100644 --- a/libs/SDL2/include/begin_code.h +++ b/libs/SDL2/include/begin_code.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -36,8 +36,6 @@ #ifndef SDL_DEPRECATED # if defined(__GNUC__) && (__GNUC__ >= 4) /* technically, this arrived in gcc 3.1, but oh well. */ # define SDL_DEPRECATED __attribute__((deprecated)) -# elif defined(_MSC_VER) -# define SDL_DEPRECATED __declspec(deprecated) # else # define SDL_DEPRECATED # endif diff --git a/libs/SDL2/include/close_code.h b/libs/SDL2/include/close_code.h index 50a0e6f3b..b5ff3e204 100644 --- a/libs/SDL2/include/close_code.h +++ b/libs/SDL2/include/close_code.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/lib/x64/SDL2.dll b/libs/SDL2/lib/x64/SDL2.dll index 878760628..e26bcb1c3 100644 Binary files a/libs/SDL2/lib/x64/SDL2.dll and b/libs/SDL2/lib/x64/SDL2.dll differ diff --git a/libs/SDL2/lib/x64/SDL2.lib b/libs/SDL2/lib/x64/SDL2.lib index 7257de638..99c5321ca 100644 Binary files a/libs/SDL2/lib/x64/SDL2.lib and b/libs/SDL2/lib/x64/SDL2.lib differ diff --git a/libs/SDL2/lib/x64/SDL2main.lib b/libs/SDL2/lib/x64/SDL2main.lib index 1981305fc..241e7c3c8 100644 Binary files a/libs/SDL2/lib/x64/SDL2main.lib and b/libs/SDL2/lib/x64/SDL2main.lib differ diff --git a/libs/SDL2/lib/x64/SDL2test.lib b/libs/SDL2/lib/x64/SDL2test.lib index 0255ad475..1fa2ecb04 100644 Binary files a/libs/SDL2/lib/x64/SDL2test.lib and b/libs/SDL2/lib/x64/SDL2test.lib differ diff --git a/libs/SDL2/lib/x86/SDL2.dll b/libs/SDL2/lib/x86/SDL2.dll index 3265fb2f3..573225cab 100644 Binary files a/libs/SDL2/lib/x86/SDL2.dll and b/libs/SDL2/lib/x86/SDL2.dll differ diff --git a/libs/SDL2/lib/x86/SDL2.lib b/libs/SDL2/lib/x86/SDL2.lib index 0ac84d292..b35ba62a2 100644 Binary files a/libs/SDL2/lib/x86/SDL2.lib and b/libs/SDL2/lib/x86/SDL2.lib differ diff --git a/libs/SDL2/lib/x86/SDL2main.lib b/libs/SDL2/lib/x86/SDL2main.lib index 7cd691b62..eccce2343 100644 Binary files a/libs/SDL2/lib/x86/SDL2main.lib and b/libs/SDL2/lib/x86/SDL2main.lib differ diff --git a/libs/SDL2/lib/x86/SDL2test.lib b/libs/SDL2/lib/x86/SDL2test.lib index 36ce4e0a5..21892ca9c 100644 Binary files a/libs/SDL2/lib/x86/SDL2test.lib and b/libs/SDL2/lib/x86/SDL2test.lib differ diff --git a/libs/SDL2/test/CMakeLists.txt b/libs/SDL2/test/CMakeLists.txt index f048d51f9..52a268561 100644 --- a/libs/SDL2/test/CMakeLists.txt +++ b/libs/SDL2/test/CMakeLists.txt @@ -7,55 +7,18 @@ include(CMakePushCheckState) set(SDL_TEST_EXECUTABLES) set(SDL_TESTS_NONINTERACTIVE) -set(SDL_TESTS_NEEDS_RESOURCES) +set(SDL_TESTS_NEEDS_ESOURCES) macro(add_sdl_test_executable TARGET) cmake_parse_arguments(AST "NONINTERACTIVE;NEEDS_RESOURCES" "" "" ${ARGN}) - if(ANDROID) - add_library(${TARGET} SHARED ${AST_UNPARSED_ARGUMENTS}) - else() - add_executable(${TARGET} ${AST_UNPARSED_ARGUMENTS}) - endif() + add_executable(${TARGET} ${AST_UNPARSED_ARGUMENTS}) list(APPEND SDL_TEST_EXECUTABLES ${TARGET}) if(AST_NONINTERACTIVE) list(APPEND SDL_TESTS_NONINTERACTIVE ${TARGET}) endif() if(AST_NEEDS_RESOURCES) - list(APPEND SDL_TESTS_NEEDS_RESOURCES ${TARGET}) - endif() - - if(HAVE_GCC_WDOCUMENTATION) - target_compile_options(${TARGET} PRIVATE "-Wdocumentation") - if(HAVE_GCC_WERROR_DOCUMENTATION) - target_compile_options(${TARGET} PRIVATE "-Werror=documentation") - endif() - endif() - - if(HAVE_GCC_WDOCUMENTATION_UNKNOWN_COMMAND) - if(SDL_WERROR) - if(HAVE_GCC_WERROR_DOCUMENTATION_UNKNOWN_COMMAND) - target_compile_options(${TARGET} PRIVATE "-Werror=documentation-unknown-command") - endif() - endif() - target_compile_options(${TARGET} PRIVATE "-Wdocumentation-unknown-command") - endif() - - if(HAVE_GCC_COMMENT_BLOCK_COMMANDS) - target_compile_options(${TARGET} PRIVATE "-fcomment-block-commands=threadsafety") - target_compile_options(${TARGET} PRIVATE "-fcomment-block-commands=deprecated") - else() - if(HAVE_CLANG_COMMENT_BLOCK_COMMANDS) - target_compile_options(${TARGET} PRIVATE "/clang:-fcomment-block-commands=threadsafety") - target_compile_options(${TARGET} PRIVATE "/clang:-fcomment-block-commands=deprecated") - endif() - endif() - - if(USE_GCC OR USE_CLANG) - check_c_compiler_flag(-fno-fast-math HAVE_GCC_FNO_FAST_MATH) - if(HAVE_GCC_FNO_FAST_MATH) - target_compile_options(${TARGET} PRIVATE -fno-fast-math) - endif() + list(APPEND SDL_TESTS_NEEDS_ESOURCES ${TARGET}) endif() endmacro() @@ -90,7 +53,7 @@ if(PSP) psppower ) elseif(PS2) - link_libraries( +link_libraries( SDL2main SDL2_test SDL2-static @@ -98,7 +61,7 @@ elseif(PS2) gskit dmakit ps2_drivers - ) +) else() link_libraries(SDL2::SDL2test SDL2::SDL2-static) endif() @@ -128,7 +91,7 @@ if(NOT MSVC OR NOT CMAKE_GENERATOR_PLATFORM STREQUAL "ARM64") endif() if (OPENGL_FOUND) - add_definitions(-DHAVE_OPENGL) +add_definitions(-DHAVE_OPENGL) endif() add_sdl_test_executable(checkkeys checkkeys.c) @@ -140,7 +103,7 @@ add_sdl_test_executable(testresample NEEDS_RESOURCES testresample.c) add_sdl_test_executable(testaudioinfo testaudioinfo.c) file(GLOB TESTAUTOMATION_SOURCE_FILES testautomation*.c) -add_sdl_test_executable(testautomation NONINTERACTIVE NEEDS_RESOURCES ${TESTAUTOMATION_SOURCE_FILES}) +add_sdl_test_executable(testautomation NEEDS_RESOURCES ${TESTAUTOMATION_SOURCE_FILES}) add_sdl_test_executable(testmultiaudio NEEDS_RESOURCES testmultiaudio.c testutils.c) add_sdl_test_executable(testaudiohotplug NEEDS_RESOURCES testaudiohotplug.c testutils.c) add_sdl_test_executable(testaudiocapture testaudiocapture.c) @@ -254,18 +217,18 @@ endif() cmake_pop_check_state() if(SDL_DUMMYAUDIO) - list(APPEND SDL_TESTS_NONINTERACTIVE - testaudioinfo - testsurround - ) + list(APPEND SDL_TESTS_NONINTERACTIVE + testaudioinfo + testsurround + ) endif() if(SDL_DUMMYVIDEO) - list(APPEND SDL_TESTS_NONINTERACTIVE - testkeys - testbounds - testdisplayinfo - ) + list(APPEND SDL_TESTS_NONINTERACTIVE + testkeys + testbounds + testdisplayinfo + ) endif() if(OPENGL_FOUND) @@ -291,7 +254,7 @@ file(COPY ${RESOURCE_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) if(PSP) # Build EBOOT files if building for PSP set(BUILD_EBOOT - ${SDL_TESTS_NEEDS_RESOURCES} + ${SDL_TESTS_NEEDS_ESOURCES} testatomic testaudiocapture testaudioinfo @@ -400,41 +363,14 @@ if(RISCOS) endforeach() endif() -if(CMAKE_RUNTIME_OUTPUT_DIRECTORY) - set(test_bin_dir "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") - if(NOT IS_ABSOLUTE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") - set(test_bin_dir "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") - endif() -else() - set(test_bin_dir "${CMAKE_CURRENT_BINARY_DIR}") -endif() -if(NOT CMAKE_VERSION VERSION_LESS 3.20) - get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) - set(test_bin_dir "${test_bin_dir}$<$:/$>") -endif() - -set(RESOURCE_FILES_BINDIR) -foreach(resource_file IN LISTS RESOURCE_FILES) - get_filename_component(res_file_name ${resource_file} NAME) - set(resource_file_bindir "${test_bin_dir}/${res_file_name}") - add_custom_command(OUTPUT "${resource_file_bindir}" - COMMAND "${CMAKE_COMMAND}" -E copy "${resource_file}" "${resource_file_bindir}" - DEPENDS "${resource_file}" - ) - list(APPEND RESOURCE_FILES_BINDIR "${resource_file_bindir}") -endforeach() -add_custom_target(copy-sdl-test-resources - DEPENDS "${RESOURCE_FILES_BINDIR}" -) - foreach(APP IN LISTS SDL_TESTS_NEEDS_RESOURCES) - if(PSP OR PS2) - foreach(RESOURCE_FILE ${RESOURCE_FILES}) + foreach(RESOURCE_FILE ${RESOURCE_FILES}) + if(PSP OR PS2) add_custom_command(TARGET ${APP} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${RESOURCE_FILE} $/sdl-${APP}) - endforeach() - else() - add_dependencies(${APP} copy-sdl-test-resources) - endif() + else() + add_custom_command(TARGET ${APP} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${RESOURCE_FILE} $) + endif() + endforeach(RESOURCE_FILE) if(APPLE) # Make sure resource files get installed into macOS/iOS .app bundles. target_sources(${APP} PRIVATE "${RESOURCE_FILES}") @@ -491,7 +427,6 @@ foreach(TESTCASE ${SDL_TESTS_NONINTERACTIVE}) endif() endforeach() -set_tests_properties(testautomation PROPERTIES TIMEOUT 120) set_tests_properties(testthread PROPERTIES TIMEOUT 40) set_tests_properties(testtimer PROPERTIES TIMEOUT 60) if(TARGET testfilesystem_pre) @@ -511,11 +446,6 @@ if(SDL_INSTALL_TESTS) DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL2 ) endif() - if(MSVC) - foreach(test ${SDL_TEST_EXECUTABLES}) - SDL_install_pdb(${test} "${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL2") - endforeach() - endif() install( FILES ${RESOURCE_FILES} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL2 diff --git a/libs/SDL2/test/Makefile.in b/libs/SDL2/test/Makefile.in index 76331d67f..93df6360e 100644 --- a/libs/SDL2/test/Makefile.in +++ b/libs/SDL2/test/Makefile.in @@ -95,7 +95,7 @@ installedtestsmetadir = $(datadir)/installed-tests/SDL2 generatetestmeta: rm -f *.test - set -e; for exe in $(TESTS); do \ + set -e; for exe in $(noninteractive) $(needs_audio) $(needs_display); do \ sed \ -e 's#@installedtestsdir@#$(installedtestsdir)#g' \ -e "s#@exe@#$$exe#g" \ @@ -141,7 +141,6 @@ testautomation$(EXE): $(srcdir)/testautomation.c \ $(srcdir)/testautomation_hints.c \ $(srcdir)/testautomation_joystick.c \ $(srcdir)/testautomation_keyboard.c \ - $(srcdir)/testautomation_log.c \ $(srcdir)/testautomation_main.c \ $(srcdir)/testautomation_math.c \ $(srcdir)/testautomation_mouse.c \ @@ -152,7 +151,6 @@ testautomation$(EXE): $(srcdir)/testautomation.c \ $(srcdir)/testautomation_rwops.c \ $(srcdir)/testautomation_sdltest.c \ $(srcdir)/testautomation_stdlib.c \ - $(srcdir)/testautomation_subsystems.c \ $(srcdir)/testautomation_surface.c \ $(srcdir)/testautomation_syswm.c \ $(srcdir)/testautomation_timer.c \ @@ -387,12 +385,8 @@ distclean: clean rm -f config.status config.cache config.log rm -rf $(srcdir)/autom4te* -TESTS = \ +noninteractive = \ testatomic$(EXE) \ - testaudioinfo$(EXE) \ - testautomation$(EXE) \ - testbounds$(EXE) \ - testdisplayinfo$(EXE) \ testerror$(EXE) \ testevdev$(EXE) \ testfilesystem$(EXE) \ @@ -401,12 +395,23 @@ TESTS = \ testplatform$(EXE) \ testpower$(EXE) \ testqsort$(EXE) \ - testsurround$(EXE) \ testthread$(EXE) \ testtimer$(EXE) \ testver$(EXE) \ $(NULL) +needs_audio = \ + testaudioinfo$(EXE) \ + testsurround$(EXE) \ + $(NULL) + +needs_display = \ + testbounds$(EXE) \ + testdisplayinfo$(EXE) \ + $(NULL) + +TESTS = $(noninteractive) $(needs_audio) $(needs_display) + check: @set -e; \ status=0; \ diff --git a/libs/SDL2/test/acinclude.m4 b/libs/SDL2/test/acinclude.m4 index ebee8238a..0fdf353ea 100644 --- a/libs/SDL2/test/acinclude.m4 +++ b/libs/SDL2/test/acinclude.m4 @@ -5,6 +5,8 @@ # stolen from Manish Singh # Shamelessly stolen from Owen Taylor +# serial 2 + dnl AM_PATH_SDL2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS dnl @@ -43,7 +45,7 @@ AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run if test "x$sdl_pc" = xyes ; then no_sdl="" - SDL2_CONFIG="$PKG_CONFIG sdl2" + SDL2_CONFIG="pkg-config sdl2" else as_save_PATH="$PATH" if test "x$prefix" != xNONE && test "$cross_compiling" != yes; then diff --git a/libs/SDL2/test/checkkeys.c b/libs/SDL2/test/checkkeys.c index f546900c5..4efdc721e 100644 --- a/libs/SDL2/test/checkkeys.c +++ b/libs/SDL2/test/checkkeys.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -269,14 +269,14 @@ int main(int argc, char *argv[]) window = SDL_CreateWindow("CheckKeys Test", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, 0); - if (!window) { + if (window == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create 640x480 window: %s\n", SDL_GetError()); quit(2); } renderer = SDL_CreateRenderer(window, -1, 0); - if (!renderer) { + if (renderer == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create renderer: %s\n", SDL_GetError()); quit(2); @@ -284,7 +284,7 @@ int main(int argc, char *argv[]) textwin = SDLTest_TextWindowCreate(0, 0, 640, 480); -#ifdef __IPHONEOS__ +#if __IPHONEOS__ /* Creating the context creates the view, which we need to show keyboard */ SDL_GL_CreateContext(window); #endif diff --git a/libs/SDL2/test/checkkeysthreads.c b/libs/SDL2/test/checkkeysthreads.c index efd654875..3db5dd2dc 100644 --- a/libs/SDL2/test/checkkeysthreads.c +++ b/libs/SDL2/test/checkkeysthreads.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -254,7 +254,7 @@ int main(int argc, char *argv[]) window = SDL_CreateWindow("CheckKeys Test", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, 0); - if (!window) { + if (window == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create 640x480 window: %s\n", SDL_GetError()); quit(2); @@ -266,7 +266,7 @@ int main(int argc, char *argv[]) renderer = SDL_CreateRenderer(window, -1, 0); SDL_RenderPresent(renderer); -#ifdef __IPHONEOS__ +#if __IPHONEOS__ /* Creating the context creates the view, which we need to show keyboard */ SDL_GL_CreateContext(window); #endif diff --git a/libs/SDL2/test/configure b/libs/SDL2/test/configure index 8ea80bc27..c71abe489 100755 --- a/libs/SDL2/test/configure +++ b/libs/SDL2/test/configure @@ -3966,7 +3966,7 @@ fi if test "x$sdl_pc" = xyes ; then no_sdl="" - SDL2_CONFIG="$PKG_CONFIG sdl2" + SDL2_CONFIG="pkg-config sdl2" else as_save_PATH="$PATH" if test "x$prefix" != xNONE && test "$cross_compiling" != yes; then diff --git a/libs/SDL2/test/controllermap.c b/libs/SDL2/test/controllermap.c index 982a9fb6f..cfb0effac 100644 --- a/libs/SDL2/test/controllermap.c +++ b/libs/SDL2/test/controllermap.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -288,8 +288,7 @@ ConfigureBinding(const SDL_GameControllerExtendedBind *pBinding) SDL_Log("Configuring button binding for button %d\n", pBinding->value.button); break; case SDL_CONTROLLER_BINDTYPE_AXIS: - SDL_Log("Configuring axis binding for axis %d %d/%d committed = %s\n", pBinding->value.axis.axis, pBinding->value.axis.axis_min, pBinding->value.axis.axis_max, - pBinding->committed ? "true" : "false"); + SDL_Log("Configuring axis binding for axis %d %d/%d committed = %s\n", pBinding->value.axis.axis, pBinding->value.axis.axis_min, pBinding->value.axis.axis_max, pBinding->committed ? "true" : "false"); break; case SDL_CONTROLLER_BINDTYPE_HAT: SDL_Log("Configuring hat binding for hat %d %d\n", pBinding->value.hat.hat, pBinding->value.hat.hat_mask); @@ -730,13 +729,13 @@ int main(int argc, char *argv[]) window = SDL_CreateWindow("Game Controller Map", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, SCREEN_WIDTH, SCREEN_HEIGHT, 0); - if (!window) { + if (window == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create window: %s\n", SDL_GetError()); return 2; } screen = SDL_CreateRenderer(window, -1, 0); - if (!screen) { + if (screen == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create renderer: %s\n", SDL_GetError()); return 2; } @@ -767,7 +766,7 @@ int main(int argc, char *argv[]) name = SDL_JoystickNameForIndex(i); SDL_Log("Joystick %d: %s\n", i, name ? name : "Unknown Joystick"); joystick = SDL_JoystickOpen(i); - if (!joystick) { + if (joystick == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_JoystickOpen(%d) failed: %s\n", i, SDL_GetError()); } else { @@ -793,7 +792,7 @@ int main(int argc, char *argv[]) } } joystick = SDL_JoystickOpen(joystick_index); - if (!joystick) { + if (joystick == NULL) { SDL_Log("Couldn't open joystick %d: %s\n", joystick_index, SDL_GetError()); } else { WatchJoystick(joystick); diff --git a/libs/SDL2/test/loopwave.c b/libs/SDL2/test/loopwave.c index 15f13658c..156767c20 100644 --- a/libs/SDL2/test/loopwave.c +++ b/libs/SDL2/test/loopwave.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -127,7 +127,7 @@ int main(int argc, char *argv[]) filename = GetResourceFilename(argc > 1 ? argv[1] : NULL, "sample.wav"); - if (!filename) { + if (filename == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "%s\n", SDL_GetError()); quit(1); } diff --git a/libs/SDL2/test/loopwavequeue.c b/libs/SDL2/test/loopwavequeue.c index 01b6ece3e..70dd072d2 100644 --- a/libs/SDL2/test/loopwavequeue.c +++ b/libs/SDL2/test/loopwavequeue.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -21,7 +21,7 @@ #include "SDL.h" -#ifdef HAVE_SIGNAL_H +#if HAVE_SIGNAL_H #include #endif @@ -84,7 +84,7 @@ int main(int argc, char *argv[]) filename = GetResourceFilename(argc > 1 ? argv[1] : NULL, "sample.wav"); - if (!filename) { + if (filename == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "%s\n", SDL_GetError()); quit(1); } @@ -97,7 +97,7 @@ int main(int argc, char *argv[]) wave.spec.callback = NULL; /* we'll push audio. */ -#ifdef HAVE_SIGNAL_H +#if HAVE_SIGNAL_H /* Set the signals */ #ifdef SIGHUP (void)signal(SIGHUP, poked); diff --git a/libs/SDL2/test/testatomic.c b/libs/SDL2/test/testatomic.c index 1a599101e..15a7a6a7d 100644 --- a/libs/SDL2/test/testatomic.c +++ b/libs/SDL2/test/testatomic.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -234,8 +234,7 @@ static void RunEpicTest() v = SDL_AtomicGet(&good); SDL_Log("Atomic %d Non-Atomic %d\n", v, bad); SDL_assert(v == Expect); - /* We can't guarantee that bad != Expect, this would happen on a single core system, for example. */ - /*SDL_assert(bad != Expect);*/ + SDL_assert(bad != Expect); } /* End atomic operation test */ diff --git a/libs/SDL2/test/testaudiocapture.c b/libs/SDL2/test/testaudiocapture.c index 523385b3a..a8fdf5ec5 100644 --- a/libs/SDL2/test/testaudiocapture.c +++ b/libs/SDL2/test/testaudiocapture.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/test/testaudiohotplug.c b/libs/SDL2/test/testaudiohotplug.c index 354d4644f..e4bd9ac09 100644 --- a/libs/SDL2/test/testaudiohotplug.c +++ b/libs/SDL2/test/testaudiohotplug.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -17,7 +17,7 @@ #include #include -#ifdef HAVE_SIGNAL_H +#if HAVE_SIGNAL_H #include #endif @@ -96,7 +96,7 @@ iteration() int index = e.adevice.which; int iscapture = e.adevice.iscapture; const char *name = SDL_GetAudioDeviceName(index, iscapture); - if (name) { + if (name != NULL) { SDL_Log("New %s audio device at index %u: %s\n", devtypestr(iscapture), (unsigned int)index, name); } else { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Got new %s device at index %u, but failed to get the name: %s\n", @@ -152,7 +152,7 @@ int main(int argc, char *argv[]) filename = GetResourceFilename(argc > 1 ? argv[1] : NULL, "sample.wav"); - if (!filename) { + if (filename == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "%s\n", SDL_GetError()); quit(1); } @@ -163,7 +163,7 @@ int main(int argc, char *argv[]) quit(1); } -#ifdef HAVE_SIGNAL_H +#if HAVE_SIGNAL_H /* Set the signals */ #ifdef SIGHUP (void)signal(SIGHUP, poked); diff --git a/libs/SDL2/test/testaudioinfo.c b/libs/SDL2/test/testaudioinfo.c index ec4b86470..ae59cbcc8 100644 --- a/libs/SDL2/test/testaudioinfo.c +++ b/libs/SDL2/test/testaudioinfo.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -29,7 +29,7 @@ print_devices(int iscapture) int i; for (i = 0; i < n; i++) { const char *name = SDL_GetAudioDeviceName(i, iscapture); - if (name) { + if (name != NULL) { SDL_Log(" %d: %s\n", i, name); } else { SDL_Log(" %d Error: %s\n", i, SDL_GetError()); @@ -81,7 +81,7 @@ int main(int argc, char **argv) if (SDL_GetDefaultAudioInfo(&deviceName, &spec, 0) < 0) { SDL_Log("Error when calling SDL_GetDefaultAudioInfo: %s\n", SDL_GetError()); } else { - SDL_Log("Default Output Name: %s\n", deviceName ? deviceName : "unknown"); + SDL_Log("Default Output Name: %s\n", deviceName != NULL ? deviceName : "unknown"); SDL_free(deviceName); SDL_Log("Sample Rate: %d\n", spec.freq); SDL_Log("Channels: %d\n", spec.channels); @@ -91,7 +91,7 @@ int main(int argc, char **argv) if (SDL_GetDefaultAudioInfo(&deviceName, &spec, 1) < 0) { SDL_Log("Error when calling SDL_GetDefaultAudioInfo: %s\n", SDL_GetError()); } else { - SDL_Log("Default Capture Name: %s\n", deviceName ? deviceName : "unknown"); + SDL_Log("Default Capture Name: %s\n", deviceName != NULL ? deviceName : "unknown"); SDL_free(deviceName); SDL_Log("Sample Rate: %d\n", spec.freq); SDL_Log("Channels: %d\n", spec.channels); diff --git a/libs/SDL2/test/testautomation.c b/libs/SDL2/test/testautomation.c index 3b5fad808..2150ed246 100644 --- a/libs/SDL2/test/testautomation.c +++ b/libs/SDL2/test/testautomation.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -41,7 +41,7 @@ int main(int argc, char *argv[]) /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); - if (!state) { + if (state == NULL) { return 1; } diff --git a/libs/SDL2/test/testautomation_audio.c b/libs/SDL2/test/testautomation_audio.c index 16ab753e9..bd586314f 100644 --- a/libs/SDL2/test/testautomation_audio.c +++ b/libs/SDL2/test/testautomation_audio.c @@ -52,42 +52,6 @@ void SDLCALL _audio_testCallback(void *userdata, Uint8 *stream, int len) _audio_testCallbackLength += len; } -#if defined(__linux__) -/* Linux builds can include many audio drivers, but some are very - * obscure and typically unsupported on modern systems. They will - * be skipped in tests that run against all included drivers, as - * they are basically guaranteed to fail. - */ -static SDL_bool DriverIsProblematic(const char *driver) -{ - static const char *driverList[] = { - /* Omnipresent in Linux builds, but deprecated since 2002, - * very rarely used on Linux nowadays, and is almost certainly - * guaranteed to fail. - */ - "dsp", - - /* OpenBSD sound API. Can be used on Linux, but very rare. */ - "sndio", - - /* Always fails on initialization and/or opening a device. - * Does anyone or anything actually use this? - */ - "nas" - }; - - int i; - - for (i = 0; i < SDL_arraysize(driverList); ++i) { - if (SDL_strcmp(driver, driverList[i]) == 0) { - return SDL_TRUE; - } - } - - return SDL_FALSE; -} -#endif - /* Test case functions */ /** @@ -119,43 +83,20 @@ int audio_initQuitAudio() int result; int i, iMax; const char *audioDriver; - const char *hint = SDL_GetHint(SDL_HINT_AUDIODRIVER); /* Stop SDL audio subsystem */ SDL_QuitSubSystem(SDL_INIT_AUDIO); SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_AUDIO)"); - /* Was a specific driver requested? */ - audioDriver = SDL_GetHint(SDL_HINT_AUDIODRIVER); - - if (audioDriver == NULL) { - /* Loop over all available audio drivers */ - iMax = SDL_GetNumAudioDrivers(); - SDLTest_AssertPass("Call to SDL_GetNumAudioDrivers()"); - SDLTest_AssertCheck(iMax > 0, "Validate number of audio drivers; expected: >0 got: %d", iMax); - } else { - /* A specific driver was requested for testing */ - iMax = 1; - } + /* Loop over all available audio drivers */ + iMax = SDL_GetNumAudioDrivers(); + SDLTest_AssertPass("Call to SDL_GetNumAudioDrivers()"); + SDLTest_AssertCheck(iMax > 0, "Validate number of audio drivers; expected: >0 got: %d", iMax); for (i = 0; i < iMax; i++) { - if (audioDriver == NULL) { - audioDriver = SDL_GetAudioDriver(i); - SDLTest_AssertPass("Call to SDL_GetAudioDriver(%d)", i); - SDLTest_Assert(audioDriver != NULL, "Audio driver name is not NULL"); - SDLTest_AssertCheck(audioDriver[0] != '\0', "Audio driver name is not empty; got: %s", audioDriver); /* NOLINT(clang-analyzer-core.NullDereference): Checked for NULL above */ - -#if defined(__linux__) - if (DriverIsProblematic(audioDriver)) { - SDLTest_Log("Audio driver '%s' flagged as problematic: skipping init/quit test (set SDL_AUDIODRIVER=%s to force)", audioDriver, audioDriver); - audioDriver = NULL; - continue; - } -#endif - } - - if (hint && SDL_strcmp(audioDriver, hint) != 0) { - continue; - } + audioDriver = SDL_GetAudioDriver(i); + SDLTest_AssertPass("Call to SDL_GetAudioDriver(%d)", i); + SDLTest_Assert(audioDriver != NULL, "Audio driver name is not NULL"); + SDLTest_AssertCheck(audioDriver[0] != '\0', "Audio driver name is not empty; got: %s", audioDriver); /* NOLINT(clang-analyzer-core.NullDereference): Checked for NULL above */ /* Call Init */ result = SDL_AudioInit(audioDriver); @@ -165,8 +106,6 @@ int audio_initQuitAudio() /* Call Quit */ SDL_AudioQuit(); SDLTest_AssertPass("Call to SDL_AudioQuit()"); - - audioDriver = NULL; } /* NULL driver specification */ @@ -201,43 +140,20 @@ int audio_initOpenCloseQuitAudio() int i, iMax, j, k; const char *audioDriver; SDL_AudioSpec desired; - const char *hint = SDL_GetHint(SDL_HINT_AUDIODRIVER); /* Stop SDL audio subsystem */ SDL_QuitSubSystem(SDL_INIT_AUDIO); SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_AUDIO)"); - /* Was a specific driver requested? */ - audioDriver = SDL_GetHint(SDL_HINT_AUDIODRIVER); - - if (audioDriver == NULL) { - /* Loop over all available audio drivers */ - iMax = SDL_GetNumAudioDrivers(); - SDLTest_AssertPass("Call to SDL_GetNumAudioDrivers()"); - SDLTest_AssertCheck(iMax > 0, "Validate number of audio drivers; expected: >0 got: %d", iMax); - } else { - /* A specific driver was requested for testing */ - iMax = 1; - } + /* Loop over all available audio drivers */ + iMax = SDL_GetNumAudioDrivers(); + SDLTest_AssertPass("Call to SDL_GetNumAudioDrivers()"); + SDLTest_AssertCheck(iMax > 0, "Validate number of audio drivers; expected: >0 got: %d", iMax); for (i = 0; i < iMax; i++) { - if (audioDriver == NULL) { - audioDriver = SDL_GetAudioDriver(i); - SDLTest_AssertPass("Call to SDL_GetAudioDriver(%d)", i); - SDLTest_Assert(audioDriver != NULL, "Audio driver name is not NULL"); - SDLTest_AssertCheck(audioDriver[0] != '\0', "Audio driver name is not empty; got: %s", audioDriver); /* NOLINT(clang-analyzer-core.NullDereference): Checked for NULL above */ - -#if defined(__linux__) - if (DriverIsProblematic(audioDriver)) { - SDLTest_Log("Audio driver '%s' flagged as problematic: skipping device open/close test (set SDL_AUDIODRIVER=%s to force)", audioDriver, audioDriver); - audioDriver = NULL; - continue; - } -#endif - } - - if (hint && SDL_strcmp(audioDriver, hint) != 0) { - continue; - } + audioDriver = SDL_GetAudioDriver(i); + SDLTest_AssertPass("Call to SDL_GetAudioDriver(%d)", i); + SDLTest_Assert(audioDriver != NULL, "Audio driver name is not NULL"); + SDLTest_AssertCheck(audioDriver[0] != '\0', "Audio driver name is not empty; got: %s", audioDriver); /* NOLINT(clang-analyzer-core.NullDereference): Checked for NULL above */ /* Change specs */ for (j = 0; j < 2; j++) { @@ -247,17 +163,6 @@ int audio_initOpenCloseQuitAudio() SDLTest_AssertPass("Call to SDL_AudioInit('%s')", audioDriver); SDLTest_AssertCheck(result == 0, "Validate result value; expected: 0 got: %d", result); - /* Check for output devices */ - result = SDL_GetNumAudioDevices(SDL_FALSE); - SDLTest_AssertPass("Call to SDL_GetNumAudioDevices(SDL_FALSE)"); - SDLTest_AssertCheck(result >= 0, "Validate result value; expected: >=0 got: %d", result); - if (result <= 0) { - SDLTest_Log("No output devices for '%s': skipping device open/close test", audioDriver); - SDL_AudioQuit(); - SDLTest_AssertPass("Call to SDL_AudioQuit()"); - break; - } - /* Set spec */ SDL_memset(&desired, 0, sizeof(desired)); switch (j) { @@ -302,10 +207,7 @@ int audio_initOpenCloseQuitAudio() } } /* spec loop */ - - audioDriver = NULL; - - } /* driver loop */ + } /* driver loop */ /* Restart audio again */ _audioSetUp(NULL); @@ -327,43 +229,20 @@ int audio_pauseUnpauseAudio() int originalCounter; const char *audioDriver; SDL_AudioSpec desired; - const char *hint = SDL_GetHint(SDL_HINT_AUDIODRIVER); /* Stop SDL audio subsystem */ SDL_QuitSubSystem(SDL_INIT_AUDIO); SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_AUDIO)"); - /* Was a specific driver requested? */ - audioDriver = SDL_GetHint(SDL_HINT_AUDIODRIVER); - - if (audioDriver == NULL) { - /* Loop over all available audio drivers */ - iMax = SDL_GetNumAudioDrivers(); - SDLTest_AssertPass("Call to SDL_GetNumAudioDrivers()"); - SDLTest_AssertCheck(iMax > 0, "Validate number of audio drivers; expected: >0 got: %d", iMax); - } else { - /* A specific driver was requested for testing */ - iMax = 1; - } + /* Loop over all available audio drivers */ + iMax = SDL_GetNumAudioDrivers(); + SDLTest_AssertPass("Call to SDL_GetNumAudioDrivers()"); + SDLTest_AssertCheck(iMax > 0, "Validate number of audio drivers; expected: >0 got: %d", iMax); for (i = 0; i < iMax; i++) { - if (audioDriver == NULL) { - audioDriver = SDL_GetAudioDriver(i); - SDLTest_AssertPass("Call to SDL_GetAudioDriver(%d)", i); - SDLTest_Assert(audioDriver != NULL, "Audio driver name is not NULL"); - SDLTest_AssertCheck(audioDriver[0] != '\0', "Audio driver name is not empty; got: %s", audioDriver); /* NOLINT(clang-analyzer-core.NullDereference): Checked for NULL above */ - -#if defined(__linux__) - if (DriverIsProblematic(audioDriver)) { - SDLTest_Log("Audio driver '%s' flagged as problematic: skipping pause/unpause test (set SDL_AUDIODRIVER=%s to force)", audioDriver, audioDriver); - audioDriver = NULL; - continue; - } -#endif - } - - if (hint && SDL_strcmp(audioDriver, hint) != 0) { - continue; - } + audioDriver = SDL_GetAudioDriver(i); + SDLTest_AssertPass("Call to SDL_GetAudioDriver(%d)", i); + SDLTest_Assert(audioDriver != NULL, "Audio driver name is not NULL"); + SDLTest_AssertCheck(audioDriver[0] != '\0', "Audio driver name is not empty; got: %s", audioDriver); /* NOLINT(clang-analyzer-core.NullDereference): Checked for NULL above */ /* Change specs */ for (j = 0; j < 2; j++) { @@ -373,16 +252,6 @@ int audio_pauseUnpauseAudio() SDLTest_AssertPass("Call to SDL_AudioInit('%s')", audioDriver); SDLTest_AssertCheck(result == 0, "Validate result value; expected: 0 got: %d", result); - result = SDL_GetNumAudioDevices(SDL_FALSE); - SDLTest_AssertPass("Call to SDL_GetNumAudioDevices(SDL_FALSE)"); - SDLTest_AssertCheck(result >= 0, "Validate result value; expected: >=0 got: %d", result); - if (result <= 0) { - SDLTest_Log("No output devices for '%s': skipping pause/unpause test", audioDriver); - SDL_AudioQuit(); - SDLTest_AssertPass("Call to SDL_AudioQuit()"); - break; - } - /* Set spec */ SDL_memset(&desired, 0, sizeof(desired)); switch (j) { @@ -457,10 +326,7 @@ int audio_pauseUnpauseAudio() SDLTest_AssertPass("Call to SDL_AudioQuit()"); } /* spec loop */ - - audioDriver = NULL; - - } /* driver loop */ + } /* driver loop */ /* Restart audio again */ _audioSetUp(NULL); @@ -1159,8 +1025,8 @@ int audio_resampleLoss() SDLTest_AssertPass("Test resampling of %i s %i Hz %f phase sine wave from sampling rate of %i Hz to %i Hz", spec->time, spec->freq, spec->phase, spec->rate_in, spec->rate_out); - ret = SDL_BuildAudioCVT(&cvt, AUDIO_F32SYS, 1, spec->rate_in, AUDIO_F32SYS, 1, spec->rate_out); - SDLTest_AssertPass("Call to SDL_BuildAudioCVT(&cvt, AUDIO_F32SYS, 1, %i, AUDIO_F32SYS, 1, %i)", spec->rate_in, spec->rate_out); + ret = SDL_BuildAudioCVT(&cvt, AUDIO_F32, 1, spec->rate_in, AUDIO_F32, 1, spec->rate_out); + SDLTest_AssertPass("Call to SDL_BuildAudioCVT(&cvt, AUDIO_F32, 1, %i, AUDIO_F32, 1, %i)", spec->rate_in, spec->rate_out); SDLTest_AssertCheck(ret == 1, "Expected SDL_BuildAudioCVT to succeed and conversion to be needed."); if (ret != 1) { return TEST_ABORTED; diff --git a/libs/SDL2/test/testautomation_clipboard.c b/libs/SDL2/test/testautomation_clipboard.c index ce8ea1bd3..dbe1ef8e4 100644 --- a/libs/SDL2/test/testautomation_clipboard.c +++ b/libs/SDL2/test/testautomation_clipboard.c @@ -84,7 +84,7 @@ int clipboard_testSetClipboardText(void *arg) char *textRef = SDLTest_RandomAsciiString(); char *text = SDL_strdup(textRef); int result; - result = SDL_SetClipboardText(text); + result = SDL_SetClipboardText((const char *)text); SDLTest_AssertPass("Call to SDL_SetClipboardText succeeded"); SDLTest_AssertCheck( result == 0, @@ -112,7 +112,7 @@ int clipboard_testSetPrimarySelectionText(void *arg) char *textRef = SDLTest_RandomAsciiString(); char *text = SDL_strdup(textRef); int result; - result = SDL_SetPrimarySelectionText(text); + result = SDL_SetPrimarySelectionText((const char *)text); SDLTest_AssertPass("Call to SDL_SetPrimarySelectionText succeeded"); SDLTest_AssertCheck( result == 0, @@ -149,7 +149,7 @@ int clipboard_testClipboardTextFunctions(void *arg) boolResult = SDL_HasClipboardText(); SDLTest_AssertPass("Call to SDL_HasClipboardText succeeded"); if (boolResult == SDL_TRUE) { - intResult = SDL_SetClipboardText(NULL); + intResult = SDL_SetClipboardText((const char *)NULL); SDLTest_AssertPass("Call to SDL_SetClipboardText(NULL) succeeded"); SDLTest_AssertCheck( intResult == 0, @@ -176,7 +176,7 @@ int clipboard_testClipboardTextFunctions(void *arg) charResult[0] == '\0', /* NOLINT(clang-analyzer-core.NullDereference): Checked for NULL above */ "Verify SDL_GetClipboardText returned string with length 0, got length %i", (int)SDL_strlen(charResult)); - intResult = SDL_SetClipboardText(text); + intResult = SDL_SetClipboardText((const char *)text); SDLTest_AssertPass("Call to SDL_SetClipboardText succeeded"); SDLTest_AssertCheck( intResult == 0, @@ -227,7 +227,7 @@ int clipboard_testPrimarySelectionTextFunctions(void *arg) boolResult = SDL_HasPrimarySelectionText(); SDLTest_AssertPass("Call to SDL_HasPrimarySelectionText succeeded"); if (boolResult == SDL_TRUE) { - intResult = SDL_SetPrimarySelectionText(NULL); + intResult = SDL_SetPrimarySelectionText((const char *)NULL); SDLTest_AssertPass("Call to SDL_SetPrimarySelectionText(NULL) succeeded"); SDLTest_AssertCheck( intResult == 0, @@ -254,7 +254,7 @@ int clipboard_testPrimarySelectionTextFunctions(void *arg) charResult[0] == '\0', /* NOLINT(clang-analyzer-core.NullDereference): Checked for NULL above */ "Verify SDL_GetPrimarySelectionText returned string with length 0, got length %i", (int)SDL_strlen(charResult)); - intResult = SDL_SetPrimarySelectionText(text); + intResult = SDL_SetPrimarySelectionText((const char *)text); SDLTest_AssertPass("Call to SDL_SetPrimarySelectionText succeeded"); SDLTest_AssertCheck( intResult == 0, diff --git a/libs/SDL2/test/testautomation_events.c b/libs/SDL2/test/testautomation_events.c index d4babdafc..6d0f3ff53 100644 --- a/libs/SDL2/test/testautomation_events.c +++ b/libs/SDL2/test/testautomation_events.c @@ -68,10 +68,6 @@ int events_pushPumpAndPollUserevent(void *arg) SDLTest_AssertPass("Call to SDL_PollEvent()"); SDLTest_AssertCheck(result == 1, "Check result from SDL_PollEvent, expected: 1, got: %d", result); - /* Need to finish getting all events and sentinel, otherwise other tests that rely on event are in bad state */ - while (SDL_PollEvent(&event2)) { - } - return TEST_COMPLETED; } diff --git a/libs/SDL2/test/testautomation_guid.c b/libs/SDL2/test/testautomation_guid.c index 81e60e8f4..cf99dea81 100644 --- a/libs/SDL2/test/testautomation_guid.c +++ b/libs/SDL2/test/testautomation_guid.c @@ -125,7 +125,7 @@ TestGuidToString(void *arg) SDL_GUIDToString(guid, guid_str, size); /* Check bytes before guid_str_buf */ - expected_prefix = fill_char | (fill_char << 8) | (fill_char << 16) | (((Uint32)fill_char) << 24); + expected_prefix = fill_char | (fill_char << 8) | (fill_char << 16) | (fill_char << 24); SDL_memcpy(&actual_prefix, guid_str_buf, 4); SDLTest_AssertCheck(expected_prefix == actual_prefix, "String buffer memory before output untouched, expected: %" SDL_PRIu32 ", got: %" SDL_PRIu32 ", at size=%d", expected_prefix, actual_prefix, size); diff --git a/libs/SDL2/test/testautomation_keyboard.c b/libs/SDL2/test/testautomation_keyboard.c index 5ed9207bc..0d459d0b2 100644 --- a/libs/SDL2/test/testautomation_keyboard.c +++ b/libs/SDL2/test/testautomation_keyboard.c @@ -463,34 +463,32 @@ int keyboard_setTextInputRect(void *arg) */ int keyboard_setTextInputRectNegative(void *arg) { - int platform_sets_error_message = SDL_strcmp(SDL_GetCurrentVideoDriver(), "windows") == 0 || - SDL_strcmp(SDL_GetCurrentVideoDriver(), "android") == 0 || - SDL_strcmp(SDL_GetCurrentVideoDriver(), "cococa") == 0; /* Some platforms set also an error message; prepare for checking it */ +#if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_ANDROID || SDL_VIDEO_DRIVER_COCOA const char *expectedError = "Parameter 'rect' is invalid"; const char *error; SDL_ClearError(); SDLTest_AssertPass("Call to SDL_ClearError()"); +#endif /* NULL refRect */ SDL_SetTextInputRect(NULL); SDLTest_AssertPass("Call to SDL_SetTextInputRect(NULL)"); /* Some platforms set also an error message; so check it */ - - if (platform_sets_error_message) { - error = SDL_GetError(); - SDLTest_AssertPass("Call to SDL_GetError()"); - SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL"); - if (error != NULL) { - SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0, - "Validate error message, expected: '%s', got: '%s'", expectedError, error); - } +#if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_ANDROID || SDL_VIDEO_DRIVER_COCOA + error = SDL_GetError(); + SDLTest_AssertPass("Call to SDL_GetError()"); + SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL"); + if (error != NULL) { + SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0, + "Validate error message, expected: '%s', got: '%s'", expectedError, error); } SDL_ClearError(); SDLTest_AssertPass("Call to SDL_ClearError()"); +#endif return TEST_COMPLETED; } diff --git a/libs/SDL2/test/testautomation_log.c b/libs/SDL2/test/testautomation_log.c deleted file mode 100644 index 4edb487ea..000000000 --- a/libs/SDL2/test/testautomation_log.c +++ /dev/null @@ -1,209 +0,0 @@ -/** - * Log test suite - */ -#include "SDL.h" -#include "SDL_test.h" - - -static SDL_LogOutputFunction original_function; -static void *original_userdata; - -static void SDLCALL TestLogOutput(void *userdata, int category, SDL_LogPriority priority, const char *message) -{ - int *message_count = (int *)userdata; - ++(*message_count); -} - -static void EnableTestLog(int *message_count) -{ - *message_count = 0; - SDL_LogGetOutputFunction(&original_function, &original_userdata); - SDL_LogSetOutputFunction(TestLogOutput, message_count); -} - -static void DisableTestLog() -{ - SDL_LogSetOutputFunction(original_function, original_userdata); -} - -/* Fixture */ - -/* Test case functions */ - -/** - * Check SDL_HINT_LOGGING functionality - */ -static int log_testHint(void *arg) -{ - int count; - - SDL_SetHint(SDL_HINT_LOGGING, NULL); - SDLTest_AssertPass("SDL_SetHint(SDL_HINT_LOGGING, NULL)"); - { - EnableTestLog(&count); - SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "test"); - DisableTestLog(); - SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, \"test\")"); - SDLTest_AssertCheck(count == 1, "Check result value, expected: 1, got: %d", count); - - EnableTestLog(&count); - SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_DEBUG, "test"); - DisableTestLog(); - SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_DEBUG, \"test\")"); - SDLTest_AssertCheck(count == 0, "Check result value, expected: 0, got: %d", count); - } - - SDL_SetHint(SDL_HINT_LOGGING, "debug"); - SDLTest_AssertPass("SDL_SetHint(SDL_HINT_LOGGING, \"debug\")"); - { - EnableTestLog(&count); - SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_DEBUG, "test"); - DisableTestLog(); - SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_DEBUG, \"test\")"); - SDLTest_AssertCheck(count == 1, "Check result value, expected: 1, got: %d", count); - - EnableTestLog(&count); - SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_VERBOSE, "test"); - DisableTestLog(); - SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_VERBOSE, \"test\")"); - SDLTest_AssertCheck(count == 0, "Check result value, expected: 0, got: %d", count); - } - - SDL_SetHint(SDL_HINT_LOGGING, "system=debug"); - SDLTest_AssertPass("SDL_SetHint(SDL_HINT_LOGGING, \"system=debug\")"); - { - EnableTestLog(&count); - SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_DEBUG, "test"); - DisableTestLog(); - SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_DEBUG, \"test\")"); - SDLTest_AssertCheck(count == 0, "Check result value, expected: 0, got: %d", count); - - EnableTestLog(&count); - SDL_LogMessage(SDL_LOG_CATEGORY_SYSTEM, SDL_LOG_PRIORITY_DEBUG, "test"); - DisableTestLog(); - SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_SYSTEM, SDL_LOG_PRIORITY_DEBUG, \"test\")"); - SDLTest_AssertCheck(count == 1, "Check result value, expected: 1, got: %d", count); - - EnableTestLog(&count); - SDL_LogMessage(SDL_LOG_CATEGORY_SYSTEM, SDL_LOG_PRIORITY_VERBOSE, "test"); - DisableTestLog(); - SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_SYSTEM, SDL_LOG_PRIORITY_VERBOSE, \"test\")"); - SDLTest_AssertCheck(count == 0, "Check result value, expected: 0, got: %d", count); - } - - SDL_SetHint(SDL_HINT_LOGGING, "app=warn,system=debug,assert=quiet,*=info"); - SDLTest_AssertPass("SDL_SetHint(SDL_HINT_LOGGING, \"app=warn,system=debug,assert=quiet,*=info\")"); - { - EnableTestLog(&count); - SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_WARN, "test"); - DisableTestLog(); - SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_WARN, \"test\")"); - SDLTest_AssertCheck(count == 1, "Check result value, expected: 1, got: %d", count); - - EnableTestLog(&count); - SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "test"); - DisableTestLog(); - SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, \"test\")"); - SDLTest_AssertCheck(count == 0, "Check result value, expected: 0, got: %d", count); - - EnableTestLog(&count); - SDL_LogMessage(SDL_LOG_CATEGORY_SYSTEM, SDL_LOG_PRIORITY_DEBUG, "test"); - DisableTestLog(); - SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_SYSTEM, SDL_LOG_PRIORITY_DEBUG, \"test\")"); - SDLTest_AssertCheck(count == 1, "Check result value, expected: 1, got: %d", count); - - EnableTestLog(&count); - SDL_LogMessage(SDL_LOG_CATEGORY_SYSTEM, SDL_LOG_PRIORITY_VERBOSE, "test"); - DisableTestLog(); - SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_SYSTEM, SDL_LOG_PRIORITY_VERBOSE, \"test\")"); - SDLTest_AssertCheck(count == 0, "Check result value, expected: 0, got: %d", count); - - EnableTestLog(&count); - SDL_LogMessage(SDL_LOG_CATEGORY_ASSERT, SDL_LOG_PRIORITY_CRITICAL, "test"); - DisableTestLog(); - SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_ASSERT, SDL_LOG_PRIORITY_CRITICAL, \"test\")"); - SDLTest_AssertCheck(count == 0, "Check result value, expected: 0, got: %d", count); - - EnableTestLog(&count); - SDL_LogMessage(SDL_LOG_CATEGORY_CUSTOM, SDL_LOG_PRIORITY_INFO, "test"); - DisableTestLog(); - SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_CUSTOM, SDL_LOG_PRIORITY_INFO, \"test\")"); - SDLTest_AssertCheck(count == 1, "Check result value, expected: 1, got: %d", count); - - EnableTestLog(&count); - SDL_LogMessage(SDL_LOG_CATEGORY_CUSTOM, SDL_LOG_PRIORITY_DEBUG, "test"); - DisableTestLog(); - SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_CUSTOM, SDL_LOG_PRIORITY_DEBUG, \"test\")"); - SDLTest_AssertCheck(count == 0, "Check result value, expected: 0, got: %d", count); - - } - - SDL_SetHint(SDL_HINT_LOGGING, "0=4,3=2,2=0,*=3"); - SDLTest_AssertPass("SDL_SetHint(SDL_HINT_LOGGING, \"0=4,3=2,2=0,*=3\")"); - { - EnableTestLog(&count); - SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_WARN, "test"); - DisableTestLog(); - SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_WARN, \"test\")"); - SDLTest_AssertCheck(count == 1, "Check result value, expected: 1, got: %d", count); - - EnableTestLog(&count); - SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "test"); - DisableTestLog(); - SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, \"test\")"); - SDLTest_AssertCheck(count == 0, "Check result value, expected: 0, got: %d", count); - - EnableTestLog(&count); - SDL_LogMessage(SDL_LOG_CATEGORY_SYSTEM, SDL_LOG_PRIORITY_DEBUG, "test"); - DisableTestLog(); - SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_SYSTEM, SDL_LOG_PRIORITY_DEBUG, \"test\")"); - SDLTest_AssertCheck(count == 1, "Check result value, expected: 1, got: %d", count); - - EnableTestLog(&count); - SDL_LogMessage(SDL_LOG_CATEGORY_SYSTEM, SDL_LOG_PRIORITY_VERBOSE, "test"); - DisableTestLog(); - SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_SYSTEM, SDL_LOG_PRIORITY_VERBOSE, \"test\")"); - SDLTest_AssertCheck(count == 0, "Check result value, expected: 0, got: %d", count); - - EnableTestLog(&count); - SDL_LogMessage(SDL_LOG_CATEGORY_ASSERT, SDL_LOG_PRIORITY_CRITICAL, "test"); - DisableTestLog(); - SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_ASSERT, SDL_LOG_PRIORITY_CRITICAL, \"test\")"); - SDLTest_AssertCheck(count == 0, "Check result value, expected: 0, got: %d", count); - - EnableTestLog(&count); - SDL_LogMessage(SDL_LOG_CATEGORY_CUSTOM, SDL_LOG_PRIORITY_INFO, "test"); - DisableTestLog(); - SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_CUSTOM, SDL_LOG_PRIORITY_INFO, \"test\")"); - SDLTest_AssertCheck(count == 1, "Check result value, expected: 1, got: %d", count); - - EnableTestLog(&count); - SDL_LogMessage(SDL_LOG_CATEGORY_CUSTOM, SDL_LOG_PRIORITY_DEBUG, "test"); - DisableTestLog(); - SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_CUSTOM, SDL_LOG_PRIORITY_DEBUG, \"test\")"); - SDLTest_AssertCheck(count == 0, "Check result value, expected: 0, got: %d", count); - - } - - return TEST_COMPLETED; -} - -/* ================= Test References ================== */ - -/* Log test cases */ -static const SDLTest_TestCaseReference logTestHint = { - (SDLTest_TestCaseFp)log_testHint, "log_testHint", "Check SDL_HINT_LOGGING functionality", TEST_ENABLED -}; - -/* Sequence of Log test cases */ -static const SDLTest_TestCaseReference *logTests[] = { - &logTestHint, NULL -}; - -/* Timer test suite (global) */ -SDLTest_TestSuiteReference logTestSuite = { - "Log", - NULL, - logTests, - NULL -}; diff --git a/libs/SDL2/test/testautomation_main.c b/libs/SDL2/test/testautomation_main.c index 78572d1a4..ed72e0d95 100644 --- a/libs/SDL2/test/testautomation_main.c +++ b/libs/SDL2/test/testautomation_main.c @@ -9,6 +9,34 @@ #include "SDL.h" #include "SDL_test.h" +/* ! + * \brief Tests SDL_Init() and SDL_Quit() of Joystick and Haptic subsystems + * \sa + * http://wiki.libsdl.org/SDL_Init + * http://wiki.libsdl.org/SDL_Quit + */ +static int main_testInitQuitJoystickHaptic(void *arg) +{ +#if defined SDL_JOYSTICK_DISABLED || defined SDL_HAPTIC_DISABLED + return TEST_SKIPPED; +#else + int enabled_subsystems; + int initialized_subsystems = SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC; + + SDLTest_AssertCheck(SDL_Init(initialized_subsystems) == 0, "SDL_Init multiple systems."); + + enabled_subsystems = SDL_WasInit(initialized_subsystems); + SDLTest_AssertCheck(enabled_subsystems == initialized_subsystems, "SDL_WasInit(SDL_INIT_EVERYTHING) contains all systems (%i)", enabled_subsystems); + + SDL_Quit(); + + enabled_subsystems = SDL_WasInit(initialized_subsystems); + SDLTest_AssertCheck(enabled_subsystems == 0, "SDL_Quit should shut down everything (%i)", enabled_subsystems); + + return TEST_COMPLETED; +#endif +} + /* ! * \brief Tests SDL_InitSubSystem() and SDL_QuitSubSystem() * \sa @@ -126,18 +154,22 @@ main_testSetError(void *arg) #endif static const SDLTest_TestCaseReference mainTest1 = { - (SDLTest_TestCaseFp)main_testInitQuitSubSystem, "main_testInitQuitSubSystem", "Tests SDL_InitSubSystem/QuitSubSystem", TEST_ENABLED + (SDLTest_TestCaseFp)main_testInitQuitJoystickHaptic, "main_testInitQuitJoystickHaptic", "Tests SDL_Init/Quit of Joystick and Haptic subsystem", TEST_ENABLED }; static const SDLTest_TestCaseReference mainTest2 = { - (SDLTest_TestCaseFp)main_testImpliedJoystickInit, "main_testImpliedJoystickInit", "Tests that init for gamecontroller properly implies joystick", TEST_ENABLED + (SDLTest_TestCaseFp)main_testInitQuitSubSystem, "main_testInitQuitSubSystem", "Tests SDL_InitSubSystem/QuitSubSystem", TEST_ENABLED }; static const SDLTest_TestCaseReference mainTest3 = { - (SDLTest_TestCaseFp)main_testImpliedJoystickQuit, "main_testImpliedJoystickQuit", "Tests that quit for gamecontroller doesn't quit joystick if you inited it explicitly", TEST_ENABLED + (SDLTest_TestCaseFp)main_testImpliedJoystickInit, "main_testImpliedJoystickInit", "Tests that init for gamecontroller properly implies joystick", TEST_ENABLED }; static const SDLTest_TestCaseReference mainTest4 = { + (SDLTest_TestCaseFp)main_testImpliedJoystickQuit, "main_testImpliedJoystickQuit", "Tests that quit for gamecontroller doesn't quit joystick if you inited it explicitly", TEST_ENABLED +}; + +static const SDLTest_TestCaseReference mainTest5 = { (SDLTest_TestCaseFp)main_testSetError, "main_testSetError", "Tests that SDL_SetError() handles arbitrarily large strings", TEST_ENABLED }; @@ -147,6 +179,7 @@ static const SDLTest_TestCaseReference *mainTests[] = { &mainTest2, &mainTest3, &mainTest4, + &mainTest5, NULL }; @@ -157,3 +190,5 @@ SDLTest_TestSuiteReference mainTestSuite = { mainTests, NULL }; + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/SDL2/test/testautomation_math.c b/libs/SDL2/test/testautomation_math.c index ef9b40b3d..87637c01d 100644 --- a/libs/SDL2/test/testautomation_math.c +++ b/libs/SDL2/test/testautomation_math.c @@ -49,12 +49,6 @@ typedef struct double expected; } dd_to_d; -#define DD_TO_D_CASE(IDX, X, Y, E) do { \ - cases[IDX].x_input = (X); \ - cases[IDX].y_input = (Y); \ - cases[IDX].expected = (E); \ - } while (0) - /* NB: You cannot create an array of these structures containing INFINITY or NAN. On platforms such as OS/2, they are defined as 'extern const double' making them @@ -70,10 +64,10 @@ typedef double(SDLCALL *dd_to_d_func)(double, double); * \brief Runs all the cases on a given function with a signature double -> double. * The result is expected to be exact. * - * \param func_name a printable name for the tested function. - * \param func the function to call. - * \param cases an array of all the cases. - * \param cases_size the size of the cases array. + * \param func_name, a printable name for the tested function. + * \param func, the function to call. + * \param cases, an array of all the cases. + * \param cases_size, the size of the cases array. */ static int helper_dtod(const char *func_name, d_to_d_func func, @@ -82,7 +76,7 @@ helper_dtod(const char *func_name, d_to_d_func func, Uint32 i; for (i = 0; i < cases_size; i++) { const double result = func(cases[i].input); - SDLTest_AssertCheck((result - cases[i].expected) < FLT_EPSILON, + SDLTest_AssertCheck(result == cases[i].expected, "%s(%f), expected %f, got %f", func_name, cases[i].input, @@ -96,10 +90,10 @@ helper_dtod(const char *func_name, d_to_d_func func, * \brief Runs all the cases on a given function with a signature double -> double. * Checks if the result between expected +/- EPSILON. * - * \param func_name a printable name for the tested function. - * \param func the function to call. - * \param cases an array of all the cases. - * \param cases_size the size of the cases array. + * \param func_name, a printable name for the tested function. + * \param func, the function to call. + * \param cases, an array of all the cases. + * \param cases_size, the size of the cases array. */ static int helper_dtod_inexact(const char *func_name, d_to_d_func func, @@ -108,15 +102,8 @@ helper_dtod_inexact(const char *func_name, d_to_d_func func, Uint32 i; for (i = 0; i < cases_size; i++) { const double result = func(cases[i].input); - double diff = result - cases[i].expected; - double max_err = (cases[i].expected + 1.) * EPSILON; - if (diff < 0) { - diff = -diff; - } - if (max_err < 0) { - max_err = -max_err; - } - SDLTest_AssertCheck(diff <= max_err, + SDLTest_AssertCheck(result >= cases[i].expected - EPSILON && + result <= cases[i].expected + EPSILON, "%s(%f), expected [%f,%f], got %f", func_name, cases[i].input, @@ -132,10 +119,10 @@ helper_dtod_inexact(const char *func_name, d_to_d_func func, * \brief Runs all the cases on a given function with a signature * (double, double) -> double. The result is expected to be exact. * - * \param func_name a printable name for the tested function. - * \param func the function to call. - * \param cases an array of all the cases. - * \param cases_size the size of the cases array. + * \param func_name, a printable name for the tested function. + * \param func, the function to call. + * \param cases, an array of all the cases. + * \param cases_size, the size of the cases array. */ static int helper_ddtod(const char *func_name, dd_to_d_func func, @@ -144,8 +131,6 @@ helper_ddtod(const char *func_name, dd_to_d_func func, Uint32 i; for (i = 0; i < cases_size; i++) { const double result = func(cases[i].x_input, cases[i].y_input); - /* By using the result as input, the compiler is less likely to use higher precision floating point number */ - (void)SDL_sin(result); SDLTest_AssertCheck(result == cases[i].expected, "%s(%f,%f), expected %f, got %f", func_name, @@ -160,10 +145,10 @@ helper_ddtod(const char *func_name, dd_to_d_func func, * \brief Runs all the cases on a given function with a signature * (double, double) -> double. Checks if the result between expected +/- EPSILON. * - * \param func_name a printable name for the tested function. - * \param func the function to call. - * \param cases an array of all the cases. - * \param cases_size the size of the cases array. + * \param func_name, a printable name for the tested function. + * \param func, the function to call. + * \param cases, an array of all the cases. + * \param cases_size, the size of the cases array. */ static int helper_ddtod_inexact(const char *func_name, dd_to_d_func func, @@ -172,16 +157,8 @@ helper_ddtod_inexact(const char *func_name, dd_to_d_func func, Uint32 i; for (i = 0; i < cases_size; i++) { const double result = func(cases[i].x_input, cases[i].y_input); - double diff = result - cases[i].expected; - double max_err = (cases[i].expected + 1.) * EPSILON; - if (diff < 0) { - diff = -diff; - } - if (max_err < 0) { - max_err = -max_err; - } - - SDLTest_AssertCheck(diff <= max_err, + SDLTest_AssertCheck(result >= cases[i].expected - EPSILON && + result <= cases[i].expected + EPSILON, "%s(%f,%f), expected [%f,%f], got %f", func_name, cases[i].x_input, cases[i].y_input, @@ -199,8 +176,8 @@ helper_ddtod_inexact(const char *func_name, dd_to_d_func func, * This function is only meant to test functions that returns the input value if it is * integral: f(x) -> x for x in N. * - * \param func_name a printable name for the tested function. - * \param func the function to call. + * \param func_name, a printable name for the tested function. + * \param func, the function to call. */ static int helper_range(const char *func_name, d_to_d_func func) @@ -1161,7 +1138,7 @@ log_baseCases(void *args) 1.0, 0.0, result); result = SDL_log(EULER); - SDLTest_AssertCheck((result - 1.) < FLT_EPSILON, + SDLTest_AssertCheck(1.0 == result, "Log(%f), expected %f, got %f", EULER, 1.0, result); @@ -1669,16 +1646,14 @@ static int pow_regularCases(void *args) { const dd_to_d regular_cases[] = { -#if 0 /* These tests fail when using the Mingw C runtime, we'll disable them for now */ { -391.25, -2.0, 0.00000653267870448815438463212659780943170062528224661946296691894531250 }, { -72.3, 12.0, 20401381050275984310272.0 }, -#endif { -5.0, 3.0, -125.0 }, { 3.0, 2.5, 15.58845726811989607085706666111946105957031250 }, { 39.23, -1.5, 0.0040697950366865498147972424192175822099670767784118652343750 }, { 478.972, 12.125, 315326359630449587856007411793920.0 } }; - return helper_ddtod_inexact("Pow", SDL_pow, regular_cases, SDL_arraysize(regular_cases)); + return helper_ddtod("Pow", SDL_pow, regular_cases, SDL_arraysize(regular_cases)); } /** @@ -2006,24 +1981,24 @@ static int cos_precisionTest(void *args) { const d_to_d precision_cases[] = { - { M_PI * 1.0 / 10.0, 0.9510565162951535 }, - { M_PI * 2.0 / 10.0, 0.8090169943749475 }, - { M_PI * 3.0 / 10.0, 0.5877852522924731 }, - { M_PI * 4.0 / 10.0, 0.30901699437494745 }, + { M_PI * 1.0 / 10.0, 0.9510565162 }, + { M_PI * 2.0 / 10.0, 0.8090169943 }, + { M_PI * 3.0 / 10.0, 0.5877852522 }, + { M_PI * 4.0 / 10.0, 0.3090169943 }, { M_PI * 5.0 / 10.0, 0.0 }, - { M_PI * 6.0 / 10.0, -0.30901699437494734 }, - { M_PI * 7.0 / 10.0, -0.587785252292473 }, - { M_PI * 8.0 / 10.0, -0.8090169943749473 }, - { M_PI * 9.0 / 10.0, -0.9510565162951535 }, - { M_PI * -1.0 / 10.0, 0.9510565162951535 }, - { M_PI * -2.0 / 10.0, 0.8090169943749475 }, - { M_PI * -3.0 / 10.0, 0.5877852522924731 }, - { M_PI * -4.0 / 10.0, 0.30901699437494745 }, + { M_PI * 6.0 / 10.0, -0.3090169943 }, + { M_PI * 7.0 / 10.0, -0.5877852522 }, + { M_PI * 8.0 / 10.0, -0.8090169943 }, + { M_PI * 9.0 / 10.0, -0.9510565162 }, + { M_PI * -1.0 / 10.0, 0.9510565162 }, + { M_PI * -2.0 / 10.0, 0.8090169943 }, + { M_PI * -3.0 / 10.0, 0.5877852522 }, + { M_PI * -4.0 / 10.0, 0.3090169943 }, { M_PI * -5.0 / 10.0, 0.0 }, - { M_PI * -6.0 / 10.0, -0.30901699437494734 }, - { M_PI * -7.0 / 10.0, -0.587785252292473 }, - { M_PI * -8.0 / 10.0, -0.8090169943749473 }, - { M_PI * -9.0 / 10.0, -0.9510565162951535 } + { M_PI * -6.0 / 10.0, -0.3090169943 }, + { M_PI * -7.0 / 10.0, -0.5877852522 }, + { M_PI * -8.0 / 10.0, -0.8090169943 }, + { M_PI * -9.0 / 10.0, -0.9510565162 } }; return helper_dtod_inexact("Cos", SDL_cos, precision_cases, SDL_arraysize(precision_cases)); } @@ -2124,23 +2099,23 @@ static int sin_precisionTest(void *args) { const d_to_d precision_cases[] = { - { M_PI * 1.0 / 10.0, 0.3090169943749474 }, - { M_PI * 2.0 / 10.0, 0.5877852522924731 }, - { M_PI * 3.0 / 10.0, 0.8090169943749475 }, - { M_PI * 4.0 / 10.0, 0.9510565162951535 }, - { M_PI * 6.0 / 10.0, 0.9510565162951536 }, - { M_PI * 7.0 / 10.0, 0.8090169943749475 }, - { M_PI * 8.0 / 10.0, 0.5877852522924732 }, - { M_PI * 9.0 / 10.0, 0.3090169943749475 }, + { M_PI * 1.0 / 10.0, 0.3090169943 }, + { M_PI * 2.0 / 10.0, 0.5877852522 }, + { M_PI * 3.0 / 10.0, 0.8090169943 }, + { M_PI * 4.0 / 10.0, 0.9510565162 }, + { M_PI * 6.0 / 10.0, 0.9510565162 }, + { M_PI * 7.0 / 10.0, 0.8090169943 }, + { M_PI * 8.0 / 10.0, 0.5877852522 }, + { M_PI * 9.0 / 10.0, 0.3090169943 }, { M_PI, 0.0 }, - { M_PI * -1.0 / 10.0, -0.3090169943749474 }, - { M_PI * -2.0 / 10.0, -0.5877852522924731 }, - { M_PI * -3.0 / 10.0, -0.8090169943749475 }, - { M_PI * -4.0 / 10.0, -0.9510565162951535 }, - { M_PI * -6.0 / 10.0, -0.9510565162951536 }, - { M_PI * -7.0 / 10.0, -0.8090169943749475 }, - { M_PI * -8.0 / 10.0, -0.5877852522924732 }, - { M_PI * -9.0 / 10.0, -0.3090169943749475 }, + { M_PI * -1.0 / 10.0, -0.3090169943 }, + { M_PI * -2.0 / 10.0, -0.5877852522 }, + { M_PI * -3.0 / 10.0, -0.8090169943 }, + { M_PI * -4.0 / 10.0, -0.9510565162 }, + { M_PI * -6.0 / 10.0, -0.9510565162 }, + { M_PI * -7.0 / 10.0, -0.8090169943 }, + { M_PI * -8.0 / 10.0, -0.5877852522 }, + { M_PI * -9.0 / 10.0, -0.3090169943 }, { -M_PI, 0.0 }, }; return helper_dtod_inexact("Sin", SDL_sin, precision_cases, SDL_arraysize(precision_cases)); @@ -2240,26 +2215,26 @@ static int tan_precisionTest(void *args) { const d_to_d precision_cases[] = { - { M_PI * 1.0 / 11.0, 0.29362649293836673 }, - { M_PI * 2.0 / 11.0, 0.642660977168331 }, - { M_PI * 3.0 / 11.0, 1.1540615205330094 }, - { M_PI * 4.0 / 11.0, 2.189694562989681 }, - { M_PI * 5.0 / 11.0, 6.9551527717734745 }, - { M_PI * 6.0 / 11.0, -6.955152771773481 }, - { M_PI * 7.0 / 11.0, -2.189694562989682 }, - { M_PI * 8.0 / 11.0, -1.1540615205330096 }, - { M_PI * 9.0 / 11.0, -0.6426609771683314 }, - { M_PI * 10.0 / 11.0, -0.2936264929383667 }, - { M_PI * -1.0 / 11.0, -0.29362649293836673 }, - { M_PI * -2.0 / 11.0, -0.642660977168331 }, - { M_PI * -3.0 / 11.0, -1.1540615205330094 }, - { M_PI * -4.0 / 11.0, -2.189694562989681 }, - { M_PI * -5.0 / 11.0, -6.9551527717734745 }, - { M_PI * -6.0 / 11.0, 6.955152771773481 }, - { M_PI * -7.0 / 11.0, 2.189694562989682 }, - { M_PI * -8.0 / 11.0, 1.1540615205330096 }, - { M_PI * -9.0 / 11.0, 0.6426609771683314 }, - { M_PI * -10.0 / 11.0, 0.2936264929383667 } + { M_PI * 1.0 / 11.0, 0.2936264929 }, + { M_PI * 2.0 / 11.0, 0.6426609771 }, + { M_PI * 3.0 / 11.0, 1.1540615205 }, + { M_PI * 4.0 / 11.0, 2.1896945629 }, + { M_PI * 5.0 / 11.0, 6.9551527717 }, + { M_PI * 6.0 / 11.0, -6.9551527717 }, + { M_PI * 7.0 / 11.0, -2.1896945629 }, + { M_PI * 8.0 / 11.0, -1.1540615205 }, + { M_PI * 9.0 / 11.0, -0.6426609771 }, + { M_PI * 10.0 / 11.0, -0.2936264929 }, + { M_PI * -1.0 / 11.0, -0.2936264929 }, + { M_PI * -2.0 / 11.0, -0.6426609771 }, + { M_PI * -3.0 / 11.0, -1.1540615205 }, + { M_PI * -4.0 / 11.0, -2.1896945629 }, + { M_PI * -5.0 / 11.0, -6.9551527717 }, + { M_PI * -6.0 / 11.0, 6.9551527717 }, + { M_PI * -7.0 / 11.0, 2.1896945629 }, + { M_PI * -8.0 / 11.0, 1.1540615205 }, + { M_PI * -9.0 / 11.0, 0.6426609771 }, + { M_PI * -10.0 / 11.0, 0.2936264929 } }; return helper_dtod_inexact("Tan", SDL_tan, precision_cases, SDL_arraysize(precision_cases)); } @@ -2281,7 +2256,7 @@ acos_limitCases(void *args) 1.0, 0.0, result); result = SDL_acos(-1.0); - SDLTest_AssertCheck(SDL_fabs(M_PI - result) <= EPSILON, + SDLTest_AssertCheck(M_PI == result, "Acos(%f), expected %f, got %f", -1.0, M_PI, result); @@ -2368,12 +2343,12 @@ asin_limitCases(void *args) double result; result = SDL_asin(1.0); - SDLTest_AssertCheck(SDL_fabs(M_PI / 2.0 - result) <= EPSILON, + SDLTest_AssertCheck(M_PI / 2.0 == result, "Asin(%f), expected %f, got %f", 1.0, M_PI / 2.0, result); result = SDL_asin(-1.0); - SDLTest_AssertCheck(SDL_fabs(-M_PI / 2.0 - result) <= EPSILON, + SDLTest_AssertCheck(-M_PI / 2.0 == result, "Asin(%f), expected %f, got %f", -1.0, -M_PI / 2.0, result); @@ -2424,26 +2399,26 @@ static int asin_precisionTest(void *args) { const d_to_d precision_cases[] = { - { 0.9, 1.1197695149986342 }, - { 0.8, 0.9272952180016123 }, - { 0.7, 0.775397496610753 }, - { 0.6, 0.6435011087932844 }, - { 0.5, 0.5235987755982989 }, - { 0.4, 0.41151684606748806 }, - { 0.3, 0.3046926540153976 }, - { 0.2, 0.20135792079033074 }, - { 0.1, 0.10016742116155977 }, + { 0.9, 1.1197695149 }, + { 0.8, 0.9272952180 }, + { 0.7, 0.7753974966 }, + { 0.6, 0.6435011087 }, + { 0.5, 0.5235987755 }, + { 0.4, 0.4115168460 }, + { 0.3, 0.3046926540 }, + { 0.2, 0.2013579207 }, + { 0.1, 0.1001674211 }, { 0.0, 0.0 }, { -0.0, -0.0 }, - { -0.1, -0.10016742116155977 }, - { -0.2, -0.20135792079033074 }, - { -0.3, -0.3046926540153976 }, - { -0.4, -0.41151684606748806 }, - { -0.5, -0.5235987755982989 }, - { -0.6, -0.6435011087932844 }, - { -0.7, -0.775397496610753 }, - { -0.8, -0.9272952180016123 }, - { -0.9, -1.1197695149986342 } + { -0.1, -0.1001674211 }, + { -0.2, -0.2013579207 }, + { -0.3, -0.3046926540 }, + { -0.4, -0.4115168460 }, + { -0.5, -0.5235987755 }, + { -0.6, -0.6435011087 }, + { -0.7, -0.7753974966 }, + { -0.8, -0.9272952180 }, + { -0.9, -1.1197695149 } }; return helper_dtod_inexact("Asin", SDL_asin, precision_cases, SDL_arraysize(precision_cases)); } @@ -2518,24 +2493,24 @@ static int atan_precisionTest(void *args) { const d_to_d precision_cases[] = { - { 6.313751514675041, 1.413716694115407 }, - { 3.0776835371752527, 1.2566370614359172 }, - { 1.9626105055051504, 1.0995574287564276 }, - { 1.3763819204711734, 0.9424777960769379 }, - { 1.0, 0.7853981633974483 }, - { 0.7265425280053609, 0.6283185307179586 }, - { 0.5095254494944288, 0.47123889803846897 }, - { 0.3249196962329063, 0.3141592653589793 }, - { 0.15838444032453627, 0.15707963267948966 }, - { -0.15838444032453627, -0.15707963267948966 }, - { -0.3249196962329063, -0.3141592653589793 }, - { -0.5095254494944288, -0.47123889803846897 }, - { -0.7265425280053609, -0.6283185307179586 }, - { -1.0, -0.7853981633974483 }, - { -1.3763819204711734, -0.9424777960769379 }, - { -1.9626105055051504, -1.0995574287564276 }, - { -3.0776835371752527, -1.2566370614359172 }, - { -6.313751514675041, -1.413716694115407 }, + { 6.313751514675041, 1.4137166941 }, + { 3.0776835371752527, 1.2566370614 }, + { 1.9626105055051504, 1.0995574287 }, + { 1.3763819204711734, 0.9424777960 }, + { 1.0, 0.7853981633 }, + { 0.7265425280053609, 0.6283185307 }, + { 0.5095254494944288, 0.4712388980 }, + { 0.3249196962329063, 0.3141592653 }, + { 0.15838444032453627, 0.1570796326 }, + { -0.15838444032453627, -0.1570796326 }, + { -0.3249196962329063, -0.3141592653 }, + { -0.5095254494944288, -0.4712388980 }, + { -0.7265425280053609, -0.6283185307 }, + { -1.0, -0.7853981633 }, + { -1.3763819204711734, -0.9424777960 }, + { -1.9626105055051504, -1.0995574287 }, + { -3.0776835371752527, -1.2566370614 }, + { -6.313751514675041, -1.4137166941 }, }; return helper_dtod_inexact("Atan", SDL_atan, precision_cases, SDL_arraysize(precision_cases)); } @@ -2560,7 +2535,7 @@ atan2_bothZeroCases(void *args) { 0.0, -0.0, M_PI }, { -0.0, -0.0, -M_PI }, }; - return helper_ddtod_inexact("SDL_atan2", SDL_atan2, cases, SDL_arraysize(cases)); + return helper_ddtod("SDL_atan2", SDL_atan2, cases, SDL_arraysize(cases)); } /** @@ -2579,7 +2554,7 @@ atan2_yZeroCases(void *args) { -0.0, 1.0, -0.0 }, { -0.0, -1.0, -M_PI } }; - return helper_ddtod_inexact("SDL_atan2", SDL_atan2, cases, SDL_arraysize(cases)); + return helper_ddtod("SDL_atan2", SDL_atan2, cases, SDL_arraysize(cases)); } /** @@ -2595,7 +2570,7 @@ atan2_xZeroCases(void *args) { 1.0, -0.0, M_PI / 2.0 }, { -1.0, -0.0, -M_PI / 2.0 } }; - return helper_ddtod_inexact("SDL_atan2", SDL_atan2, cases, SDL_arraysize(cases)); + return helper_ddtod("SDL_atan2", SDL_atan2, cases, SDL_arraysize(cases)); } /* Infinity cases */ @@ -2611,12 +2586,29 @@ atan2_xZeroCases(void *args) static int atan2_bothInfCases(void *args) { - dd_to_d cases[4]; - DD_TO_D_CASE(0, INFINITY, INFINITY, 1.0 * M_PI / 4.0); - DD_TO_D_CASE(1, INFINITY, -INFINITY, 3.0 * M_PI / 4.0); - DD_TO_D_CASE(2, -INFINITY, INFINITY, -1.0 * M_PI / 4.0); - DD_TO_D_CASE(3, -INFINITY, -INFINITY, -3.0 * M_PI / 4.0); - return helper_ddtod("SDL_atan2(bothInfCases)", SDL_atan2, cases, SDL_arraysize(cases)); + double result; + + result = SDL_atan2(INFINITY, INFINITY); + SDLTest_AssertCheck(M_PI / 4.0 == result, + "Atan2(%f,%f), expected %f, got %f", + INFINITY, INFINITY, M_PI / 4.0, result); + + result = SDL_atan2(INFINITY, -INFINITY); + SDLTest_AssertCheck(3.0 * M_PI / 4.0 == result, + "Atan2(%f,%f), expected %f, got %f", + INFINITY, -INFINITY, 3.0 * M_PI / 4.0, result); + + result = SDL_atan2(-INFINITY, INFINITY); + SDLTest_AssertCheck(-M_PI / 4.0 == result, + "Atan2(%f,%f), expected %f, got %f", + -INFINITY, INFINITY, -M_PI / 4.0, result); + + result = SDL_atan2(-INFINITY, -INFINITY); + SDLTest_AssertCheck(-3.0 * M_PI / 4.0 == result, + "Atan2(%f,%f), expected %f, got %f", + -INFINITY, -INFINITY, -3.0 * M_PI / 4.0, result); + + return TEST_COMPLETED; } /** @@ -2626,12 +2618,29 @@ atan2_bothInfCases(void *args) static int atan2_yInfCases(void *args) { - dd_to_d cases[4]; - DD_TO_D_CASE(0, INFINITY, 1.0, 1.0 * M_PI / 2.0); - DD_TO_D_CASE(1, INFINITY, -1.0, 1.0 * M_PI / 2.0); - DD_TO_D_CASE(2, -INFINITY, 1.0, -1.0 * M_PI / 2.0); - DD_TO_D_CASE(3, -INFINITY, -1.0, -1.0 * M_PI / 2.0); - return helper_ddtod("SDL_atan2(atan2_yInfCases)", SDL_atan2, cases, SDL_arraysize(cases)); + double result; + + result = SDL_atan2(INFINITY, 1.0); + SDLTest_AssertCheck(M_PI / 2.0 == result, + "Atan2(%f,%f), expected %f, got %f", + INFINITY, 1.0, M_PI / 2.0, result); + + result = SDL_atan2(INFINITY, -1.0); + SDLTest_AssertCheck(M_PI / 2.0 == result, + "Atan2(%f,%f), expected %f, got %f", + INFINITY, -1.0, M_PI / 2.0, result); + + result = SDL_atan2(-INFINITY, 1.0); + SDLTest_AssertCheck(-M_PI / 2.0 == result, + "Atan2(%f,%f), expected %f, got %f", + -INFINITY, 1.0, -M_PI / 2.0, result); + + result = SDL_atan2(-INFINITY, -1.0); + SDLTest_AssertCheck(-M_PI / 2.0 == result, + "Atan2(%f,%f), expected %f, got %f", + -INFINITY, -1.0, -M_PI / 2.0, result); + + return TEST_COMPLETED; } /** @@ -2643,12 +2652,29 @@ atan2_yInfCases(void *args) static int atan2_xInfCases(void *args) { - dd_to_d cases[4]; - DD_TO_D_CASE(0, 1.0, INFINITY, 0.0); - DD_TO_D_CASE(1, -1.0, INFINITY, -0.0); - DD_TO_D_CASE(2, 1.0, -INFINITY, M_PI); - DD_TO_D_CASE(3, -1.0, -INFINITY, -M_PI); - return helper_ddtod("atan2_xInfCases(atan2_yInfCases)", SDL_atan2, cases, SDL_arraysize(cases)); + double result; + + result = SDL_atan2(1.0, INFINITY); + SDLTest_AssertCheck(0.0 == result, + "Atan2(%f,%f), expected %f, got %f", + 1.0, INFINITY, 0.0, result); + + result = SDL_atan2(-1.0, INFINITY); + SDLTest_AssertCheck(-0.0 == result, + "Atan2(%f,%f), expected %f, got %f", + -1.0, INFINITY, -0.0, result); + + result = SDL_atan2(1.0, -INFINITY); + SDLTest_AssertCheck(M_PI == result, + "Atan2(%f,%f), expected %f, got %f", + 1.0, -INFINITY, M_PI, result); + + result = SDL_atan2(-1.0, -INFINITY); + SDLTest_AssertCheck(-M_PI == result, + "Atan2(%f,%f), expected %f, got %f", + -1.0, -INFINITY, -M_PI, result); + + return TEST_COMPLETED; } /* Miscelanious cases */ diff --git a/libs/SDL2/test/testautomation_mouse.c b/libs/SDL2/test/testautomation_mouse.c index 19b1a9f58..22a437801 100644 --- a/libs/SDL2/test/testautomation_mouse.c +++ b/libs/SDL2/test/testautomation_mouse.c @@ -423,7 +423,7 @@ SDL_Window *_createMouseSuiteTestWindow() */ void _destroyMouseSuiteTestWindow(SDL_Window *window) { - if (window) { + if (window != NULL) { SDL_DestroyWindow(window); window = NULL; SDLTest_AssertPass("SDL_DestroyWindow()"); @@ -458,7 +458,7 @@ int mouse_warpMouseInWindow(void *arg) yPositions[5] = h + 1; /* Create test window */ window = _createMouseSuiteTestWindow(); - if (!window) { + if (window == NULL) { return TEST_ABORTED; } @@ -503,7 +503,6 @@ int mouse_getMouseFocus(void *arg) int x, y; SDL_Window *window; SDL_Window *focusWindow; - const SDL_bool video_driver_is_wayland = !SDL_strcmp(SDL_GetCurrentVideoDriver(), "wayland"); /* Get focus - focus non-deterministic */ focusWindow = SDL_GetMouseFocus(); @@ -511,37 +510,32 @@ int mouse_getMouseFocus(void *arg) /* Create test window */ window = _createMouseSuiteTestWindow(); - if (!window) { + if (window == NULL) { return TEST_ABORTED; } - /* Wayland explicitly disallows warping the mouse pointer, so this test must be skipped. */ - if (!video_driver_is_wayland) { - /* Mouse to random position inside window */ - x = SDLTest_RandomIntegerInRange(1, w - 1); - y = SDLTest_RandomIntegerInRange(1, h - 1); - SDL_WarpMouseInWindow(window, x, y); - SDLTest_AssertPass("SDL_WarpMouseInWindow(...,%i,%i)", x, y); + /* Mouse to random position inside window */ + x = SDLTest_RandomIntegerInRange(1, w - 1); + y = SDLTest_RandomIntegerInRange(1, h - 1); + SDL_WarpMouseInWindow(window, x, y); + SDLTest_AssertPass("SDL_WarpMouseInWindow(...,%i,%i)", x, y); - /* Pump events to update focus state */ - SDL_Delay(100); - SDL_PumpEvents(); - SDLTest_AssertPass("SDL_PumpEvents()"); + /* Pump events to update focus state */ + SDL_Delay(100); + SDL_PumpEvents(); + SDLTest_AssertPass("SDL_PumpEvents()"); - /* Get focus with explicit window setup - focus deterministic */ - focusWindow = SDL_GetMouseFocus(); - SDLTest_AssertPass("SDL_GetMouseFocus()"); - SDLTest_AssertCheck(focusWindow != NULL, "Check returned window value is not NULL"); - SDLTest_AssertCheck(focusWindow == window, "Check returned window value is test window"); + /* Get focus with explicit window setup - focus deterministic */ + focusWindow = SDL_GetMouseFocus(); + SDLTest_AssertPass("SDL_GetMouseFocus()"); + SDLTest_AssertCheck(focusWindow != NULL, "Check returned window value is not NULL"); + SDLTest_AssertCheck(focusWindow == window, "Check returned window value is test window"); - /* Mouse to random position outside window */ - x = SDLTest_RandomIntegerInRange(-9, -1); - y = SDLTest_RandomIntegerInRange(-9, -1); - SDL_WarpMouseInWindow(window, x, y); - SDLTest_AssertPass("SDL_WarpMouseInWindow(...,%i,%i)", x, y); - } else { - SDLTest_Log("Skipping mouse warp focus tests: Wayland does not support warping the mouse pointer"); - } + /* Mouse to random position outside window */ + x = SDLTest_RandomIntegerInRange(-9, -1); + y = SDLTest_RandomIntegerInRange(-9, -1); + SDL_WarpMouseInWindow(window, x, y); + SDLTest_AssertPass("SDL_WarpMouseInWindow(...,%i,%i)", x, y); /* Clean up test window */ _destroyMouseSuiteTestWindow(window); diff --git a/libs/SDL2/test/testautomation_pixels.c b/libs/SDL2/test/testautomation_pixels.c index 12cf63249..d5440e5b4 100644 --- a/libs/SDL2/test/testautomation_pixels.c +++ b/libs/SDL2/test/testautomation_pixels.c @@ -14,8 +14,6 @@ const int _numRGBPixelFormats = 31; Uint32 _RGBPixelFormats[] = { SDL_PIXELFORMAT_INDEX1LSB, SDL_PIXELFORMAT_INDEX1MSB, - SDL_PIXELFORMAT_INDEX2LSB, - SDL_PIXELFORMAT_INDEX2MSB, SDL_PIXELFORMAT_INDEX4LSB, SDL_PIXELFORMAT_INDEX4MSB, SDL_PIXELFORMAT_INDEX8, @@ -49,8 +47,6 @@ Uint32 _RGBPixelFormats[] = { const char *_RGBPixelFormatsVerbose[] = { "SDL_PIXELFORMAT_INDEX1LSB", "SDL_PIXELFORMAT_INDEX1MSB", - "SDL_PIXELFORMAT_INDEX2LSB", - "SDL_PIXELFORMAT_INDEX2MSB", "SDL_PIXELFORMAT_INDEX4LSB", "SDL_PIXELFORMAT_INDEX4MSB", "SDL_PIXELFORMAT_INDEX8", diff --git a/libs/SDL2/test/testautomation_platform.c b/libs/SDL2/test/testautomation_platform.c index bd2aabed6..ac85eef23 100644 --- a/libs/SDL2/test/testautomation_platform.c +++ b/libs/SDL2/test/testautomation_platform.c @@ -386,7 +386,7 @@ int platform_testSetErrorEmptyInput(void *arg) int platform_testSetErrorInvalidInput(void *arg) { int result; - const char *invalidError = ""; + const char *invalidError = NULL; const char *probeError = "Testing"; char *lastError; size_t len; diff --git a/libs/SDL2/test/testautomation_render.c b/libs/SDL2/test/testautomation_render.c index 45198a826..74b963146 100644 --- a/libs/SDL2/test/testautomation_render.c +++ b/libs/SDL2/test/testautomation_render.c @@ -43,7 +43,6 @@ static int _isSupported(int code); void InitCreateRenderer(void *arg) { int posX = 100, posY = 100, width = 320, height = 240; - int renderer_flags = SDL_RENDERER_ACCELERATED; renderer = NULL; window = SDL_CreateWindow("render_testCreateRenderer", posX, posY, width, height, 0); SDLTest_AssertPass("SDL_CreateWindow()"); @@ -52,11 +51,7 @@ void InitCreateRenderer(void *arg) return; } - if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "dummy") == 0) { - renderer_flags = 0; - } - - renderer = SDL_CreateRenderer(window, -1, renderer_flags); + renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED); SDLTest_AssertPass("SDL_CreateRenderer()"); SDLTest_AssertCheck(renderer != NULL, "Check SDL_CreateRenderer result"); if (renderer == NULL) { @@ -70,13 +65,13 @@ void InitCreateRenderer(void *arg) */ void CleanupDestroyRenderer(void *arg) { - if (renderer) { + if (renderer != NULL) { SDL_DestroyRenderer(renderer); renderer = NULL; SDLTest_AssertPass("SDL_DestroyRenderer()"); } - if (window) { + if (window != NULL) { SDL_DestroyWindow(window); window = NULL; SDLTest_AssertPass("SDL_DestroyWindow"); @@ -943,12 +938,12 @@ _loadTestFace(void) SDL_Texture *tface; face = SDLTest_ImageFace(); - if (!face) { + if (face == NULL) { return NULL; } tface = SDL_CreateTextureFromSurface(renderer, face); - if (!tface) { + if (tface == NULL) { SDLTest_LogError("SDL_CreateTextureFromSurface() failed with error: %s", SDL_GetError()); } @@ -975,7 +970,7 @@ _hasTexColor(void) /* Get test face. */ tface = _loadTestFace(); - if (!tface) { + if (tface == NULL) { return 0; } @@ -1019,7 +1014,7 @@ _hasTexAlpha(void) /* Get test face. */ tface = _loadTestFace(); - if (!tface) { + if (tface == NULL) { return 0; } @@ -1048,7 +1043,7 @@ _hasTexAlpha(void) /** * @brief Compares screen pixels with image pixels. Helper function. * - * @param referenceSurface Image to compare against. + * @param s Image to compare against. * * \sa * http://wiki.libsdl.org/SDL_RenderReadPixels diff --git a/libs/SDL2/test/testautomation_stdlib.c b/libs/SDL2/test/testautomation_stdlib.c index ed9f13ea3..a75e4570b 100644 --- a/libs/SDL2/test/testautomation_stdlib.c +++ b/libs/SDL2/test/testautomation_stdlib.c @@ -53,7 +53,7 @@ int stdlib_snprintf(void *arg) int result; int predicted; char text[1024]; - const char *expected, *expected2, *expected3, *expected4, *expected5; + const char *expected; size_t size; result = SDL_snprintf(text, sizeof(text), "%s", "foo"); @@ -175,61 +175,6 @@ int stdlib_snprintf(void *arg) SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: '%s', got: '%s'", expected, text); SDLTest_AssertCheck(result == 7, "Check result value, expected: 7, got: %d", result); - result = SDL_snprintf(text, sizeof(text), "%p", (void *)0x1234abcd); - expected = "0x1234abcd"; - expected2 = "1234ABCD"; - expected3 = "000000001234ABCD"; - expected4 = "1234abcd"; - expected5 = "000000001234abcd"; - SDLTest_AssertPass("Call to SDL_snprintf(text, sizeof(text), \"%%p\", 0x1234abcd)"); - SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0 || - SDL_strcmp(text, expected2) == 0 || - SDL_strcmp(text, expected3) == 0 || - SDL_strcmp(text, expected4) == 0 || - SDL_strcmp(text, expected5) == 0, - "Check text, expected: '%s', got: '%s'", expected, text); - SDLTest_AssertCheck(result == SDL_strlen(expected) || - result == SDL_strlen(expected2) || - result == SDL_strlen(expected3) || - result == SDL_strlen(expected4) || - result == SDL_strlen(expected5), - "Check result value, expected: %d, got: %d", (int)SDL_strlen(expected), result); - - result = SDL_snprintf(text, sizeof(text), "A %p B", (void *)0x1234abcd); - expected = "A 0x1234abcd B"; - expected2 = "A 1234ABCD B"; - expected3 = "A 000000001234ABCD B"; - expected4 = "A 1234abcd B"; - expected5 = "A 000000001234abcd B"; - SDLTest_AssertPass("Call to SDL_snprintf(text, sizeof(text), \"A %%p B\", 0x1234abcd)"); - SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0 || - SDL_strcmp(text, expected2) == 0 || - SDL_strcmp(text, expected3) == 0 || - SDL_strcmp(text, expected4) == 0 || - SDL_strcmp(text, expected5) == 0, - "Check text, expected: '%s', got: '%s'", expected, text); - SDLTest_AssertCheck(result == SDL_strlen(expected) || - result == SDL_strlen(expected2) || - result == SDL_strlen(expected3) || - result == SDL_strlen(expected4) || - result == SDL_strlen(expected5), - "Check result value, expected: %d, got: %d", (int)SDL_strlen(expected), result); - - if (sizeof(void *) >= 8) { - result = SDL_snprintf(text, sizeof(text), "%p", (void *)0x1ba07bddf60L); - expected = "0x1ba07bddf60"; - expected2 = "000001BA07BDDF60"; - expected3 = "000001ba07bddf60"; - SDLTest_AssertPass("Call to SDL_snprintf(text, sizeof(text), \"%%p\", 0x1ba07bddf60)"); - SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0 || - SDL_strcmp(text, expected2) == 0 || - SDL_strcmp(text, expected3) == 0, - "Check text, expected: '%s', got: '%s'", expected, text); - SDLTest_AssertCheck(result == SDL_strlen(expected) || - result == SDL_strlen(expected2) || - result == SDL_strlen(expected3), - "Check result value, expected: %d, got: %d", (int)SDL_strlen(expected), result); - } return TEST_COMPLETED; } @@ -262,10 +207,10 @@ int stdlib_getsetenv(void *arg) text = SDL_getenv(name); SDLTest_AssertPass("Call to SDL_getenv('%s')", name); - if (text) { + if (text != NULL) { SDLTest_Log("Expected: NULL, Got: '%s' (%i)", text, (int)SDL_strlen(text)); } - } while (text); + } while (text != NULL); /* Create random values to set */ value1 = SDLTest_RandomAsciiStringOfSize(10); diff --git a/libs/SDL2/test/testautomation_subsystems.c b/libs/SDL2/test/testautomation_subsystems.c deleted file mode 100644 index d25edeeb7..000000000 --- a/libs/SDL2/test/testautomation_subsystems.c +++ /dev/null @@ -1,239 +0,0 @@ -/** - * Subsystem test suite - */ - -#include "SDL.h" -#include "SDL_test.h" - -/* ================= Test Case Implementation ================== */ - -/* Fixture */ - -static void subsystemsSetUp(void *arg) -{ - /* Reset each one of the SDL subsystems */ - /* CHECKME: can we use SDL_Quit here, or this will break the flow of tests? */ - SDL_Quit(); - /* Alternate variant without SDL_Quit: - while (SDL_WasInit(SDL_INIT_EVERYTHING) != 0) { - SDL_QuitSubSystem(SDL_INIT_EVERYTHING); - } - */ - SDLTest_AssertPass("Reset all subsystems before subsystems test"); - SDLTest_AssertCheck(SDL_WasInit(SDL_INIT_EVERYTHING) == 0, "Check result from SDL_WasInit(SDL_INIT_EVERYTHING)"); -} - -static void subsystemsTearDown(void *arg) -{ - /* Reset each one of the SDL subsystems */ - SDL_Quit(); - - SDLTest_AssertPass("Cleanup of subsystems test completed"); -} - -/* Test case functions */ - -/** - * \brief Inits and Quits particular subsystem, checking its Init status. - * - * \sa SDL_InitSubSystem - * \sa SDL_QuitSubSystem - * - */ -static int subsystems_referenceCount() -{ - const int system = SDL_INIT_VIDEO; - int result; - /* Ensure that we start with a non-initialized subsystem. */ - SDLTest_AssertCheck(SDL_WasInit(system) == 0, "Check result from SDL_WasInit(0x%x)", system); - - /* Init subsystem once, and quit once */ - SDL_InitSubSystem(system); - SDLTest_AssertPass("Call to SDL_InitSubSystem(0x%x)", system); - result = SDL_WasInit(system); - SDLTest_AssertCheck(result == system, "Check result from SDL_WasInit(0x%x), expected: 0x%x, got: 0x%x", system, system, result); - - SDL_QuitSubSystem(system); - SDLTest_AssertPass("Call to SDL_QuitSubSystem(0x%x)", system); - result = SDL_WasInit(system); - SDLTest_AssertCheck(result == 0, "Check result from SDL_WasInit(0x%x), expected: 0, got: 0x%x", system, result); - - /* Init subsystem number of times, then decrement reference count until it's disposed of. */ - SDL_InitSubSystem(system); - SDL_InitSubSystem(system); - SDL_InitSubSystem(system); - SDLTest_AssertPass("Call to SDL_InitSubSystem(0x%x) x3 times", system); - result = SDL_WasInit(system); - SDLTest_AssertCheck(result == system, "Check result from SDL_WasInit(0x%x), expected: 0x%x, got: 0x%x", system, system, result); - - SDL_QuitSubSystem(system); - SDLTest_AssertPass("Call to SDL_QuitSubSystem(0x%x) x1", system); - result = SDL_WasInit(system); - SDLTest_AssertCheck(result == system, "Check result from SDL_WasInit(0x%x), expected: 0x%x, got: 0x%x", system, system, result); - SDL_QuitSubSystem(system); - SDLTest_AssertPass("Call to SDL_QuitSubSystem(0x%x) x2", system); - result = SDL_WasInit(system); - SDLTest_AssertCheck(result == system, "Check result from SDL_WasInit(0x%x), expected: 0x%x, got: 0x%x", system, system, result); - SDL_QuitSubSystem(system); - SDLTest_AssertPass("Call to SDL_QuitSubSystem(0x%x) x3", system); - result = SDL_WasInit(system); - SDLTest_AssertCheck(result == 0, "Check result from SDL_WasInit(0x%x), expected: 0, got: 0x%x", system, result); - - return TEST_COMPLETED; -} - -/** - * \brief Inits and Quits subsystems that have another as dependency; - * check that the dependency is not removed before the last of its dependents. - * - * \sa SDL_InitSubSystem - * \sa SDL_QuitSubSystem - * - */ -static int subsystems_dependRefCountInitAllQuitByOne() -{ - int result; - /* Ensure that we start with reset subsystems. */ - SDLTest_AssertCheck(SDL_WasInit(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK | SDL_INIT_EVENTS) == 0, - "Check result from SDL_WasInit(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK | SDL_INIT_EVENTS)"); - - /* Following should init SDL_INIT_EVENTS and give it +3 ref counts. */ - SDL_InitSubSystem(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK); - SDLTest_AssertPass("Call to SDL_InitSubSystem(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK)"); - result = SDL_WasInit(SDL_INIT_EVENTS); - SDLTest_AssertCheck(result == SDL_INIT_EVENTS, "Check result from SDL_WasInit(SDL_INIT_EVENTS), expected: 0x4000, got: 0x%x", result); - - /* Quit systems one by one. */ - SDL_QuitSubSystem(SDL_INIT_VIDEO); - SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_VIDEO)"); - result = SDL_WasInit(SDL_INIT_EVENTS); - SDLTest_AssertCheck(result == SDL_INIT_EVENTS, "Check result from SDL_WasInit(SDL_INIT_EVENTS), expected: 0x4000, got: 0x%x", result); - SDL_QuitSubSystem(SDL_INIT_AUDIO); - SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_AUDIO)"); - result = SDL_WasInit(SDL_INIT_EVENTS); - SDLTest_AssertCheck(result == SDL_INIT_EVENTS, "Check result from SDL_WasInit(SDL_INIT_EVENTS), expected: 0x4000, got: 0x%x", result); - SDL_QuitSubSystem(SDL_INIT_JOYSTICK); - SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_JOYSTICK)"); - result = SDL_WasInit(SDL_INIT_EVENTS); - SDLTest_AssertCheck(result == 0, "Check result from SDL_WasInit(SDL_INIT_EVENTS), expected: 0, got: 0x%x", result); - - return TEST_COMPLETED; -} - -/** - * \brief Inits and Quits subsystems that have another as dependency; - * check that the dependency is not removed before the last of its dependents. - * - * \sa SDL_InitSubSystem - * \sa SDL_QuitSubSystem - * - */ -static int subsystems_dependRefCountInitByOneQuitAll() -{ - int result; - /* Ensure that we start with reset subsystems. */ - SDLTest_AssertCheck(SDL_WasInit(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK | SDL_INIT_EVENTS) == 0, - "Check result from SDL_WasInit(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK | SDL_INIT_EVENTS)"); - - /* Following should init SDL_INIT_EVENTS and give it +3 ref counts. */ - SDL_InitSubSystem(SDL_INIT_VIDEO); - SDLTest_AssertPass("Call to SDL_InitSubSystem(SDL_INIT_VIDEO)"); - result = SDL_WasInit(SDL_INIT_EVENTS); - SDLTest_AssertCheck(result == SDL_INIT_EVENTS, "Check result from SDL_WasInit(SDL_INIT_EVENTS), expected: 0x4000, got: 0x%x", result); - SDL_InitSubSystem(SDL_INIT_AUDIO); - SDLTest_AssertPass("Call to SDL_InitSubSystem(SDL_INIT_AUDIO)"); - SDL_InitSubSystem(SDL_INIT_JOYSTICK); - SDLTest_AssertPass("Call to SDL_InitSubSystem(SDL_INIT_JOYSTICK)"); - - /* Quit systems all at once. */ - SDL_QuitSubSystem(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK); - SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK)"); - result = SDL_WasInit(SDL_INIT_EVENTS); - SDLTest_AssertCheck(result == 0, "Check result from SDL_WasInit(SDL_INIT_EVENTS), expected: 0, got: 0x%x", result); - - return TEST_COMPLETED; -} - -/** - * \brief Inits and Quits subsystems that have another as dependency, - * but also inits that dependency explicitly, giving it extra ref count. - * Check that the dependency is not removed before the last reference is gone. - * - * \sa SDL_InitSubSystem - * \sa SDL_QuitSubSystem - * - */ -static int subsystems_dependRefCountWithExtraInit() -{ - int result; - /* Ensure that we start with reset subsystems. */ - SDLTest_AssertCheck(SDL_WasInit(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK | SDL_INIT_EVENTS) == 0, - "Check result from SDL_WasInit(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK | SDL_INIT_EVENTS)"); - - /* Init EVENTS explicitly, +1 ref count. */ - SDL_InitSubSystem(SDL_INIT_EVENTS); - SDLTest_AssertPass("Call to SDL_InitSubSystem(SDL_INIT_EVENTS)"); - result = SDL_WasInit(SDL_INIT_EVENTS); - SDLTest_AssertCheck(result == SDL_INIT_EVENTS, "Check result from SDL_WasInit(SDL_INIT_EVENTS), expected: 0x4000, got: 0x%x", result); - /* Following should init SDL_INIT_EVENTS and give it +3 ref counts. */ - SDL_InitSubSystem(SDL_INIT_VIDEO); - SDLTest_AssertPass("Call to SDL_InitSubSystem(SDL_INIT_VIDEO)"); - SDL_InitSubSystem(SDL_INIT_AUDIO); - SDLTest_AssertPass("Call to SDL_InitSubSystem(SDL_INIT_AUDIO)"); - SDL_InitSubSystem(SDL_INIT_JOYSTICK); - SDLTest_AssertPass("Call to SDL_InitSubSystem(SDL_INIT_JOYSTICK)"); - - /* Quit EVENTS explicitly, -1 ref count. */ - SDL_QuitSubSystem(SDL_INIT_EVENTS); - SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_EVENTS)"); - result = SDL_WasInit(SDL_INIT_EVENTS); - SDLTest_AssertCheck(result == SDL_INIT_EVENTS, "Check result from SDL_WasInit(SDL_INIT_EVENTS), expected: 0x4000, got: 0x%x", result); - - /* Quit systems one by one. */ - SDL_QuitSubSystem(SDL_INIT_VIDEO); - SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_VIDEO)"); - result = SDL_WasInit(SDL_INIT_EVENTS); - SDLTest_AssertCheck(result == SDL_INIT_EVENTS, "Check result from SDL_WasInit(SDL_INIT_EVENTS), expected: 0x4000, got: 0x%x", result); - SDL_QuitSubSystem(SDL_INIT_AUDIO); - SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_AUDIO)"); - result = SDL_WasInit(SDL_INIT_EVENTS); - SDLTest_AssertCheck(result == SDL_INIT_EVENTS, "Check result from SDL_WasInit(SDL_INIT_EVENTS), expected: 0x4000, got: 0x%x", result); - SDL_QuitSubSystem(SDL_INIT_JOYSTICK); - SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_JOYSTICK)"); - result = SDL_WasInit(SDL_INIT_EVENTS); - SDLTest_AssertCheck(result == 0, "Check result from SDL_WasInit(SDL_INIT_EVENTS), expected: 0, got: 0x%x", result); - - return TEST_COMPLETED; -} - -/* ================= Test References ================== */ - -/* Subsystems test cases */ -static const SDLTest_TestCaseReference subsystemsTest1 = { - (SDLTest_TestCaseFp)subsystems_referenceCount, "subsystems_referenceCount", "Makes sure that subsystem stays until number of quits matches inits.", TEST_ENABLED -}; - -static const SDLTest_TestCaseReference subsystemsTest2 = { - (SDLTest_TestCaseFp)subsystems_dependRefCountInitAllQuitByOne, "subsystems_dependRefCountInitAllQuitByOne", "Check reference count of subsystem dependencies.", TEST_ENABLED -}; - -static const SDLTest_TestCaseReference subsystemsTest3 = { - (SDLTest_TestCaseFp)subsystems_dependRefCountInitByOneQuitAll, "subsystems_dependRefCountInitByOneQuitAll", "Check reference count of subsystem dependencies.", TEST_ENABLED -}; - -static const SDLTest_TestCaseReference subsystemsTest4 = { - (SDLTest_TestCaseFp)subsystems_dependRefCountWithExtraInit, "subsystems_dependRefCountWithExtraInit", "Check reference count of subsystem dependencies.", TEST_ENABLED -}; - -/* Sequence of Events test cases */ -static const SDLTest_TestCaseReference *subsystemsTests[] = { - &subsystemsTest1, &subsystemsTest2, &subsystemsTest3, &subsystemsTest4, NULL -}; - -/* Events test suite (global) */ -SDLTest_TestSuiteReference subsystemsTestSuite = { - "Subsystems", - subsystemsSetUp, - subsystemsTests, - subsystemsTearDown -}; diff --git a/libs/SDL2/test/testautomation_suites.h b/libs/SDL2/test/testautomation_suites.h index 95528f271..6fdcd8388 100644 --- a/libs/SDL2/test/testautomation_suites.h +++ b/libs/SDL2/test/testautomation_suites.h @@ -16,7 +16,6 @@ extern SDLTest_TestSuiteReference guidTestSuite; extern SDLTest_TestSuiteReference hintsTestSuite; extern SDLTest_TestSuiteReference joystickTestSuite; extern SDLTest_TestSuiteReference keyboardTestSuite; -extern SDLTest_TestSuiteReference logTestSuite; extern SDLTest_TestSuiteReference mainTestSuite; extern SDLTest_TestSuiteReference mathTestSuite; extern SDLTest_TestSuiteReference mouseTestSuite; @@ -27,7 +26,6 @@ extern SDLTest_TestSuiteReference renderTestSuite; extern SDLTest_TestSuiteReference rwopsTestSuite; extern SDLTest_TestSuiteReference sdltestTestSuite; extern SDLTest_TestSuiteReference stdlibTestSuite; -extern SDLTest_TestSuiteReference subsystemsTestSuite; extern SDLTest_TestSuiteReference surfaceTestSuite; extern SDLTest_TestSuiteReference syswmTestSuite; extern SDLTest_TestSuiteReference timerTestSuite; @@ -42,7 +40,6 @@ SDLTest_TestSuiteReference *testSuites[] = { &hintsTestSuite, &joystickTestSuite, &keyboardTestSuite, - &logTestSuite, &mainTestSuite, &mathTestSuite, &mouseTestSuite, @@ -57,7 +54,6 @@ SDLTest_TestSuiteReference *testSuites[] = { &syswmTestSuite, &timerTestSuite, &videoTestSuite, - &subsystemsTestSuite, /* run last, not interfere with other test enviroment */ NULL }; diff --git a/libs/SDL2/test/testautomation_surface.c b/libs/SDL2/test/testautomation_surface.c index fcc4bc14c..41aa24142 100644 --- a/libs/SDL2/test/testautomation_surface.c +++ b/libs/SDL2/test/testautomation_surface.c @@ -668,34 +668,6 @@ int surface_testOverflow(void *arg) surface != NULL ? "(success)" : SDL_GetError()); SDL_FreeSurface(surface); - /* SDL_PIXELFORMAT_INDEX2* needs 1 byte per 4 pixels. */ - surface = SDL_CreateRGBSurfaceWithFormatFrom(buf, 12, 1, 2, 3, SDL_PIXELFORMAT_INDEX2LSB); - SDLTest_AssertCheck(surface != NULL, "12px * 2 bits per px fits in 3 bytes: %s", - surface != NULL ? "(success)" : SDL_GetError()); - SDL_FreeSurface(surface); - surface = SDL_CreateRGBSurfaceFrom(buf, 12, 1, 2, 3, 0, 0, 0, 0); - SDLTest_AssertCheck(surface != NULL, "12px * 2 bits per px fits in 3 bytes: %s", - surface != NULL ? "(success)" : SDL_GetError()); - SDL_FreeSurface(surface); - - surface = SDL_CreateRGBSurfaceWithFormatFrom(buf, 13, 1, 2, 3, SDL_PIXELFORMAT_INDEX2LSB); - SDLTest_AssertCheck(surface == NULL, "Should detect pitch < width * bpp (%d)", surface ? surface->pitch : 0); - SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0, - "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError()); - surface = SDL_CreateRGBSurfaceFrom(buf, 13, 1, 2, 3, 0, 0, 0, 0); - SDLTest_AssertCheck(surface == NULL, "Should detect pitch < width * bpp"); - SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0, - "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError()); - - surface = SDL_CreateRGBSurfaceWithFormatFrom(buf, 13, 1, 2, 4, SDL_PIXELFORMAT_INDEX2LSB); - SDLTest_AssertCheck(surface != NULL, "13px * 2 bits per px fits in 4 bytes: %s", - surface != NULL ? "(success)" : SDL_GetError()); - SDL_FreeSurface(surface); - surface = SDL_CreateRGBSurfaceFrom(buf, 13, 1, 2, 4, 0, 0, 0, 0); - SDLTest_AssertCheck(surface != NULL, "13px * 2 bits per px fits in 4 bytes: %s", - surface != NULL ? "(success)" : SDL_GetError()); - SDL_FreeSurface(surface); - /* SDL_PIXELFORMAT_INDEX1* needs 1 byte per 8 pixels. */ surface = SDL_CreateRGBSurfaceWithFormatFrom(buf, 16, 1, 1, 2, SDL_PIXELFORMAT_INDEX1LSB); SDLTest_AssertCheck(surface != NULL, "16px * 1 bit per px fits in 2 bytes: %s", @@ -765,26 +737,19 @@ int surface_testOverflow(void *arg) "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError()); if (sizeof(size_t) == 4 && sizeof(int) >= 4) { - SDL_ClearError(); expectedError = "Out of memory"; - /* 0x5555'5555 * 3bpp = 0xffff'ffff which fits in size_t, but adding - * alignment padding makes it overflow */ - surface = SDL_CreateRGBSurfaceWithFormat(0, 0x55555555, 1, 24, SDL_PIXELFORMAT_RGB24); + surface = SDL_CreateRGBSurfaceWithFormat(0, SDL_MAX_SINT32, 1, 8, SDL_PIXELFORMAT_INDEX8); SDLTest_AssertCheck(surface == NULL, "Should detect overflow in width + alignment"); SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0, "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError()); - SDL_ClearError(); - /* 0x4000'0000 * 4bpp = 0x1'0000'0000 which (just) overflows */ - surface = SDL_CreateRGBSurfaceWithFormat(0, 0x40000000, 1, 32, SDL_PIXELFORMAT_ARGB8888); + surface = SDL_CreateRGBSurfaceWithFormat(0, SDL_MAX_SINT32 / 2, 1, 32, SDL_PIXELFORMAT_ARGB8888); SDLTest_AssertCheck(surface == NULL, "Should detect overflow in width * bytes per pixel"); SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0, "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError()); - SDL_ClearError(); surface = SDL_CreateRGBSurfaceWithFormat(0, (1 << 29) - 1, (1 << 29) - 1, 8, SDL_PIXELFORMAT_INDEX8); SDLTest_AssertCheck(surface == NULL, "Should detect overflow in width * height"); SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0, "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError()); - SDL_ClearError(); surface = SDL_CreateRGBSurfaceWithFormat(0, (1 << 15) + 1, (1 << 15) + 1, 32, SDL_PIXELFORMAT_ARGB8888); SDLTest_AssertCheck(surface == NULL, "Should detect overflow in width * height * bytes per pixel"); SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0, diff --git a/libs/SDL2/test/testautomation_timer.c b/libs/SDL2/test/testautomation_timer.c index a7160e76c..1002a36eb 100644 --- a/libs/SDL2/test/testautomation_timer.c +++ b/libs/SDL2/test/testautomation_timer.c @@ -94,10 +94,7 @@ int timer_delayAndGetTicks(void *arg) SDLTest_AssertCheck(result2 > 0, "Check result value, expected: >0, got: %" SDL_PRIu32, result2); difference = result2 - result; SDLTest_AssertCheck(difference > (testDelay - marginOfError), "Check difference, expected: >%" SDL_PRIu32 ", got: %" SDL_PRIu32, testDelay - marginOfError, difference); -#if 0 - /* Disabled because this might fail on non-interactive systems. Moved to testtimer. */ SDLTest_AssertCheck(difference < (testDelay + marginOfError), "Check difference, expected: <%" SDL_PRIu32 ", got: %" SDL_PRIu32, testDelay + marginOfError, difference); -#endif return TEST_COMPLETED; } diff --git a/libs/SDL2/test/testautomation_video.c b/libs/SDL2/test/testautomation_video.c index dd8f1c5c2..aa9e7b92b 100644 --- a/libs/SDL2/test/testautomation_video.c +++ b/libs/SDL2/test/testautomation_video.c @@ -28,7 +28,6 @@ SDL_Window *_createVideoSuiteTestWindow(const char *title) SDL_Window *window; int x, y, w, h; SDL_WindowFlags flags; - SDL_bool needs_renderer = SDL_FALSE; /* Standard window */ x = SDLTest_RandomIntegerInRange(1, 100); @@ -41,35 +40,6 @@ SDL_Window *_createVideoSuiteTestWindow(const char *title) SDLTest_AssertPass("Call to SDL_CreateWindow('Title',%d,%d,%d,%d,%d)", x, y, w, h, flags); SDLTest_AssertCheck(window != NULL, "Validate that returned window struct is not NULL"); - /* Wayland and XWayland windows require that a frame be presented before they are fully mapped and visible onscreen. - * This is required for the mouse/keyboard grab tests to pass. - */ - if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "wayland") == 0) { - needs_renderer = SDL_TRUE; - } else if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "x11") == 0) { - /* Try to detect if the x11 driver is running under XWayland */ - const char *session_type = SDL_getenv("XDG_SESSION_TYPE"); - if (session_type && SDL_strcasecmp(session_type, "wayland") == 0) { - needs_renderer = SDL_TRUE; - } - } - - if (needs_renderer) { - SDL_Renderer *renderer = SDL_CreateRenderer(window, -1, 0); - if (renderer) { - SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0x00, 0xFF); - SDL_RenderClear(renderer); - SDL_RenderPresent(renderer); - - /* Some desktops don't display the window immediately after presentation, - * so delay to give the window time to actually appear on the desktop. - */ - SDL_Delay(100); - } else { - SDLTest_Log("Unable to create a renderer, some tests may fail on Wayland/XWayland"); - } - } - return window; } @@ -78,7 +48,7 @@ SDL_Window *_createVideoSuiteTestWindow(const char *title) */ void _destroyVideoSuiteTestWindow(SDL_Window *window) { - if (window) { + if (window != NULL) { SDL_DestroyWindow(window); window = NULL; SDLTest_AssertPass("Call to SDL_DestroyWindow()"); @@ -308,8 +278,6 @@ int video_createWindowVariousFlags(void *arg) break; case 2: flags = SDL_WINDOW_OPENGL; - /* Skip - not every video driver supports OpenGL; comment out next line to run test */ - continue; break; case 3: flags = SDL_WINDOW_SHOWN; @@ -608,7 +576,7 @@ int video_getWindowDisplayMode(void *arg) /* Call against new test window */ window = _createVideoSuiteTestWindow(title); - if (window) { + if (window != NULL) { result = SDL_GetWindowDisplayMode(window, &mode); SDLTest_AssertPass("Call to SDL_GetWindowDisplayMode()"); SDLTest_AssertCheck(result == 0, "Validate result value; expected: 0, got: %d", result); @@ -702,7 +670,7 @@ video_getWindowGammaRamp(void *arg) /* Call against new test window */ window = _createVideoSuiteTestWindow(title); - if (!window) return TEST_ABORTED; + if (window == NULL) return TEST_ABORTED; /* Retrieve no channel */ result = SDL_GetWindowGammaRamp(window, NULL, NULL, NULL); @@ -852,33 +820,13 @@ int video_getSetWindowGrab(void *arg) const char *title = "video_getSetWindowGrab Test Window"; SDL_Window *window; SDL_bool originalMouseState, originalKeyboardState; - SDL_bool hasFocusGained = SDL_FALSE; /* Call against new test window */ window = _createVideoSuiteTestWindow(title); - if (!window) { + if (window == NULL) { return TEST_ABORTED; } - /* Need to raise the window to have and SDL_EVENT_WINDOW_FOCUS_GAINED, - * so that the window gets the flags SDL_WINDOW_INPUT_FOCUS, - * so that it can be "grabbed" */ - SDL_RaiseWindow(window); - - { - SDL_Event evt; - SDL_zero(evt); - while (SDL_PollEvent(&evt)) { - if (evt.type == SDL_WINDOWEVENT) { - if (evt.window.event == SDL_WINDOWEVENT_FOCUS_GAINED) { - hasFocusGained = SDL_TRUE; - } - } - } - } - - SDLTest_AssertCheck(hasFocusGained == SDL_TRUE, "Expected window with focus"); - /* Get state */ originalMouseState = SDL_GetWindowMouseGrab(window); SDLTest_AssertPass("Call to SDL_GetWindowMouseGrab()"); @@ -1019,7 +967,7 @@ int video_getWindowId(void *arg) /* Call against new test window */ window = _createVideoSuiteTestWindow(title); - if (!window) { + if (window == NULL) { return TEST_ABORTED; } @@ -1074,7 +1022,7 @@ int video_getWindowPixelFormat(void *arg) /* Call against new test window */ window = _createVideoSuiteTestWindow(title); - if (!window) { + if (window == NULL) { return TEST_ABORTED; } @@ -1137,58 +1085,28 @@ int video_getSetWindowPosition(void *arg) { const char *title = "video_getSetWindowPosition Test Window"; SDL_Window *window; - int maxxVariation, maxyVariation; int xVariation, yVariation; int referenceX, referenceY; int currentX, currentY; int desiredX, desiredY; - SDL_Rect display_bounds; - - if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "wayland") == 0) { - SDLTest_Log("Skipping test: wayland does not support window positioning"); - return TEST_SKIPPED; - } /* Call against new test window */ window = _createVideoSuiteTestWindow(title); - if (!window) { + if (window == NULL) { return TEST_ABORTED; } - if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "x11") == 0) { - /* The X11 server allows arbitrary window placement, but compositing - * window managers such as GNOME and KDE force windows to be within - * desktop bounds. - */ - maxxVariation = 2; - maxyVariation = 2; - - SDL_GetDisplayUsableBounds(SDL_GetWindowDisplayIndex(window), &display_bounds); - } else if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "cocoa") == 0) { - /* Platform doesn't allow windows with negative Y desktop bounds */ - maxxVariation = 4; - maxyVariation = 3; - - SDL_GetDisplayUsableBounds(SDL_GetWindowDisplayIndex(window), &display_bounds); - } else { - /* Platform allows windows to be placed out of bounds */ - maxxVariation = 4; - maxyVariation = 4; - - SDL_GetDisplayBounds(SDL_GetWindowDisplayIndex(window), &display_bounds); - } - - for (xVariation = 0; xVariation < maxxVariation; xVariation++) { - for (yVariation = 0; yVariation < maxyVariation; yVariation++) { + for (xVariation = 0; xVariation < 4; xVariation++) { + for (yVariation = 0; yVariation < 4; yVariation++) { switch (xVariation) { default: case 0: /* Zero X Position */ - desiredX = display_bounds.x > 0 ? display_bounds.x : 0; + desiredX = 0; break; case 1: /* Random X position inside screen */ - desiredX = SDLTest_RandomIntegerInRange(display_bounds.x + 1, display_bounds.x + 100); + desiredX = SDLTest_RandomIntegerInRange(1, 100); break; case 2: /* Random X position outside screen (positive) */ @@ -1203,15 +1121,15 @@ int video_getSetWindowPosition(void *arg) switch (yVariation) { default: case 0: - /* Zero Y Position */ - desiredY = display_bounds.y > 0 ? display_bounds.y : 0; + /* Zero X Position */ + desiredY = 0; break; case 1: - /* Random Y position inside screen */ - desiredY = SDLTest_RandomIntegerInRange(display_bounds.y + 1, display_bounds.y + 100); + /* Random X position inside screen */ + desiredY = SDLTest_RandomIntegerInRange(1, 100); break; case 2: - /* Random Y position outside screen (positive) */ + /* Random X position outside screen (positive) */ desiredY = SDLTest_RandomIntegerInRange(10000, 11000); break; case 3: @@ -1337,7 +1255,7 @@ int video_getSetWindowSize(void *arg) int desiredW, desiredH; /* Get display bounds for size range */ - result = SDL_GetDisplayUsableBounds(0, &display); + result = SDL_GetDisplayBounds(0, &display); SDLTest_AssertPass("SDL_GetDisplayBounds()"); SDLTest_AssertCheck(result == 0, "Verify return value; expected: 0, got: %d", result); if (result != 0) { @@ -1346,20 +1264,19 @@ int video_getSetWindowSize(void *arg) /* Call against new test window */ window = _createVideoSuiteTestWindow(title); - if (!window) { + if (window == NULL) { return TEST_ABORTED; } - if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "windows") == 0 || - SDL_strcmp(SDL_GetCurrentVideoDriver(), "x11") == 0) { - /* Platform clips window size to screen size */ - maxwVariation = 4; - maxhVariation = 4; - } else { - /* Platform allows window size >= screen size */ - maxwVariation = 5; - maxhVariation = 5; - } +#ifdef __WIN32__ + /* Platform clips window size to screen size */ + maxwVariation = 4; + maxhVariation = 4; +#else + /* Platform allows window size >= screen size */ + maxwVariation = 5; + maxhVariation = 5; +#endif for (wVariation = 0; wVariation < maxwVariation; wVariation++) { for (hVariation = 0; hVariation < maxhVariation; hVariation++) { @@ -1438,6 +1355,7 @@ int video_getSetWindowSize(void *arg) } } + /* Get just width */ currentW = desiredW + 1; SDL_GetWindowSize(window, ¤tW, NULL); @@ -1529,7 +1447,7 @@ int video_getSetWindowMinimumSize(void *arg) /* Call against new test window */ window = _createVideoSuiteTestWindow(title); - if (!window) { + if (window == NULL) { return TEST_ABORTED; } @@ -1671,7 +1589,7 @@ int video_getSetWindowMaximumSize(void *arg) /* Call against new test window */ window = _createVideoSuiteTestWindow(title); - if (!window) { + if (window == NULL) { return TEST_ABORTED; } @@ -1809,30 +1727,30 @@ int video_getSetWindowData(void *arg) /* Call against new test window */ window = _createVideoSuiteTestWindow(title); - if (!window) { + if (window == NULL) { return TEST_ABORTED; } /* Create testdata */ datasize = SDLTest_RandomIntegerInRange(1, 32); referenceUserdata = SDLTest_RandomAsciiStringOfSize(datasize); - if (!referenceUserdata) { + if (referenceUserdata == NULL) { returnValue = TEST_ABORTED; goto cleanup; } userdata = SDL_strdup(referenceUserdata); - if (!userdata) { + if (userdata == NULL) { returnValue = TEST_ABORTED; goto cleanup; } datasize = SDLTest_RandomIntegerInRange(1, 32); referenceUserdata2 = SDLTest_RandomAsciiStringOfSize(datasize); - if (!referenceUserdata2) { + if (referenceUserdata2 == NULL) { returnValue = TEST_ABORTED; goto cleanup; } userdata2 = SDL_strdup(referenceUserdata2); - if (!userdata2) { + if (userdata2 == NULL) { returnValue = TEST_ABORTED; goto cleanup; } @@ -2017,11 +1935,6 @@ int video_setWindowCenteredOnDisplay(void *arg) SDL_Rect display0, display1; displayNum = SDL_GetNumVideoDisplays(); - SDLTest_AssertPass("SDL_GetNumVideoDisplays()"); - SDLTest_AssertCheck(displayNum >= 1, "Validate result (current: %d, expected >= 1)", displayNum); - if (displayNum <= 0) { - return TEST_ABORTED; - } /* Get display bounds */ result = SDL_GetDisplayBounds(0 % displayNum, &display0); @@ -2046,7 +1959,6 @@ int video_setWindowCenteredOnDisplay(void *arg) int currentDisplay; int expectedDisplay; SDL_Rect expectedDisplayRect; - SDL_bool video_driver_is_wayland = SDL_strcmp(SDL_GetCurrentVideoDriver(), "wayland") == 0; /* xVariation is the display we start on */ expectedDisplay = xVariation % displayNum; @@ -2058,46 +1970,20 @@ int video_setWindowCenteredOnDisplay(void *arg) expectedX = (expectedDisplayRect.x + ((expectedDisplayRect.w - w) / 2)); expectedY = (expectedDisplayRect.y + ((expectedDisplayRect.h - h) / 2)); - window = SDL_CreateWindow(title, x, y, w, h, SDL_WINDOW_SHOWN | SDL_WINDOW_ALLOW_HIGHDPI | SDL_WINDOW_BORDERLESS); + window = SDL_CreateWindow(title, x, y, w, h, SDL_WINDOW_SHOWN | SDL_WINDOW_ALLOW_HIGHDPI); SDLTest_AssertPass("Call to SDL_CreateWindow('Title',%d,%d,%d,%d,SHOWN)", x, y, w, h); SDLTest_AssertCheck(window != NULL, "Validate that returned window struct is not NULL"); - /* Wayland windows require that a frame be presented before they are fully mapped and visible onscreen. */ - if (video_driver_is_wayland) { - SDL_Renderer *renderer = SDL_CreateRenderer(window, -1, 0); - - if (renderer) { - SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0x00, 0xFF); - SDL_RenderClear(renderer); - SDL_RenderPresent(renderer); - - /* Some desktops don't display the window immediately after presentation, - * so delay to give the window time to actually appear on the desktop. - */ - SDL_Delay(100); - } else { - SDLTest_Log("Unable to create a renderer, tests may fail under Wayland"); - } - } - /* Check the window is centered on the requested display */ currentDisplay = SDL_GetWindowDisplayIndex(window); SDL_GetWindowSize(window, ¤tW, ¤tH); SDL_GetWindowPosition(window, ¤tX, ¤tY); - if (!video_driver_is_wayland) { - SDLTest_AssertCheck(currentDisplay == expectedDisplay, "Validate display index (current: %d, expected: %d)", currentDisplay, expectedDisplay); - } else { - SDLTest_Log("Skipping display index validation: Wayland driver does not support window positioning"); - } + SDLTest_AssertCheck(currentDisplay == expectedDisplay, "Validate display index (current: %d, expected: %d)", currentDisplay, expectedDisplay); SDLTest_AssertCheck(currentW == w, "Validate width (current: %d, expected: %d)", currentW, w); SDLTest_AssertCheck(currentH == h, "Validate height (current: %d, expected: %d)", currentH, h); - if (!video_driver_is_wayland) { - SDLTest_AssertCheck(currentX == expectedX, "Validate x (current: %d, expected: %d)", currentX, expectedX); - SDLTest_AssertCheck(currentY == expectedY, "Validate y (current: %d, expected: %d)", currentY, expectedY); - } else { - SDLTest_Log("Skipping window position validation: Wayland driver does not support window positioning"); - } + SDLTest_AssertCheck(currentX == expectedX, "Validate x (current: %d, expected: %d)", currentX, expectedX); + SDLTest_AssertCheck(currentY == expectedY, "Validate y (current: %d, expected: %d)", currentY, expectedY); /* Enter fullscreen desktop */ result = SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP); @@ -2108,19 +1994,11 @@ int video_setWindowCenteredOnDisplay(void *arg) SDL_GetWindowSize(window, ¤tW, ¤tH); SDL_GetWindowPosition(window, ¤tX, ¤tY); - if (!video_driver_is_wayland) { - SDLTest_AssertCheck(currentDisplay == expectedDisplay, "Validate display index (current: %d, expected: %d)", currentDisplay, expectedDisplay); - } else { - SDLTest_Log("Skipping display index validation: Wayland driver does not support window positioning"); - } + SDLTest_AssertCheck(currentDisplay == expectedDisplay, "Validate display index (current: %d, expected: %d)", currentDisplay, expectedDisplay); SDLTest_AssertCheck(currentW == expectedDisplayRect.w, "Validate width (current: %d, expected: %d)", currentW, expectedDisplayRect.w); SDLTest_AssertCheck(currentH == expectedDisplayRect.h, "Validate height (current: %d, expected: %d)", currentH, expectedDisplayRect.h); - if (!video_driver_is_wayland) { - SDLTest_AssertCheck(currentX == expectedDisplayRect.x, "Validate x (current: %d, expected: %d)", currentX, expectedDisplayRect.x); - SDLTest_AssertCheck(currentY == expectedDisplayRect.y, "Validate y (current: %d, expected: %d)", currentY, expectedDisplayRect.y); - } else { - SDLTest_Log("Skipping window position validation: Wayland driver does not support window positioning"); - } + SDLTest_AssertCheck(currentX == expectedDisplayRect.x, "Validate x (current: %d, expected: %d)", currentX, expectedDisplayRect.x); + SDLTest_AssertCheck(currentY == expectedDisplayRect.y, "Validate y (current: %d, expected: %d)", currentY, expectedDisplayRect.y); /* Leave fullscreen desktop */ result = SDL_SetWindowFullscreen(window, 0); @@ -2131,19 +2009,11 @@ int video_setWindowCenteredOnDisplay(void *arg) SDL_GetWindowSize(window, ¤tW, ¤tH); SDL_GetWindowPosition(window, ¤tX, ¤tY); - if (!video_driver_is_wayland) { - SDLTest_AssertCheck(currentDisplay == expectedDisplay, "Validate display index (current: %d, expected: %d)", currentDisplay, expectedDisplay); - } else { - SDLTest_Log("Skipping display index validation: Wayland driver does not support window positioning"); - } + SDLTest_AssertCheck(currentDisplay == expectedDisplay, "Validate display index (current: %d, expected: %d)", currentDisplay, expectedDisplay); SDLTest_AssertCheck(currentW == w, "Validate width (current: %d, expected: %d)", currentW, w); SDLTest_AssertCheck(currentH == h, "Validate height (current: %d, expected: %d)", currentH, h); - if (!video_driver_is_wayland) { - SDLTest_AssertCheck(currentX == expectedX, "Validate x (current: %d, expected: %d)", currentX, expectedX); - SDLTest_AssertCheck(currentY == expectedY, "Validate y (current: %d, expected: %d)", currentY, expectedY); - } else { - SDLTest_Log("Skipping window position validation: Wayland driver does not support window positioning"); - } + SDLTest_AssertCheck(currentX == expectedX, "Validate x (current: %d, expected: %d)", currentX, expectedX); + SDLTest_AssertCheck(currentY == expectedY, "Validate y (current: %d, expected: %d)", currentY, expectedY); /* Center on display yVariation, and check window properties */ @@ -2159,19 +2029,11 @@ int video_setWindowCenteredOnDisplay(void *arg) SDL_GetWindowSize(window, ¤tW, ¤tH); SDL_GetWindowPosition(window, ¤tX, ¤tY); - if (!video_driver_is_wayland) { - SDLTest_AssertCheck(currentDisplay == expectedDisplay, "Validate display index (current: %d, expected: %d)", currentDisplay, expectedDisplay); - } else { - SDLTest_Log("Skipping display index validation: Wayland driver does not support window positioning"); - } + SDLTest_AssertCheck(currentDisplay == expectedDisplay, "Validate display index (current: %d, expected: %d)", currentDisplay, expectedDisplay); SDLTest_AssertCheck(currentW == w, "Validate width (current: %d, expected: %d)", currentW, w); SDLTest_AssertCheck(currentH == h, "Validate height (current: %d, expected: %d)", currentH, h); - if (!video_driver_is_wayland) { - SDLTest_AssertCheck(currentX == expectedX, "Validate x (current: %d, expected: %d)", currentX, expectedX); - SDLTest_AssertCheck(currentY == expectedY, "Validate y (current: %d, expected: %d)", currentY, expectedY); - } else { - SDLTest_Log("Skipping window position validation: Wayland driver does not support window positioning"); - } + SDLTest_AssertCheck(currentX == expectedX, "Validate x (current: %d, expected: %d)", currentX, expectedX); + SDLTest_AssertCheck(currentY == expectedY, "Validate y (current: %d, expected: %d)", currentY, expectedY); /* Clean up */ _destroyVideoSuiteTestWindow(window); diff --git a/libs/SDL2/test/testbounds.c b/libs/SDL2/test/testbounds.c index 9bd73ac96..42213f546 100644 --- a/libs/SDL2/test/testbounds.c +++ b/libs/SDL2/test/testbounds.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/test/testcustomcursor.c b/libs/SDL2/test/testcustomcursor.c index aec3c78aa..dc1c3718c 100644 --- a/libs/SDL2/test/testcustomcursor.c +++ b/libs/SDL2/test/testcustomcursor.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -242,7 +242,7 @@ int main(int argc, char *argv[]) /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); - if (!state) { + if (state == NULL) { return 1; } for (i = 1; i < argc;) { diff --git a/libs/SDL2/test/testdisplayinfo.c b/libs/SDL2/test/testdisplayinfo.c index 9740ab174..66cc5d875 100644 --- a/libs/SDL2/test/testdisplayinfo.c +++ b/libs/SDL2/test/testdisplayinfo.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -20,7 +20,7 @@ static void print_mode(const char *prefix, const SDL_DisplayMode *mode) { - if (!mode) { + if (mode == NULL) { return; } diff --git a/libs/SDL2/test/testdraw2.c b/libs/SDL2/test/testdraw2.c index 43aa1843b..f660c2845 100644 --- a/libs/SDL2/test/testdraw2.c +++ b/libs/SDL2/test/testdraw2.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -227,7 +227,7 @@ int main(int argc, char *argv[]) /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); - if (!state) { + if (state == NULL) { return 1; } for (i = 1; i < argc;) { diff --git a/libs/SDL2/test/testdrawchessboard.c b/libs/SDL2/test/testdrawchessboard.c index 4dffe06bd..8ff21a4c4 100644 --- a/libs/SDL2/test/testdrawchessboard.c +++ b/libs/SDL2/test/testdrawchessboard.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -50,7 +50,6 @@ void DrawChessBoard() SDL_RenderFillRect(renderer, &rect); } } - SDL_RenderPresent(renderer); } void loop() @@ -107,13 +106,13 @@ int main(int argc, char *argv[]) /* Create window and renderer for given surface */ window = SDL_CreateWindow("Chess Board", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_RESIZABLE); - if (!window) { + if (window == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Window creation fail : %s\n", SDL_GetError()); return 1; } surface = SDL_GetWindowSurface(window); renderer = SDL_CreateSoftwareRenderer(surface); - if (!renderer) { + if (renderer == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Render creation for surface fail : %s\n", SDL_GetError()); return 1; } diff --git a/libs/SDL2/test/testdropfile.c b/libs/SDL2/test/testdropfile.c index 2184f062e..b80633365 100644 --- a/libs/SDL2/test/testdropfile.c +++ b/libs/SDL2/test/testdropfile.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -35,7 +35,7 @@ int main(int argc, char *argv[]) /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); - if (!state) { + if (state == NULL) { return 1; } diff --git a/libs/SDL2/test/testerror.c b/libs/SDL2/test/testerror.c index 25874d1ea..f3f11b661 100644 --- a/libs/SDL2/test/testerror.c +++ b/libs/SDL2/test/testerror.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -65,7 +65,7 @@ int main(int argc, char *argv[]) alive = 1; thread = SDL_CreateThread(ThreadFunc, NULL, "#1"); - if (!thread) { + if (thread == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create thread: %s\n", SDL_GetError()); quit(1); } diff --git a/libs/SDL2/test/testevdev.c b/libs/SDL2/test/testevdev.c index 67124ae0f..e61579158 100644 --- a/libs/SDL2/test/testevdev.c +++ b/libs/SDL2/test/testevdev.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 Sam Lantinga Copyright (C) 2020-2022 Collabora Ltd. This software is provided 'as-is', without any express or implied @@ -18,7 +18,7 @@ static int run_test(void); -#if defined(HAVE_LIBUDEV_H) || defined(SDL_JOYSTICK_LINUX) +#if HAVE_LIBUDEV_H || defined(SDL_JOYSTICK_LINUX) #include diff --git a/libs/SDL2/test/testfile.c b/libs/SDL2/test/testfile.c index a35da02bd..40d52ca22 100644 --- a/libs/SDL2/test/testfile.c +++ b/libs/SDL2/test/testfile.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -107,25 +107,25 @@ int main(int argc, char *argv[]) RWOP_ERR_QUIT(rwops); } rwops = SDL_RWFromFile(FBASENAME2, "wb"); - if (!rwops) { + if (rwops == NULL) { RWOP_ERR_QUIT(rwops); } rwops->close(rwops); unlink(FBASENAME2); rwops = SDL_RWFromFile(FBASENAME2, "wb+"); - if (!rwops) { + if (rwops == NULL) { RWOP_ERR_QUIT(rwops); } rwops->close(rwops); unlink(FBASENAME2); rwops = SDL_RWFromFile(FBASENAME2, "ab"); - if (!rwops) { + if (rwops == NULL) { RWOP_ERR_QUIT(rwops); } rwops->close(rwops); unlink(FBASENAME2); rwops = SDL_RWFromFile(FBASENAME2, "ab+"); - if (!rwops) { + if (rwops == NULL) { RWOP_ERR_QUIT(rwops); } rwops->close(rwops); @@ -136,7 +136,7 @@ int main(int argc, char *argv[]) test : w mode, r mode, w+ mode */ rwops = SDL_RWFromFile(FBASENAME1, "wb"); /* write only */ - if (!rwops) { + if (rwops == NULL) { RWOP_ERR_QUIT(rwops); } if (1 != rwops->write(rwops, "1234567890", 10, 1)) { @@ -158,7 +158,7 @@ int main(int argc, char *argv[]) rwops->close(rwops); rwops = SDL_RWFromFile(FBASENAME1, "rb"); /* read mode, file must exists */ - if (!rwops) { + if (rwops == NULL) { RWOP_ERR_QUIT(rwops); } if (0 != rwops->seek(rwops, 0L, RW_SEEK_SET)) { @@ -196,7 +196,7 @@ int main(int argc, char *argv[]) /* test 3: same with w+ mode */ rwops = SDL_RWFromFile(FBASENAME1, "wb+"); /* write + read + truncation */ - if (!rwops) { + if (rwops == NULL) { RWOP_ERR_QUIT(rwops); } if (1 != rwops->write(rwops, "1234567890", 10, 1)) { @@ -247,7 +247,7 @@ int main(int argc, char *argv[]) /* test 4: same in r+ mode */ rwops = SDL_RWFromFile(FBASENAME1, "rb+"); /* write + read + file must exists, no truncation */ - if (!rwops) { + if (rwops == NULL) { RWOP_ERR_QUIT(rwops); } if (1 != rwops->write(rwops, "1234567890", 10, 1)) { @@ -298,7 +298,7 @@ int main(int argc, char *argv[]) /* test5 : append mode */ rwops = SDL_RWFromFile(FBASENAME1, "ab+"); /* write + read + append */ - if (!rwops) { + if (rwops == NULL) { RWOP_ERR_QUIT(rwops); } if (1 != rwops->write(rwops, "1234567890", 10, 1)) { diff --git a/libs/SDL2/test/testfilesystem.c b/libs/SDL2/test/testfilesystem.c index af0bd9f05..f452d7761 100644 --- a/libs/SDL2/test/testfilesystem.c +++ b/libs/SDL2/test/testfilesystem.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -28,7 +28,7 @@ int main(int argc, char *argv[]) } base_path = SDL_GetBasePath(); - if (!base_path) { + if (base_path == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't find base path: %s\n", SDL_GetError()); } else { @@ -37,7 +37,7 @@ int main(int argc, char *argv[]) } pref_path = SDL_GetPrefPath("libsdl", "test_filesystem"); - if (!pref_path) { + if (pref_path == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't find pref path: %s\n", SDL_GetError()); } else { @@ -46,7 +46,7 @@ int main(int argc, char *argv[]) } pref_path = SDL_GetPrefPath(NULL, "test_filesystem"); - if (!pref_path) { + if (pref_path == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't find pref path without organization: %s\n", SDL_GetError()); } else { diff --git a/libs/SDL2/test/testfilesystem_pre.c b/libs/SDL2/test/testfilesystem_pre.c index 11615abd2..dba8b51fb 100644 --- a/libs/SDL2/test/testfilesystem_pre.c +++ b/libs/SDL2/test/testfilesystem_pre.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/test/testgamecontroller.c b/libs/SDL2/test/testgamecontroller.c index 52d3b2d85..e2bdebdec 100644 --- a/libs/SDL2/test/testgamecontroller.c +++ b/libs/SDL2/test/testgamecontroller.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -109,7 +109,7 @@ static SDL_GameControllerButton virtual_button_active = SDL_CONTROLLER_BUTTON_IN static void UpdateWindowTitle() { - if (!window) { + if (window == NULL) { return; } @@ -201,13 +201,13 @@ static void AddController(int device_index, SDL_bool verbose) } controller = SDL_GameControllerOpen(device_index); - if (!controller) { + if (controller == NULL) { SDL_Log("Couldn't open controller: %s\n", SDL_GetError()); return; } controllers = (SDL_GameController **)SDL_realloc(gamecontrollers, (num_controllers + 1) * sizeof(*controllers)); - if (!controllers) { + if (controllers == NULL) { SDL_GameControllerClose(controller); return; } @@ -221,7 +221,6 @@ static void AddController(int device_index, SDL_bool verbose) const char *name = SDL_GameControllerName(gamecontroller); const char *path = SDL_GameControllerPath(gamecontroller); SDL_Log("Opened game controller %s%s%s\n", name, path ? ", " : "", path ? path : ""); - SDL_Log("Mapping: %s\n", SDL_GameControllerMapping(gamecontroller)); } firmware_version = SDL_GameControllerGetFirmwareVersion(gamecontroller); @@ -414,7 +413,7 @@ static void OpenVirtualController() SDL_Log("Couldn't open virtual device: %s\n", SDL_GetError()); } else { virtual_joystick = SDL_JoystickOpen(virtual_index); - if (!virtual_joystick) { + if (virtual_joystick == NULL) { SDL_Log("Couldn't open virtual device: %s\n", SDL_GetError()); } } @@ -625,8 +624,7 @@ void loop(void *arg) if (event.type == SDL_CONTROLLERBUTTONDOWN) { SetController(event.cbutton.which); } - SDL_Log("Controller %" SDL_PRIs32 " button %s %s\n", event.cbutton.which, SDL_GameControllerGetStringForButton((SDL_GameControllerButton)event.cbutton.button), - event.cbutton.state ? "pressed" : "released"); + SDL_Log("Controller %" SDL_PRIs32 " button %s %s\n", event.cbutton.which, SDL_GameControllerGetStringForButton((SDL_GameControllerButton)event.cbutton.button), event.cbutton.state ? "pressed" : "released"); /* Cycle PS5 trigger effects when the microphone button is pressed */ if (event.type == SDL_CONTROLLERBUTTONDOWN && @@ -898,13 +896,13 @@ int main(int argc, char *argv[]) window = SDL_CreateWindow("Game Controller Test", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, SCREEN_WIDTH, SCREEN_HEIGHT, 0); - if (!window) { + if (window == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create window: %s\n", SDL_GetError()); return 2; } screen = SDL_CreateRenderer(window, -1, 0); - if (!screen) { + if (screen == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create renderer: %s\n", SDL_GetError()); SDL_DestroyWindow(window); return 2; @@ -922,7 +920,7 @@ int main(int argc, char *argv[]) button_texture = LoadTexture(screen, "button.bmp", SDL_TRUE, NULL, NULL); axis_texture = LoadTexture(screen, "axis.bmp", SDL_TRUE, NULL, NULL); - if (!background_front || !background_back || !button_texture || !axis_texture) { + if (background_front == NULL || background_back == NULL || button_texture == NULL || axis_texture == NULL) { SDL_DestroyRenderer(screen); SDL_DestroyWindow(window); return 2; diff --git a/libs/SDL2/test/testgeometry.c b/libs/SDL2/test/testgeometry.c index e09c38332..9742a1416 100644 --- a/libs/SDL2/test/testgeometry.c +++ b/libs/SDL2/test/testgeometry.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -172,7 +172,7 @@ int main(int argc, char *argv[]) /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); - if (!state) { + if (state == NULL) { return 1; } for (i = 1; i < argc;) { @@ -216,7 +216,7 @@ int main(int argc, char *argv[]) /* Create the windows, initialize the renderers, and load the textures */ sprites = (SDL_Texture **)SDL_malloc(state->num_windows * sizeof(*sprites)); - if (!sprites) { + if (sprites == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!\n"); quit(2); } diff --git a/libs/SDL2/test/testgesture.c b/libs/SDL2/test/testgesture.c index 9870b6059..f37635f33 100644 --- a/libs/SDL2/test/testgesture.c +++ b/libs/SDL2/test/testgesture.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -131,7 +131,7 @@ DrawScreen(SDL_Window *window) SDL_Surface *screen = SDL_GetWindowSurface(window); int i; - if (!screen) { + if (screen == NULL) { return; } @@ -251,7 +251,7 @@ loop(void) break; case SDL_DOLLARRECORD: - SDL_Log("Recorded gesture: %" SDL_PRIs64, event.dgesture.gestureId); + SDL_Log("Recorded gesture: %" SDL_PRIs64 "", event.dgesture.gestureId); break; } } @@ -272,7 +272,7 @@ loop(void) int main(int argc, char *argv[]) { state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); - if (!state) { + if (state == NULL) { return 1; } diff --git a/libs/SDL2/test/testgl2.c b/libs/SDL2/test/testgl2.c index d14ae1675..b58798c32 100644 --- a/libs/SDL2/test/testgl2.c +++ b/libs/SDL2/test/testgl2.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -40,11 +40,11 @@ static GL_Context ctx; static int LoadContext(GL_Context *data) { -#ifdef SDL_VIDEO_DRIVER_UIKIT +#if SDL_VIDEO_DRIVER_UIKIT #define __SDL_NOGETPROCADDR__ -#elif defined(SDL_VIDEO_DRIVER_ANDROID) +#elif SDL_VIDEO_DRIVER_ANDROID #define __SDL_NOGETPROCADDR__ -#elif defined(SDL_VIDEO_DRIVER_PANDORA) +#elif SDL_VIDEO_DRIVER_PANDORA #define __SDL_NOGETPROCADDR__ #endif @@ -205,11 +205,6 @@ Render() ctx.glRotatef(5.0, 1.0, 1.0, 1.0); } -static void LogSwapInterval(void) -{ - SDL_Log("Swap Interval : %d\n", SDL_GL_GetSwapInterval()); -} - int main(int argc, char *argv[]) { int fsaa, accel; @@ -231,7 +226,7 @@ int main(int argc, char *argv[]) /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); - if (!state) { + if (state == NULL) { return 1; } for (i = 1; i < argc;) { @@ -305,9 +300,7 @@ int main(int argc, char *argv[]) SDL_GetCurrentDisplayMode(0, &mode); SDL_Log("Screen BPP : %" SDL_PRIu32 "\n", SDL_BITSPERPIXEL(mode.format)); - - LogSwapInterval(); - + SDL_Log("Swap Interval : %d\n", SDL_GL_GetSwapInterval()); SDL_GetWindowSize(state->windows[0], &dw, &dh); SDL_Log("Window Size : %d,%d\n", dw, dh); SDL_GL_GetDrawableSize(state->windows[0], &dw, &dh); @@ -415,7 +408,6 @@ int main(int argc, char *argv[]) SDL_GL_MakeCurrent(state->windows[i], context); if (update_swap_interval) { SDL_GL_SetSwapInterval(swap_interval); - LogSwapInterval(); } SDL_GL_GetDrawableSize(state->windows[i], &w, &h); ctx.glViewport(0, 0, w, h); diff --git a/libs/SDL2/test/testgles.c b/libs/SDL2/test/testgles.c index b1577cd8e..498dbce5c 100644 --- a/libs/SDL2/test/testgles.c +++ b/libs/SDL2/test/testgles.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -34,7 +34,7 @@ quit(int rc) { int i; - if (context) { + if (context != NULL) { for (i = 0; i < state->num_windows; i++) { if (context[i]) { SDL_GL_DeleteContext(context[i]); @@ -114,7 +114,7 @@ int main(int argc, char *argv[]) /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); - if (!state) { + if (state == NULL) { return 1; } for (i = 1; i < argc;) { @@ -169,7 +169,7 @@ int main(int argc, char *argv[]) } context = (SDL_GLContext *)SDL_calloc(state->num_windows, sizeof(*context)); - if (!context) { + if (context == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!\n"); quit(2); } diff --git a/libs/SDL2/test/testgles2.c b/libs/SDL2/test/testgles2.c index bafc524ef..656e5e611 100644 --- a/libs/SDL2/test/testgles2.c +++ b/libs/SDL2/test/testgles2.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -65,11 +65,11 @@ static GLES2_Context ctx; static int LoadContext(GLES2_Context *data) { -#ifdef SDL_VIDEO_DRIVER_UIKIT +#if SDL_VIDEO_DRIVER_UIKIT #define __SDL_NOGETPROCADDR__ -#elif defined(SDL_VIDEO_DRIVER_ANDROID) +#elif SDL_VIDEO_DRIVER_ANDROID #define __SDL_NOGETPROCADDR__ -#elif defined(SDL_VIDEO_DRIVER_PANDORA) +#elif SDL_VIDEO_DRIVER_PANDORA #define __SDL_NOGETPROCADDR__ #endif @@ -96,7 +96,7 @@ quit(int rc) { int i; - if (context) { + if (context != NULL) { for (i = 0; i < state->num_windows; i++) { if (context[i]) { SDL_GL_DeleteContext(context[i]); @@ -636,7 +636,7 @@ int main(int argc, char *argv[]) /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); - if (!state) { + if (state == NULL) { return 1; } for (i = 1; i < argc;) { @@ -696,7 +696,7 @@ int main(int argc, char *argv[]) } context = (SDL_GLContext *)SDL_calloc(state->num_windows, sizeof(*context)); - if (!context) { + if (context == NULL) { SDL_Log("Out of memory!\n"); quit(2); } @@ -893,9 +893,9 @@ int main(int argc, char *argv[]) SDL_Log("%2.2f frames per second\n", ((double)frames * 1000) / (now - then)); } -#if !defined(__ANDROID__) && !defined(__NACL__) +#if !defined(__ANDROID__) && !defined(__NACL__) quit(0); -#endif +#endif return 0; } diff --git a/libs/SDL2/test/testgles2_sdf.c b/libs/SDL2/test/testgles2_sdf.c index 3b15f7298..91f49064a 100644 --- a/libs/SDL2/test/testgles2_sdf.c +++ b/libs/SDL2/test/testgles2_sdf.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -63,11 +63,11 @@ static GLES2_Context ctx; static int LoadContext(GLES2_Context *data) { -#ifdef SDL_VIDEO_DRIVER_UIKIT +#if SDL_VIDEO_DRIVER_UIKIT #define __SDL_NOGETPROCADDR__ -#elif defined(SDL_VIDEO_DRIVER_ANDROID) +#elif SDL_VIDEO_DRIVER_ANDROID #define __SDL_NOGETPROCADDR__ -#elif defined(SDL_VIDEO_DRIVER_PANDORA) +#elif SDL_VIDEO_DRIVER_PANDORA #define __SDL_NOGETPROCADDR__ #endif @@ -94,7 +94,7 @@ quit(int rc) { int i; - if (context) { + if (context != NULL) { for (i = 0; i < state->num_windows; i++) { if (context[i]) { SDL_GL_DeleteContext(context[i]); @@ -445,7 +445,7 @@ int main(int argc, char *argv[]) /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); - if (!state) { + if (state == NULL) { return 1; } for (i = 1; i < argc;) { @@ -502,7 +502,7 @@ int main(int argc, char *argv[]) } context = (SDL_GLContext *)SDL_calloc(state->num_windows, sizeof(*context)); - if (!context) { + if (context == NULL) { SDL_Log("Out of memory!\n"); quit(2); } @@ -543,17 +543,17 @@ int main(int argc, char *argv[]) #if 1 path = GetNearbyFilename(f); - if (!path) { + if (path == NULL) { path = SDL_strdup(f); } - if (!path) { + if (path == NULL) { SDL_Log("out of memory\n"); exit(-1); } tmp = SDL_LoadBMP(path); - if (!tmp) { + if (tmp == NULL) { SDL_Log("missing image file: %s", path); exit(-1); } else { diff --git a/libs/SDL2/test/testhaptic.c b/libs/SDL2/test/testhaptic.c index 56602cafb..fa4186376 100644 --- a/libs/SDL2/test/testhaptic.c +++ b/libs/SDL2/test/testhaptic.c @@ -16,8 +16,6 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND */ #include "SDL.h" -#include - #ifndef SDL_HAPTIC_DISABLED static SDL_Haptic *haptic; @@ -71,7 +69,7 @@ int main(int argc, char **argv) SDL_Log("%d Haptic devices detected.\n", SDL_NumHaptics()); if (SDL_NumHaptics() > 0) { /* We'll just use index or the first force feedback device found */ - if (!name) { + if (name == NULL) { i = (index != -1) ? index : 0; } /* Try to find matching device */ @@ -90,7 +88,7 @@ int main(int argc, char **argv) } haptic = SDL_HapticOpen(i); - if (!haptic) { + if (haptic == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to create the haptic device: %s\n", SDL_GetError()); return 1; @@ -281,7 +279,7 @@ int main(int argc, char **argv) } /* Quit */ - if (haptic) { + if (haptic != NULL) { SDL_HapticClose(haptic); } SDL_Quit(); diff --git a/libs/SDL2/test/testhittesting.c b/libs/SDL2/test/testhittesting.c index 94c5ea9ae..92ddf8c42 100644 --- a/libs/SDL2/test/testhittesting.c +++ b/libs/SDL2/test/testhittesting.c @@ -106,7 +106,7 @@ int main(int argc, char **argv) if (e.key.keysym.sym == SDLK_ESCAPE) { done = 1; } else if (e.key.keysym.sym == SDLK_x) { - if (!areas) { + if (areas == NULL) { areas = drag_areas; numareas = SDL_arraysize(drag_areas); } else { diff --git a/libs/SDL2/test/testhotplug.c b/libs/SDL2/test/testhotplug.c index aca1741d7..1ac73a7fb 100644 --- a/libs/SDL2/test/testhotplug.c +++ b/libs/SDL2/test/testhotplug.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -68,7 +68,7 @@ int main(int argc, char *argv[]) keepGoing = SDL_FALSE; break; case SDL_JOYDEVICEADDED: - if (joystick) { + if (joystick != NULL) { SDL_Log("Only one joystick supported by this test\n"); } else { joystick = SDL_JoystickOpen(event.jdevice.which); diff --git a/libs/SDL2/test/testiconv.c b/libs/SDL2/test/testiconv.c index fcdd72892..b2d13a6aa 100644 --- a/libs/SDL2/test/testiconv.c +++ b/libs/SDL2/test/testiconv.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -61,7 +61,7 @@ int main(int argc, char *argv[]) fname = GetResourceFilename(argc > 1 ? argv[1] : NULL, "utf8.txt"); file = fopen(fname, "rb"); - if (!file) { + if (file == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to open %s\n", fname); return 1; } diff --git a/libs/SDL2/test/testime.c b/libs/SDL2/test/testime.c index fb5756dcb..51f685b1e 100644 --- a/libs/SDL2/test/testime.c +++ b/libs/SDL2/test/testime.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -29,7 +29,7 @@ #ifdef HAVE_SDL_TTF #ifdef __MACOSX__ #define DEFAULT_FONT "/System/Library/Fonts/华文细黑.ttf" -#elif defined(__WIN32__) +#elif __WIN32__ /* Some japanese font present on at least Windows 8.1. */ #define DEFAULT_FONT "C:\\Windows\\Fonts\\yugothic.ttf" #else @@ -97,7 +97,7 @@ static Uint8 validate_hex(const char *cp, size_t len, Uint32 *np) } n = (n << 4) | c; } - if (np) { + if (np != NULL) { *np = n; } return 1; @@ -116,7 +116,7 @@ static int unifont_init(const char *fontname) /* Allocate memory for the glyph data so the file can be closed after initialization. */ unifontGlyph = (struct UnifontGlyph *)SDL_malloc(unifontGlyphSize); - if (!unifontGlyph) { + if (unifontGlyph == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Failed to allocate %d KiB for glyph data.\n", (int)(unifontGlyphSize + 1023) / 1024); return -1; } @@ -124,20 +124,20 @@ static int unifont_init(const char *fontname) /* Allocate memory for texture pointers for all renderers. */ unifontTexture = (SDL_Texture **)SDL_malloc(unifontTextureSize); - if (!unifontTexture) { + if (unifontTexture == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Failed to allocate %d KiB for texture pointer data.\n", (int)(unifontTextureSize + 1023) / 1024); return -1; } SDL_memset(unifontTexture, 0, unifontTextureSize); filename = GetResourceFilename(NULL, fontname); - if (!filename) { + if (filename == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory\n"); return -1; } hexFile = SDL_RWFromFile(filename, "rb"); SDL_free(filename); - if (!hexFile) { + if (hexFile == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Failed to open font file: %s\n", fontname); return -1; } @@ -269,7 +269,7 @@ static int unifont_load_texture(Uint32 textureID) } textureRGBA = (Uint8 *)SDL_malloc(UNIFONT_TEXTURE_SIZE); - if (!textureRGBA) { + if (textureRGBA == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Failed to allocate %d MiB for a texture.\n", UNIFONT_TEXTURE_SIZE / 1024 / 1024); return -1; } @@ -324,7 +324,7 @@ static Sint32 unifont_draw_glyph(Uint32 codepoint, int rendererID, SDL_Rect *dst } } texture = unifontTexture[UNIFONT_NUM_TEXTURES * rendererID + textureID]; - if (texture) { + if (texture != NULL) { const Uint32 cInTex = codepoint % UNIFONT_GLYPHS_IN_TEXTURE; srcrect.x = cInTex % UNIFONT_GLYPHS_IN_ROW * 16; srcrect.y = cInTex / UNIFONT_GLYPHS_IN_ROW * 16; @@ -338,12 +338,12 @@ static void unifont_cleanup() int i, j; for (i = 0; i < state->num_windows; ++i) { SDL_Renderer *renderer = state->renderers[i]; - if (state->windows[i] == NULL || !renderer) { + if (state->windows[i] == NULL || renderer == NULL) { continue; } for (j = 0; j < UNIFONT_NUM_TEXTURES; j++) { SDL_Texture *tex = unifontTexture[UNIFONT_NUM_TEXTURES * i + j]; - if (tex) { + if (tex != NULL) { SDL_DestroyTexture(tex); } } @@ -530,7 +530,7 @@ void _Redraw(int rendererID) if (cursor) { char *p = utf8_advance(markedText, cursor); char c = 0; - if (!p) { + if (p == NULL) { p = &markedText[SDL_strlen(markedText)]; } @@ -626,7 +626,7 @@ int main(int argc, char *argv[]) /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); - if (!state) { + if (state == NULL) { return 1; } for (i = 1; i < argc; i++) { @@ -660,7 +660,7 @@ int main(int argc, char *argv[]) TTF_Init(); font = TTF_OpenFont(fontname, DEFAULT_PTSIZE); - if (!font) { + if (font == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to find font: %s\n", TTF_GetError()); return -1; } diff --git a/libs/SDL2/test/testintersections.c b/libs/SDL2/test/testintersections.c index bb95fbe93..f24d9fbf5 100644 --- a/libs/SDL2/test/testintersections.c +++ b/libs/SDL2/test/testintersections.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -289,7 +289,7 @@ int main(int argc, char *argv[]) /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); - if (!state) { + if (state == NULL) { return 1; } for (i = 1; i < argc;) { diff --git a/libs/SDL2/test/testjoystick.c b/libs/SDL2/test/testjoystick.c index 389858049..adb31dc14 100644 --- a/libs/SDL2/test/testjoystick.c +++ b/libs/SDL2/test/testjoystick.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -117,7 +117,7 @@ void loop(void *arg) case SDL_JOYDEVICEADDED: SDL_Log("Joystick device %d added.\n", (int)event.jdevice.which); - if (!joystick) { + if (joystick == NULL) { joystick = SDL_JoystickOpen(event.jdevice.which); if (joystick) { PrintJoystick(joystick); @@ -296,13 +296,13 @@ int main(int argc, char *argv[]) window = SDL_CreateWindow("Joystick Test", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, SCREEN_WIDTH, SCREEN_HEIGHT, 0); - if (!window) { + if (window == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create window: %s\n", SDL_GetError()); return SDL_FALSE; } screen = SDL_CreateRenderer(window, -1, 0); - if (!screen) { + if (screen == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create renderer: %s\n", SDL_GetError()); SDL_DestroyWindow(window); return SDL_FALSE; diff --git a/libs/SDL2/test/testkeys.c b/libs/SDL2/test/testkeys.c index c7b120b4f..f80f0b9dc 100644 --- a/libs/SDL2/test/testkeys.c +++ b/libs/SDL2/test/testkeys.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/test/testloadso.c b/libs/SDL2/test/testloadso.c index fa6923b97..f404a6813 100644 --- a/libs/SDL2/test/testloadso.c +++ b/libs/SDL2/test/testloadso.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -53,13 +53,13 @@ int main(int argc, char *argv[]) } lib = SDL_LoadObject(libname); - if (!lib) { + if (lib == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_LoadObject('%s') failed: %s\n", libname, SDL_GetError()); retval = 3; } else { fn = (fntype)SDL_LoadFunction(lib, symname); - if (!fn) { + if (fn == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_LoadFunction('%s') failed: %s\n", symname, SDL_GetError()); retval = 4; diff --git a/libs/SDL2/test/testlocale.c b/libs/SDL2/test/testlocale.c index 6e371ca10..f8ff1a37b 100644 --- a/libs/SDL2/test/testlocale.c +++ b/libs/SDL2/test/testlocale.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -17,7 +17,7 @@ static void log_locales(void) { SDL_Locale *locales = SDL_GetPreferredLocales(); - if (!locales) { + if (locales == NULL) { SDL_Log("Couldn't determine locales: %s", SDL_GetError()); } else { SDL_Locale *l; diff --git a/libs/SDL2/test/testlock.c b/libs/SDL2/test/testlock.c index 1af8846fa..544ec322b 100644 --- a/libs/SDL2/test/testlock.c +++ b/libs/SDL2/test/testlock.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -106,7 +106,7 @@ int main(int argc, char *argv[]) SDL_AtomicSet(&doterminate, 0); mutex = SDL_CreateMutex(); - if (!mutex) { + if (mutex == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create mutex: %s\n", SDL_GetError()); exit(1); } diff --git a/libs/SDL2/test/testmessage.c b/libs/SDL2/test/testmessage.c index d3de67ee7..f805f8301 100644 --- a/libs/SDL2/test/testmessage.c +++ b/libs/SDL2/test/testmessage.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/test/testmouse.c b/libs/SDL2/test/testmouse.c index 0583ead5a..d1c4edc06 100644 --- a/libs/SDL2/test/testmouse.c +++ b/libs/SDL2/test/testmouse.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -83,7 +83,7 @@ void DrawObject(SDL_Renderer *renderer, Object *object) void DrawObjects(SDL_Renderer *renderer) { Object *next = objects; - while (next) { + while (next != NULL) { DrawObject(renderer, next); next = next->next; } @@ -93,7 +93,7 @@ void AppendObject(Object *object) { if (objects) { Object *next = objects; - while (next->next) { + while (next->next != NULL) { next = next->next; } next->next = object; @@ -130,7 +130,7 @@ void loop(void *arg) break; case SDL_MOUSEMOTION: - if (!active) { + if (active == NULL) { break; } @@ -139,7 +139,7 @@ void loop(void *arg) break; case SDL_MOUSEBUTTONDOWN: - if (!active) { + if (active == NULL) { active = SDL_calloc(1, sizeof(*active)); active->x1 = active->x2 = event.button.x; active->y1 = active->y2 = event.button.y; @@ -173,7 +173,7 @@ void loop(void *arg) break; case SDL_MOUSEBUTTONUP: - if (!active) { + if (active == NULL) { break; } @@ -266,13 +266,13 @@ int main(int argc, char *argv[]) window = SDL_CreateWindow("Mouse Test", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, SCREEN_WIDTH, SCREEN_HEIGHT, 0); - if (!window) { + if (window == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create window: %s\n", SDL_GetError()); return SDL_FALSE; } renderer = SDL_CreateRenderer(window, -1, 0); - if (!renderer) { + if (renderer == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create renderer: %s\n", SDL_GetError()); SDL_DestroyWindow(window); return SDL_FALSE; diff --git a/libs/SDL2/test/testmultiaudio.c b/libs/SDL2/test/testmultiaudio.c index 593942038..2fd352b52 100644 --- a/libs/SDL2/test/testmultiaudio.c +++ b/libs/SDL2/test/testmultiaudio.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/test/testnative.c b/libs/SDL2/test/testnative.c index ad47e4a07..e803b822d 100644 --- a/libs/SDL2/test/testnative.c +++ b/libs/SDL2/test/testnative.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -47,7 +47,7 @@ static void quit(int rc) { SDL_VideoQuit(); - if (native_window && factory) { + if (native_window != NULL && factory != NULL) { factory->DestroyNativeWindow(native_window); } exit(rc); @@ -119,19 +119,19 @@ int main(int argc, char *argv[]) break; } } - if (!factory) { + if (factory == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't find native window code for %s driver\n", driver); quit(2); } SDL_Log("Creating native window for %s driver\n", driver); native_window = factory->CreateNativeWindow(WINDOW_W, WINDOW_H); - if (!native_window) { + if (native_window == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create native window\n"); quit(3); } window = SDL_CreateWindowFrom(native_window); - if (!window) { + if (window == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create SDL window: %s\n", SDL_GetError()); quit(4); } @@ -139,7 +139,7 @@ int main(int argc, char *argv[]) /* Create the renderer */ renderer = SDL_CreateRenderer(window, -1, 0); - if (!renderer) { + if (renderer == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create renderer: %s\n", SDL_GetError()); quit(5); } @@ -149,7 +149,7 @@ int main(int argc, char *argv[]) SDL_RenderClear(renderer); sprite = LoadTexture(renderer, "icon.bmp", SDL_TRUE, NULL, NULL); - if (!sprite) { + if (sprite == NULL) { quit(6); } @@ -158,7 +158,7 @@ int main(int argc, char *argv[]) SDL_QueryTexture(sprite, NULL, NULL, &sprite_w, &sprite_h); positions = (SDL_Rect *)SDL_malloc(NUM_SPRITES * sizeof(SDL_Rect)); velocities = (SDL_Rect *)SDL_malloc(NUM_SPRITES * sizeof(SDL_Rect)); - if (!positions || !velocities) { + if (positions == NULL || velocities == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!\n"); quit(2); } diff --git a/libs/SDL2/test/testnative.h b/libs/SDL2/test/testnative.h index e2643902e..2ba900586 100644 --- a/libs/SDL2/test/testnative.h +++ b/libs/SDL2/test/testnative.h @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/test/testnativeos2.c b/libs/SDL2/test/testnativeos2.c index bbdbe9025..e0f249121 100644 --- a/libs/SDL2/test/testnativeos2.c +++ b/libs/SDL2/test/testnativeos2.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/test/testnativew32.c b/libs/SDL2/test/testnativew32.c index dfd0b63f4..e1574583d 100644 --- a/libs/SDL2/test/testnativew32.c +++ b/libs/SDL2/test/testnativew32.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -66,7 +66,7 @@ CreateWindowNative(int w, int h) CreateWindow("SDL Test", "", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, w, h, NULL, NULL, GetModuleHandle(NULL), NULL); - if (!hwnd) { + if (hwnd == NULL) { MessageBox(NULL, "Window Creation Failed!", "Error!", MB_ICONEXCLAMATION | MB_OK); return 0; diff --git a/libs/SDL2/test/testnativex11.c b/libs/SDL2/test/testnativex11.c index a891f466e..95dc3d644 100644 --- a/libs/SDL2/test/testnativex11.c +++ b/libs/SDL2/test/testnativex11.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/test/testoffscreen.c b/libs/SDL2/test/testoffscreen.c index 09ef7fcdd..fa511e8ce 100644 --- a/libs/SDL2/test/testoffscreen.c +++ b/libs/SDL2/test/testoffscreen.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -115,14 +115,14 @@ int main(int argc, char *argv[]) SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, width, height, 0); - if (!window) { + if (window == NULL) { SDL_Log("Couldn't create window: %s\n", SDL_GetError()); return SDL_FALSE; } renderer = SDL_CreateRenderer(window, -1, 0); - if (!renderer) { + if (renderer == NULL) { SDL_Log("Couldn't create renderer: %s\n", SDL_GetError()); return SDL_FALSE; diff --git a/libs/SDL2/test/testoverlay2.c b/libs/SDL2/test/testoverlay2.c index ccfa8e5b4..a5dba6863 100644 --- a/libs/SDL2/test/testoverlay2.c +++ b/libs/SDL2/test/testoverlay2.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -311,21 +311,21 @@ int main(int argc, char **argv) } RawMooseData = (Uint8 *)SDL_malloc(MOOSEFRAME_SIZE * MOOSEFRAMES_COUNT); - if (!RawMooseData) { + if (RawMooseData == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Can't allocate memory for movie !\n"); quit(1); } /* load the trojan moose images */ filename = GetResourceFilename(NULL, "moose.dat"); - if (!filename) { + if (filename == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory\n"); SDL_free(RawMooseData); return -1; } handle = SDL_RWFromFile(filename, "rb"); SDL_free(filename); - if (!handle) { + if (handle == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Can't find the file moose.dat !\n"); SDL_free(RawMooseData); quit(2); @@ -343,21 +343,21 @@ int main(int argc, char **argv) SDL_WINDOWPOS_UNDEFINED, window_w, window_h, SDL_WINDOW_RESIZABLE); - if (!window) { + if (window == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't set create window: %s\n", SDL_GetError()); SDL_free(RawMooseData); quit(4); } renderer = SDL_CreateRenderer(window, -1, 0); - if (!renderer) { + if (renderer == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't set create renderer: %s\n", SDL_GetError()); SDL_free(RawMooseData); quit(4); } MooseTexture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_YV12, SDL_TEXTUREACCESS_STREAMING, MOOSEPIC_W, MOOSEPIC_H); - if (!MooseTexture) { + if (MooseTexture == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't set create texture: %s\n", SDL_GetError()); SDL_free(RawMooseData); quit(5); diff --git a/libs/SDL2/test/testplatform.c b/libs/SDL2/test/testplatform.c index 353758a7d..7e89d2f81 100644 --- a/libs/SDL2/test/testplatform.c +++ b/libs/SDL2/test/testplatform.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -366,7 +366,7 @@ int Test64Bit(SDL_bool verbose) LL_Test *t; int failed = 0; - for (t = LL_Tests; t->routine; t++) { + for (t = LL_Tests; t->routine != NULL; t++) { unsigned long long result = 0; unsigned int *al = (unsigned int *)&t->a; unsigned int *bl = (unsigned int *)&t->b; diff --git a/libs/SDL2/test/testpower.c b/libs/SDL2/test/testpower.c index 1c13b4dba..af60258d7 100644 --- a/libs/SDL2/test/testpower.c +++ b/libs/SDL2/test/testpower.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/test/testqsort.c b/libs/SDL2/test/testqsort.c index 9c1f7646d..271671e91 100644 --- a/libs/SDL2/test/testqsort.c +++ b/libs/SDL2/test/testqsort.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/test/testrelative.c b/libs/SDL2/test/testrelative.c index 3f777cd83..88ed0bf5a 100644 --- a/libs/SDL2/test/testrelative.c +++ b/libs/SDL2/test/testrelative.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -91,7 +91,7 @@ int main(int argc, char *argv[]) /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); - if (!state) { + if (state == NULL) { return 1; } for (i = 1; i < argc; ++i) { diff --git a/libs/SDL2/test/testrendercopyex.c b/libs/SDL2/test/testrendercopyex.c index 832101aa3..de7bc019a 100644 --- a/libs/SDL2/test/testrendercopyex.c +++ b/libs/SDL2/test/testrendercopyex.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -121,7 +121,7 @@ int main(int argc, char *argv[]) /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); - if (!state) { + if (state == NULL) { return 1; } diff --git a/libs/SDL2/test/testrendertarget.c b/libs/SDL2/test/testrendertarget.c index 9693df4f8..1ae609987 100644 --- a/libs/SDL2/test/testrendertarget.c +++ b/libs/SDL2/test/testrendertarget.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -138,7 +138,7 @@ Draw(DrawState *s) SDL_RenderGetViewport(s->renderer, &viewport); target = SDL_CreateTexture(s->renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_TARGET, viewport.w, viewport.h); - if (!target) { + if (target == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create render target texture: %s\n", SDL_GetError()); return SDL_FALSE; } @@ -214,7 +214,7 @@ int main(int argc, char *argv[]) /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); - if (!state) { + if (state == NULL) { return 1; } for (i = 1; i < argc;) { diff --git a/libs/SDL2/test/testresample.c b/libs/SDL2/test/testresample.c index 21ff8e170..8bb603ac2 100644 --- a/libs/SDL2/test/testresample.c +++ b/libs/SDL2/test/testresample.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -57,7 +57,7 @@ int main(int argc, char **argv) cvt.len = len; cvt.buf = (Uint8 *)SDL_malloc((size_t)len * cvt.len_mult); - if (!cvt.buf) { + if (cvt.buf == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory.\n"); SDL_FreeWAV(data); SDL_Quit(); @@ -75,7 +75,7 @@ int main(int argc, char **argv) /* write out a WAV header... */ io = SDL_RWFromFile(argv[2], "wb"); - if (!io) { + if (io == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "fopen('%s') failed: %s\n", argv[2], SDL_GetError()); SDL_free(cvt.buf); SDL_FreeWAV(data); diff --git a/libs/SDL2/test/testrumble.c b/libs/SDL2/test/testrumble.c index 401b7605e..d6288d592 100644 --- a/libs/SDL2/test/testrumble.c +++ b/libs/SDL2/test/testrumble.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -71,7 +71,7 @@ int main(int argc, char **argv) SDL_Log("%d Haptic devices detected.\n", SDL_NumHaptics()); if (SDL_NumHaptics() > 0) { /* We'll just use index or the first force feedback device found */ - if (!name) { + if (name == NULL) { i = (index != -1) ? index : 0; } /* Try to find matching device */ @@ -90,7 +90,7 @@ int main(int argc, char **argv) } haptic = SDL_HapticOpen(i); - if (!haptic) { + if (haptic == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to create the haptic device: %s\n", SDL_GetError()); return 1; @@ -129,7 +129,7 @@ int main(int argc, char **argv) SDL_Delay(2000); /* Quit */ - if (haptic) { + if (haptic != NULL) { SDL_HapticClose(haptic); } SDL_Quit(); diff --git a/libs/SDL2/test/testscale.c b/libs/SDL2/test/testscale.c index 3659c9149..dca3d0960 100644 --- a/libs/SDL2/test/testscale.c +++ b/libs/SDL2/test/testscale.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -111,7 +111,7 @@ int main(int argc, char *argv[]) /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); - if (!state) { + if (state == NULL) { return 1; } diff --git a/libs/SDL2/test/testsem.c b/libs/SDL2/test/testsem.c index 5740833f4..c0036e882 100644 --- a/libs/SDL2/test/testsem.c +++ b/libs/SDL2/test/testsem.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/test/testsensor.c b/libs/SDL2/test/testsensor.c index 2b9af5835..3da7e015e 100644 --- a/libs/SDL2/test/testsensor.c +++ b/libs/SDL2/test/testsensor.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -36,7 +36,7 @@ static const char *GetSensorTypeString(SDL_SensorType type) static void HandleSensorEvent(SDL_SensorEvent *event) { SDL_Sensor *sensor = SDL_SensorFromInstanceID(event->which); - if (!sensor) { + if (sensor == NULL) { SDL_Log("Couldn't get sensor for sensor event\n"); return; } @@ -78,7 +78,7 @@ int main(int argc, char **argv) if (SDL_SensorGetDeviceType(i) != SDL_SENSOR_UNKNOWN) { SDL_Sensor *sensor = SDL_SensorOpen(i); - if (!sensor) { + if (sensor == NULL) { SDL_Log("Couldn't open sensor %" SDL_PRIs32 ": %s\n", SDL_SensorGetDeviceInstanceID(i), SDL_GetError()); } else { ++num_opened; diff --git a/libs/SDL2/test/testshader.c b/libs/SDL2/test/testshader.c index 48535dca7..2371fcefb 100644 --- a/libs/SDL2/test/testshader.c +++ b/libs/SDL2/test/testshader.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -109,36 +109,36 @@ static ShaderData shaders[NUM_SHADERS] = { "}" }, }; -static PFNGLATTACHOBJECTARBPROC pglAttachObjectARB; -static PFNGLCOMPILESHADERARBPROC pglCompileShaderARB; -static PFNGLCREATEPROGRAMOBJECTARBPROC pglCreateProgramObjectARB; -static PFNGLCREATESHADEROBJECTARBPROC pglCreateShaderObjectARB; -static PFNGLDELETEOBJECTARBPROC pglDeleteObjectARB; -static PFNGLGETINFOLOGARBPROC pglGetInfoLogARB; -static PFNGLGETOBJECTPARAMETERIVARBPROC pglGetObjectParameterivARB; -static PFNGLGETUNIFORMLOCATIONARBPROC pglGetUniformLocationARB; -static PFNGLLINKPROGRAMARBPROC pglLinkProgramARB; -static PFNGLSHADERSOURCEARBPROC pglShaderSourceARB; -static PFNGLUNIFORM1IARBPROC pglUniform1iARB; -static PFNGLUSEPROGRAMOBJECTARBPROC pglUseProgramObjectARB; +static PFNGLATTACHOBJECTARBPROC glAttachObjectARB; +static PFNGLCOMPILESHADERARBPROC glCompileShaderARB; +static PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB; +static PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB; +static PFNGLDELETEOBJECTARBPROC glDeleteObjectARB; +static PFNGLGETINFOLOGARBPROC glGetInfoLogARB; +static PFNGLGETOBJECTPARAMETERIVARBPROC glGetObjectParameterivARB; +static PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB; +static PFNGLLINKPROGRAMARBPROC glLinkProgramARB; +static PFNGLSHADERSOURCEARBPROC glShaderSourceARB; +static PFNGLUNIFORM1IARBPROC glUniform1iARB; +static PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB; static SDL_bool CompileShader(GLhandleARB shader, const char *source) { GLint status = 0; - pglShaderSourceARB(shader, 1, &source, NULL); - pglCompileShaderARB(shader); - pglGetObjectParameterivARB(shader, GL_OBJECT_COMPILE_STATUS_ARB, &status); + glShaderSourceARB(shader, 1, &source, NULL); + glCompileShaderARB(shader); + glGetObjectParameterivARB(shader, GL_OBJECT_COMPILE_STATUS_ARB, &status); if (status == 0) { GLint length = 0; char *info; - pglGetObjectParameterivARB(shader, GL_OBJECT_INFO_LOG_LENGTH_ARB, &length); + glGetObjectParameterivARB(shader, GL_OBJECT_INFO_LOG_LENGTH_ARB, &length); info = (char *)SDL_malloc((size_t)length + 1); - if (!info) { + if (info == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!"); } else { - pglGetInfoLogARB(shader, length, NULL, info); + glGetInfoLogARB(shader, length, NULL, info); SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to compile shader:\n%s\n%s", source, info); SDL_free(info); } @@ -152,21 +152,21 @@ static SDL_bool LinkProgram(ShaderData *data) { GLint status = 0; - pglAttachObjectARB(data->program, data->vert_shader); - pglAttachObjectARB(data->program, data->frag_shader); - pglLinkProgramARB(data->program); + glAttachObjectARB(data->program, data->vert_shader); + glAttachObjectARB(data->program, data->frag_shader); + glLinkProgramARB(data->program); - pglGetObjectParameterivARB(data->program, GL_OBJECT_LINK_STATUS_ARB, &status); + glGetObjectParameterivARB(data->program, GL_OBJECT_LINK_STATUS_ARB, &status); if (status == 0) { GLint length = 0; char *info; - pglGetObjectParameterivARB(data->program, GL_OBJECT_INFO_LOG_LENGTH_ARB, &length); + glGetObjectParameterivARB(data->program, GL_OBJECT_INFO_LOG_LENGTH_ARB, &length); info = (char *)SDL_malloc((size_t)length + 1); - if (!info) { + if (info == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!"); } else { - pglGetInfoLogARB(data->program, length, NULL, info); + glGetInfoLogARB(data->program, length, NULL, info); SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to link program:\n%s", info); SDL_free(info); } @@ -185,16 +185,16 @@ static SDL_bool CompileShaderProgram(ShaderData *data) glGetError(); /* Create one program object to rule them all */ - data->program = pglCreateProgramObjectARB(); + data->program = glCreateProgramObjectARB(); /* Create the vertex shader */ - data->vert_shader = pglCreateShaderObjectARB(GL_VERTEX_SHADER_ARB); + data->vert_shader = glCreateShaderObjectARB(GL_VERTEX_SHADER_ARB); if (!CompileShader(data->vert_shader, data->vert_source)) { return SDL_FALSE; } /* Create the fragment shader */ - data->frag_shader = pglCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB); + data->frag_shader = glCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB); if (!CompileShader(data->frag_shader, data->frag_source)) { return SDL_FALSE; } @@ -205,16 +205,16 @@ static SDL_bool CompileShaderProgram(ShaderData *data) } /* Set up some uniform variables */ - pglUseProgramObjectARB(data->program); + glUseProgramObjectARB(data->program); for (i = 0; i < num_tmus_bound; ++i) { char tex_name[5]; (void)SDL_snprintf(tex_name, SDL_arraysize(tex_name), "tex%d", i); - location = pglGetUniformLocationARB(data->program, tex_name); + location = glGetUniformLocationARB(data->program, tex_name); if (location >= 0) { - pglUniform1iARB(location, i); + glUniform1iARB(location, i); } } - pglUseProgramObjectARB(0); + glUseProgramObjectARB(0); return (glGetError() == GL_NO_ERROR) ? SDL_TRUE : SDL_FALSE; } @@ -222,9 +222,9 @@ static SDL_bool CompileShaderProgram(ShaderData *data) static void DestroyShaderProgram(ShaderData *data) { if (shaders_supported) { - pglDeleteObjectARB(data->vert_shader); - pglDeleteObjectARB(data->frag_shader); - pglDeleteObjectARB(data->program); + glDeleteObjectARB(data->vert_shader); + glDeleteObjectARB(data->frag_shader); + glDeleteObjectARB(data->program); } } @@ -238,30 +238,30 @@ static SDL_bool InitShaders() SDL_GL_ExtensionSupported("GL_ARB_shading_language_100") && SDL_GL_ExtensionSupported("GL_ARB_vertex_shader") && SDL_GL_ExtensionSupported("GL_ARB_fragment_shader")) { - pglAttachObjectARB = (PFNGLATTACHOBJECTARBPROC)SDL_GL_GetProcAddress("glAttachObjectARB"); - pglCompileShaderARB = (PFNGLCOMPILESHADERARBPROC)SDL_GL_GetProcAddress("glCompileShaderARB"); - pglCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC)SDL_GL_GetProcAddress("glCreateProgramObjectARB"); - pglCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)SDL_GL_GetProcAddress("glCreateShaderObjectARB"); - pglDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC)SDL_GL_GetProcAddress("glDeleteObjectARB"); - pglGetInfoLogARB = (PFNGLGETINFOLOGARBPROC)SDL_GL_GetProcAddress("glGetInfoLogARB"); - pglGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC)SDL_GL_GetProcAddress("glGetObjectParameterivARB"); - pglGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC)SDL_GL_GetProcAddress("glGetUniformLocationARB"); - pglLinkProgramARB = (PFNGLLINKPROGRAMARBPROC)SDL_GL_GetProcAddress("glLinkProgramARB"); - pglShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)SDL_GL_GetProcAddress("glShaderSourceARB"); - pglUniform1iARB = (PFNGLUNIFORM1IARBPROC)SDL_GL_GetProcAddress("glUniform1iARB"); - pglUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC)SDL_GL_GetProcAddress("glUseProgramObjectARB"); - if (pglAttachObjectARB && - pglCompileShaderARB && - pglCreateProgramObjectARB && - pglCreateShaderObjectARB && - pglDeleteObjectARB && - pglGetInfoLogARB && - pglGetObjectParameterivARB && - pglGetUniformLocationARB && - pglLinkProgramARB && - pglShaderSourceARB && - pglUniform1iARB && - pglUseProgramObjectARB) { + glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC)SDL_GL_GetProcAddress("glAttachObjectARB"); + glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC)SDL_GL_GetProcAddress("glCompileShaderARB"); + glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC)SDL_GL_GetProcAddress("glCreateProgramObjectARB"); + glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)SDL_GL_GetProcAddress("glCreateShaderObjectARB"); + glDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC)SDL_GL_GetProcAddress("glDeleteObjectARB"); + glGetInfoLogARB = (PFNGLGETINFOLOGARBPROC)SDL_GL_GetProcAddress("glGetInfoLogARB"); + glGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC)SDL_GL_GetProcAddress("glGetObjectParameterivARB"); + glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC)SDL_GL_GetProcAddress("glGetUniformLocationARB"); + glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC)SDL_GL_GetProcAddress("glLinkProgramARB"); + glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)SDL_GL_GetProcAddress("glShaderSourceARB"); + glUniform1iARB = (PFNGLUNIFORM1IARBPROC)SDL_GL_GetProcAddress("glUniform1iARB"); + glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC)SDL_GL_GetProcAddress("glUseProgramObjectARB"); + if (glAttachObjectARB && + glCompileShaderARB && + glCreateProgramObjectARB && + glCreateShaderObjectARB && + glDeleteObjectARB && + glGetInfoLogARB && + glGetObjectParameterivARB && + glGetUniformLocationARB && + glLinkProgramARB && + glShaderSourceARB && + glUniform1iARB && + glUseProgramObjectARB) { shaders_supported = SDL_TRUE; } } @@ -329,7 +329,7 @@ SDL_GL_LoadTexture(SDL_Surface *surface, GLfloat *texcoord) 0x00FF0000, 0x0000FF00, 0x000000FF #endif ); - if (!image) { + if (image == NULL) { return 0; } @@ -420,7 +420,7 @@ void DrawGLScene(SDL_Window *window, GLuint texture, GLfloat *texcoord) glBindTexture(GL_TEXTURE_2D, texture); glColor3f(1.0f, 1.0f, 1.0f); if (shaders_supported) { - pglUseProgramObjectARB(shaders[current_shader].program); + glUseProgramObjectARB(shaders[current_shader].program); } glBegin(GL_QUADS); /* start drawing a polygon (4 sided) */ @@ -435,7 +435,7 @@ void DrawGLScene(SDL_Window *window, GLuint texture, GLfloat *texcoord) glEnd(); /* done with the polygon */ if (shaders_supported) { - pglUseProgramObjectARB(0); + glUseProgramObjectARB(0); } glDisable(GL_TEXTURE_2D); @@ -462,7 +462,7 @@ int main(int argc, char **argv) /* Create a 640x480 OpenGL screen */ window = SDL_CreateWindow("Shader Demo", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, SDL_WINDOW_OPENGL); - if (!window) { + if (window == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to create OpenGL window: %s\n", SDL_GetError()); SDL_Quit(); exit(2); @@ -475,7 +475,7 @@ int main(int argc, char **argv) } surface = SDL_LoadBMP("icon.bmp"); - if (!surface) { + if (surface == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to load icon.bmp: %s\n", SDL_GetError()); SDL_Quit(); exit(3); diff --git a/libs/SDL2/test/testshape.c b/libs/SDL2/test/testshape.c index 112ec0c60..4e3c12cdd 100644 --- a/libs/SDL2/test/testshape.c +++ b/libs/SDL2/test/testshape.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -71,7 +71,7 @@ int main(int argc, char **argv) num_pictures = argc - 1; pictures = (LoadedPicture *)SDL_malloc(sizeof(LoadedPicture) * num_pictures); - if (!pictures) { + if (pictures == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Could not allocate memory."); exit(1); } @@ -106,7 +106,7 @@ int main(int argc, char **argv) SHAPED_WINDOW_DIMENSION, SHAPED_WINDOW_DIMENSION, 0); SDL_SetWindowPosition(window, SHAPED_WINDOW_X, SHAPED_WINDOW_Y); - if (!window) { + if (window == NULL) { for (i = 0; i < num_pictures; i++) { SDL_FreeSurface(pictures[i].surface); } @@ -116,7 +116,7 @@ int main(int argc, char **argv) exit(-4); } renderer = SDL_CreateRenderer(window, -1, 0); - if (!renderer) { + if (renderer == NULL) { SDL_DestroyWindow(window); for (i = 0; i < num_pictures; i++) { SDL_FreeSurface(pictures[i].surface); diff --git a/libs/SDL2/test/testsprite2.c b/libs/SDL2/test/testsprite2.c index 71b565678..89037fd09 100644 --- a/libs/SDL2/test/testsprite2.c +++ b/libs/SDL2/test/testsprite2.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -392,30 +392,22 @@ void MoveSprites(SDL_Renderer *renderer, SDL_Texture *sprite) SDL_RenderPresent(renderer); } -static void MoveAllSprites() -{ - int i; - - for (i = 0; i < state->num_windows; ++i) { - if (state->windows[i] == NULL) { - continue; - } - MoveSprites(state->renderers[i], sprites[i]); - } -} - void loop() { Uint32 now; + int i; SDL_Event event; /* Check for events */ while (SDL_PollEvent(&event)) { SDLTest_CommonEvent(state, &event, &done); } - - MoveAllSprites(); - + for (i = 0; i < state->num_windows; ++i) { + if (state->windows[i] == NULL) { + continue; + } + MoveSprites(state->renderers[i], sprites[i]); + } #ifdef __EMSCRIPTEN__ if (done) { emscripten_cancel_main_loop(); @@ -434,14 +426,6 @@ void loop() } } -static int SDLCALL ExposeEventWatcher(void *userdata, SDL_Event *event) -{ - if (event->type == SDL_WINDOWEVENT && event->window.event == SDL_WINDOWEVENT_EXPOSED) { - MoveAllSprites(); - } - return 0; -} - int main(int argc, char *argv[]) { int i; @@ -453,7 +437,7 @@ int main(int argc, char *argv[]) /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); - if (!state) { + if (state == NULL) { return 1; } @@ -541,7 +525,7 @@ int main(int argc, char *argv[]) /* Create the windows, initialize the renderers, and load the textures */ sprites = (SDL_Texture **)SDL_malloc(state->num_windows * sizeof(*sprites)); - if (!sprites) { + if (sprites == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!\n"); quit(2); } @@ -557,7 +541,7 @@ int main(int argc, char *argv[]) /* Allocate memory for the sprite info */ positions = (SDL_Rect *)SDL_malloc(num_sprites * sizeof(SDL_Rect)); velocities = (SDL_Rect *)SDL_malloc(num_sprites * sizeof(SDL_Rect)); - if (!positions || !velocities) { + if (positions == NULL || velocities == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!\n"); quit(2); } @@ -584,9 +568,6 @@ int main(int argc, char *argv[]) } } - /* Add an event watcher to redraw from within modal window resize/move loops */ - SDL_AddEventWatch(ExposeEventWatcher, NULL); - /* Main render loop */ frames = 0; next_fps_check = SDL_GetTicks() + fps_check_delay; diff --git a/libs/SDL2/test/testspriteminimal.c b/libs/SDL2/test/testspriteminimal.c index b81101eb5..16b4fa4a3 100644 --- a/libs/SDL2/test/testspriteminimal.c +++ b/libs/SDL2/test/testspriteminimal.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -109,7 +109,7 @@ int main(int argc, char *argv[]) sprite = LoadTexture(renderer, "icon.bmp", SDL_TRUE, &sprite_w, &sprite_h); - if (!sprite) { + if (sprite == NULL) { quit(2); } diff --git a/libs/SDL2/test/teststreaming.c b/libs/SDL2/test/teststreaming.c index 45202a779..15c1aefea 100644 --- a/libs/SDL2/test/teststreaming.c +++ b/libs/SDL2/test/teststreaming.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -141,13 +141,13 @@ int main(int argc, char **argv) /* load the moose images */ filename = GetResourceFilename(NULL, "moose.dat"); - if (!filename) { + if (filename == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory\n"); return -1; } handle = SDL_RWFromFile(filename, "rb"); SDL_free(filename); - if (!handle) { + if (handle == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Can't find the file moose.dat !\n"); quit(2); } @@ -160,19 +160,19 @@ int main(int argc, char **argv) SDL_WINDOWPOS_UNDEFINED, MOOSEPIC_W * 4, MOOSEPIC_H * 4, SDL_WINDOW_RESIZABLE); - if (!window) { + if (window == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't set create window: %s\n", SDL_GetError()); quit(3); } renderer = SDL_CreateRenderer(window, -1, 0); - if (!renderer) { + if (renderer == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't set create renderer: %s\n", SDL_GetError()); quit(4); } MooseTexture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, MOOSEPIC_W, MOOSEPIC_H); - if (!MooseTexture) { + if (MooseTexture == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't set create texture: %s\n", SDL_GetError()); quit(5); } diff --git a/libs/SDL2/test/testsurround.c b/libs/SDL2/test/testsurround.c index b7dc7d781..b28436977 100644 --- a/libs/SDL2/test/testsurround.c +++ b/libs/SDL2/test/testsurround.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/test/testthread.c b/libs/SDL2/test/testthread.c index 5ceac05ff..f6d967560 100644 --- a/libs/SDL2/test/testthread.c +++ b/libs/SDL2/test/testthread.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -114,7 +114,7 @@ int main(int argc, char *argv[]) alive = 1; thread = SDL_CreateThread(ThreadFunc, "One", "#1"); - if (!thread) { + if (thread == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create thread: %s\n", SDL_GetError()); quit(1); } @@ -128,7 +128,7 @@ int main(int argc, char *argv[]) alive = 1; (void)signal(SIGTERM, killed); thread = SDL_CreateThread(ThreadFunc, "Two", "#2"); - if (!thread) { + if (thread == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create thread: %s\n", SDL_GetError()); quit(1); } diff --git a/libs/SDL2/test/testtimer.c b/libs/SDL2/test/testtimer.c index eea9730c5..54a903ad0 100644 --- a/libs/SDL2/test/testtimer.c +++ b/libs/SDL2/test/testtimer.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -18,38 +18,9 @@ #include #include "SDL.h" -#include "SDL_test.h" #define DEFAULT_RESOLUTION 1 -static int test_sdl_delay_within_bounds(void) { - const int testDelay = 100; - const int marginOfError = 25; - Uint64 result; - Uint64 result2; - Sint64 difference; - - SDLTest_ResetAssertSummary(); - - /* Get ticks count - should be non-zero by now */ - result = SDL_GetTicks(); - SDLTest_AssertPass("Call to SDL_GetTicks()"); - SDLTest_AssertCheck(result > 0, "Check result value, expected: >0, got: %" SDL_PRIu64, result); - - /* Delay a bit longer and measure ticks and verify difference */ - SDL_Delay(testDelay); - SDLTest_AssertPass("Call to SDL_Delay(%d)", testDelay); - result2 = SDL_GetTicks(); - SDLTest_AssertPass("Call to SDL_GetTicks()"); - SDLTest_AssertCheck(result2 > 0, "Check result value, expected: >0, got: %" SDL_PRIu64, result2); - difference = result2 - result; - SDLTest_AssertCheck(difference > (testDelay - marginOfError), "Check difference, expected: >%d, got: %" SDL_PRIu64, testDelay - marginOfError, difference); - /* Disabled because this might fail on non-interactive systems. */ - SDLTest_AssertCheck(difference < (testDelay + marginOfError), "Check difference, expected: <%d, got: %" SDL_PRIu64, testDelay + marginOfError, difference); - - return SDLTest_AssertSummaryToTestResult() == TEST_RESULT_PASSED ? 0 : 1; -} - static int ticks = 0; static Uint32 SDLCALL @@ -68,43 +39,15 @@ callback(Uint32 interval, void *param) int main(int argc, char *argv[]) { - int i; - int desired = -1; + int i, desired; SDL_TimerID t1, t2, t3; Uint64 start64, now64; Uint32 start32, now32; Uint64 start, now; - SDL_bool run_interactive_tests = SDL_FALSE; - int return_code = 0; /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); - /* Parse commandline */ - for (i = 1; i < argc;) { - int consumed = 0; - - if (!consumed) { - if (SDL_strcmp(argv[i], "--interactive") == 0) { - run_interactive_tests = SDL_TRUE; - consumed = 1; - } else if (desired < 0) { - char *endptr; - - desired = SDL_strtoul(argv[i], &endptr, 0); - if (desired != 0 && endptr != argv[i] && *endptr == '\0') { - consumed = 1; - } - } - } - if (consumed <= 0) { - SDL_Log("Usage: %s [--interactive] [interval]", argv[0]); - return 1; - } - - i += consumed; - } - if (SDL_Init(SDL_INIT_TIMER) < 0) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); return 1; @@ -131,11 +74,14 @@ int main(int argc, char *argv[]) } } - if (desired < 0) { + /* Start the timer */ + desired = 0; + if (argv[1]) { + desired = SDL_atoi(argv[1]); + } + if (desired == 0) { desired = DEFAULT_RESOLUTION; } - - /* Start the timer */ t1 = SDL_AddTimer(desired, ticktock, NULL); /* Wait 10 seconds */ @@ -156,17 +102,14 @@ int main(int argc, char *argv[]) t1 = SDL_AddTimer(100, callback, (void *)1); if (!t1) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Could not create timer 1: %s\n", SDL_GetError()); - return_code = 1; } t2 = SDL_AddTimer(50, callback, (void *)2); if (!t2) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Could not create timer 2: %s\n", SDL_GetError()); - return_code = 1; } t3 = SDL_AddTimer(233, callback, (void *)3); if (!t3) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Could not create timer 3: %s\n", SDL_GetError()); - return_code = 1; } /* Wait 10 seconds */ @@ -198,11 +141,8 @@ int main(int argc, char *argv[]) now32 = SDL_GetTicks(); SDL_Log("Delay 1 second = %d ms in ticks, %d ms in ticks64, %f ms according to performance counter\n", (int)(now32 - start32), (int)(now64 - start64), (double)((now - start) * 1000) / SDL_GetPerformanceFrequency()); - if (run_interactive_tests) { - return_code |= test_sdl_delay_within_bounds(); - } SDL_Quit(); - return return_code; + return 0; } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/libs/SDL2/test/testurl.c b/libs/SDL2/test/testurl.c index 2008186f3..ef22083ff 100644 --- a/libs/SDL2/test/testurl.c +++ b/libs/SDL2/test/testurl.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/test/testutils.c b/libs/SDL2/test/testutils.c index 3b76ea833..20efef027 100644 --- a/libs/SDL2/test/testutils.c +++ b/libs/SDL2/test/testutils.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 Sam Lantinga Copyright 2022 Collabora Ltd. This software is provided 'as-is', without any express or implied @@ -28,13 +28,13 @@ GetNearbyFilename(const char *file) base = SDL_GetBasePath(); - if (base) { + if (base != NULL) { SDL_RWops *rw; size_t len = SDL_strlen(base) + SDL_strlen(file) + 1; path = SDL_malloc(len); - if (!path) { + if (path == NULL) { SDL_free(base); SDL_OutOfMemory(); return NULL; @@ -54,7 +54,7 @@ GetNearbyFilename(const char *file) } path = SDL_strdup(file); - if (!path) { + if (path == NULL) { SDL_OutOfMemory(); } return path; @@ -72,10 +72,10 @@ GetNearbyFilename(const char *file) char * GetResourceFilename(const char *user_specified, const char *def) { - if (user_specified) { + if (user_specified != NULL) { char *ret = SDL_strdup(user_specified); - if (!ret) { + if (ret == NULL) { SDL_OutOfMemory(); } @@ -105,12 +105,12 @@ LoadTexture(SDL_Renderer *renderer, const char *file, SDL_bool transparent, path = GetNearbyFilename(file); - if (path) { + if (path != NULL) { file = path; } temp = SDL_LoadBMP(file); - if (!temp) { + if (temp == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s", file, SDL_GetError()); } else { /* Set transparent pixel as the pixel at (0,0) */ @@ -137,16 +137,16 @@ LoadTexture(SDL_Renderer *renderer, const char *file, SDL_bool transparent, } } - if (width_out) { + if (width_out != NULL) { *width_out = temp->w; } - if (height_out) { + if (height_out != NULL) { *height_out = temp->h; } texture = SDL_CreateTextureFromSurface(renderer, temp); - if (!texture) { + if (texture == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create texture: %s\n", SDL_GetError()); } } diff --git a/libs/SDL2/test/testutils.h b/libs/SDL2/test/testutils.h index a10aaadd3..1f69673ce 100644 --- a/libs/SDL2/test/testutils.h +++ b/libs/SDL2/test/testutils.h @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 Sam Lantinga Copyright 2022 Collabora Ltd. This software is provided 'as-is', without any express or implied diff --git a/libs/SDL2/test/testver.c b/libs/SDL2/test/testver.c index 409b1f12f..eeecb14a6 100644 --- a/libs/SDL2/test/testver.c +++ b/libs/SDL2/test/testver.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/test/testviewport.c b/libs/SDL2/test/testviewport.c index ee76a3782..932f24832 100644 --- a/libs/SDL2/test/testviewport.c +++ b/libs/SDL2/test/testviewport.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -152,7 +152,7 @@ int main(int argc, char *argv[]) /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); - if (!state) { + if (state == NULL) { return 1; } @@ -180,7 +180,7 @@ int main(int argc, char *argv[]) sprite = LoadTexture(state->renderers[0], "icon.bmp", SDL_TRUE, &sprite_w, &sprite_h); - if (!sprite) { + if (sprite == NULL) { quit(2); } diff --git a/libs/SDL2/test/testvulkan.c b/libs/SDL2/test/testvulkan.c index 8a4ac8934..acdde28fd 100644 --- a/libs/SDL2/test/testvulkan.c +++ b/libs/SDL2/test/testvulkan.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -236,7 +236,7 @@ static void createInstance(void) quit(2); } extensions = (const char **)SDL_malloc(sizeof(const char *) * extensionCount); - if (!extensions) { + if (extensions == NULL) { SDL_OutOfMemory(); quit(2); } @@ -312,7 +312,7 @@ static void findPhysicalDevice(void) quit(2); } physicalDevices = (VkPhysicalDevice *)SDL_malloc(sizeof(VkPhysicalDevice) * physicalDeviceCount); - if (!physicalDevices) { + if (physicalDevices == NULL) { SDL_OutOfMemory(); quit(2); } @@ -346,7 +346,7 @@ static void findPhysicalDevice(void) SDL_free(queueFamiliesProperties); queueFamiliesPropertiesAllocatedSize = queueFamiliesCount; queueFamiliesProperties = (VkQueueFamilyProperties *)SDL_malloc(sizeof(VkQueueFamilyProperties) * queueFamiliesPropertiesAllocatedSize); - if (!queueFamiliesProperties) { + if (queueFamiliesProperties == NULL) { SDL_free(physicalDevices); SDL_free(deviceExtensions); SDL_OutOfMemory(); @@ -408,7 +408,7 @@ static void findPhysicalDevice(void) SDL_free(deviceExtensions); deviceExtensionsAllocatedSize = deviceExtensionCount; deviceExtensions = SDL_malloc(sizeof(VkExtensionProperties) * deviceExtensionsAllocatedSize); - if (!deviceExtensions) { + if (deviceExtensions == NULL) { SDL_free(physicalDevices); SDL_free(queueFamiliesProperties); SDL_OutOfMemory(); @@ -929,7 +929,7 @@ static void initVulkan(void) SDL_Vulkan_LoadLibrary(NULL); vulkanContexts = (VulkanContext *)SDL_calloc(state->num_windows, sizeof(VulkanContext)); - if (!vulkanContexts) { + if (vulkanContexts == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!"); quit(2); } @@ -1092,7 +1092,7 @@ int main(int argc, char **argv) /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); - if (!state) { + if (state == NULL) { return 1; } diff --git a/libs/SDL2/test/testwm2.c b/libs/SDL2/test/testwm2.c index 5236a7f5b..7fc189bd7 100644 --- a/libs/SDL2/test/testwm2.c +++ b/libs/SDL2/test/testwm2.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -208,7 +208,7 @@ void loop() } if (event.type == SDL_MOUSEBUTTONUP) { SDL_Window *window = SDL_GetMouseFocus(); - if (highlighted_mode != -1 && window) { + if (highlighted_mode != -1 && window != NULL) { const int display_index = SDL_GetWindowDisplayIndex(window); SDL_DisplayMode mode; if (0 != SDL_GetDisplayMode(display_index, highlighted_mode, &mode)) { @@ -223,7 +223,7 @@ void loop() for (i = 0; i < state->num_windows; ++i) { SDL_Window *window = state->windows[i]; SDL_Renderer *renderer = state->renderers[i]; - if (window && renderer) { + if (window != NULL && renderer != NULL) { int y = 0; SDL_Rect viewport, menurect; @@ -262,7 +262,7 @@ int main(int argc, char *argv[]) /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); - if (!state) { + if (state == NULL) { return 1; } diff --git a/libs/SDL2/test/testyuv.c b/libs/SDL2/test/testyuv.c index e9038ed0d..e7373a8b1 100644 --- a/libs/SDL2/test/testyuv.c +++ b/libs/SDL2/test/testyuv.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -75,7 +75,7 @@ static SDL_bool verify_yuv_data(Uint32 format, const Uint8 *yuv, int yuv_pitch, SDL_bool result = SDL_FALSE; rgb = (Uint8 *)SDL_malloc(size); - if (!rgb) { + if (rgb == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory"); return SDL_FALSE; } @@ -126,7 +126,7 @@ static int run_automated_tests(int pattern_size, int extra_pitch) int yuv1_pitch, yuv2_pitch; int result = -1; - if (!pattern || !yuv1 || !yuv2) { + if (pattern == NULL || yuv1 == NULL || yuv2 == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't allocate test surfaces"); goto done; } @@ -327,7 +327,7 @@ int main(int argc, char **argv) filename = "testyuv.bmp"; } original = SDL_ConvertSurfaceFormat(SDL_LoadBMP(filename), SDL_PIXELFORMAT_RGB24, 0); - if (!original) { + if (original == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s\n", filename, SDL_GetError()); return 3; } @@ -339,7 +339,7 @@ int main(int argc, char **argv) pitch = CalculateYUVPitch(yuv_format, original->w); converted = SDL_CreateRGBSurfaceWithFormat(0, original->w, original->h, 0, rgb_format); - if (!converted) { + if (converted == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create converted surface: %s\n", SDL_GetError()); return 3; } @@ -356,13 +356,13 @@ int main(int argc, char **argv) SDL_WINDOWPOS_UNDEFINED, original->w, original->h, 0); - if (!window) { + if (window == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create window: %s\n", SDL_GetError()); return 4; } renderer = SDL_CreateRenderer(window, -1, 0); - if (!renderer) { + if (renderer == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create renderer: %s\n", SDL_GetError()); return 4; } diff --git a/libs/SDL2/test/testyuv_cvt.c b/libs/SDL2/test/testyuv_cvt.c index d78e5b196..3bd2df3ff 100644 --- a/libs/SDL2/test/testyuv_cvt.c +++ b/libs/SDL2/test/testyuv_cvt.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/test/testyuv_cvt.h b/libs/SDL2/test/testyuv_cvt.h index fa736be3c..781b632ea 100644 --- a/libs/SDL2/test/testyuv_cvt.h +++ b/libs/SDL2/test/testyuv_cvt.h @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/test/torturethread.c b/libs/SDL2/test/torturethread.c index b612cda49..1976800f0 100644 --- a/libs/SDL2/test/torturethread.c +++ b/libs/SDL2/test/torturethread.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/test/watcom.mif b/libs/SDL2/test/watcom.mif index b81dad831..2189fd49c 100644 --- a/libs/SDL2/test/watcom.mif +++ b/libs/SDL2/test/watcom.mif @@ -53,13 +53,12 @@ TASRCS = testautomation.c & testautomation_audio.c testautomation_clipboard.c & testautomation_events.c testautomation_guid.c & testautomation_hints.c testautomation_joystick.c & - testautomation_keyboard.c testautomation_log.c & - testautomation_main.c testautomation_math.c & - testautomation_mouse.c testautomation_pixels.c & - testautomation_platform.c testautomation_rect.c & - testautomation_render.c testautomation_rwops.c & - testautomation_sdltest.c testautomation_stdlib.c & - testautomation_subsystems.c testautomation_surface.c & + testautomation_keyboard.c testautomation_main.c & + testautomation_math.c testautomation_mouse.c & + testautomation_pixels.c testautomation_platform.c & + testautomation_rect.c testautomation_render.c & + testautomation_rwops.c testautomation_sdltest.c & + testautomation_stdlib.c testautomation_surface.c & testautomation_syswm.c testautomation_timer.c & testautomation_video.c @@ -70,6 +69,8 @@ TNOBJS = $(TNSRCS:.c=.obj) all: testutils.lib $(TARGETS) +.c: ../src/test + .obj.exe: wlink SYS $(SYSTEM) libpath $(LIBPATH) lib {$(LIBS)} op q op el file {$<} name $@ @@ -81,9 +82,6 @@ testvulkan.obj: testvulkan.c # new vulkan headers result in lots of W202 warnings wcc386 $(CFLAGS) -wcd=202 -fo=$^@ $< -testautomation_stdlib.obj: testautomation_stdlib.c - wcc386 $(CFLAGS) -wcd=201 -fo=$^@ $< - testautomation.exe: $(TAOBJS) wlink SYS $(SYSTEM) libpath $(LIBPATH) lib {$(LIBS)} op q op el file {$<} name $@ diff --git a/libs/SDL2/x86_64-w64-mingw32/bin/SDL2.dll b/libs/SDL2/x86_64-w64-mingw32/bin/SDL2.dll index 878760628..e26bcb1c3 100755 Binary files a/libs/SDL2/x86_64-w64-mingw32/bin/SDL2.dll and b/libs/SDL2/x86_64-w64-mingw32/bin/SDL2.dll differ diff --git a/libs/SDL2/x86_64-w64-mingw32/bin/sdl2-config b/libs/SDL2/x86_64-w64-mingw32/bin/sdl2-config index c1368c020..65b2fd199 100755 --- a/libs/SDL2/x86_64-w64-mingw32/bin/sdl2-config +++ b/libs/SDL2/x86_64-w64-mingw32/bin/sdl2-config @@ -43,7 +43,7 @@ while test $# -gt 0; do echo $exec_prefix ;; --version) - echo 2.30.0 + echo 2.28.5 ;; --cflags) echo -I${prefix}/include/SDL2 -Dmain=SDL_main diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL.h index 20c903b2f..9ba8f68c6 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_assert.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_assert.h index a396d4e02..7ce823ec5 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_assert.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_assert.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_atomic.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_atomic.h index 1fa18f49f..1dd816a38 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_atomic.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_atomic.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -209,7 +209,7 @@ typedef void (*SDL_KernelMemoryBarrierFunc)(); #if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) || defined(__ARM_ARCH_8A__) #define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory") #define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory") -#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) +#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_5TE__) #ifdef __thumb__ /* The mcr instruction isn't available in thumb mode, use real functions */ #define SDL_MEMORY_BARRIER_USES_FUNCTION diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_audio.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_audio.h index bd8e7ab6f..ccd35982d 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_audio.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_audio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_bits.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_bits.h index 83e8a78c7..81161ae5f 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_bits.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_bits.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_blendmode.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_blendmode.h index 09d01477d..4ecbe5078 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_blendmode.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_blendmode.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -65,8 +65,8 @@ typedef enum typedef enum { SDL_BLENDOPERATION_ADD = 0x1, /**< dst + src: supported by all renderers */ - SDL_BLENDOPERATION_SUBTRACT = 0x2, /**< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES */ - SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, /**< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES */ + SDL_BLENDOPERATION_SUBTRACT = 0x2, /**< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES */ + SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, /**< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES */ SDL_BLENDOPERATION_MINIMUM = 0x4, /**< min(dst, src) : supported by D3D9, D3D11 */ SDL_BLENDOPERATION_MAXIMUM = 0x5 /**< max(dst, src) : supported by D3D9, D3D11 */ } SDL_BlendOperation; diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_clipboard.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_clipboard.h index bd4b044c6..7c351fbb9 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_clipboard.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_clipboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_config.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_config.h index dba780860..01322c182 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_config.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_config.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_cpuinfo.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_cpuinfo.h index 2a9dd380c..ed5e97915 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_cpuinfo.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_cpuinfo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_egl.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_egl.h index a4276e681..6f51c0831 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_egl.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_egl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_endian.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_endian.h index 591ccac42..71bc06729 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_endian.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_endian.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_error.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_error.h index 2df6463ad..31c22616c 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_error.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_error.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_events.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_events.h index eccbba255..9d0970318 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_events.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_events.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -131,8 +131,6 @@ typedef enum SDL_CONTROLLERTOUCHPADMOTION, /**< Game controller touchpad finger was moved */ SDL_CONTROLLERTOUCHPADUP, /**< Game controller touchpad finger was lifted */ SDL_CONTROLLERSENSORUPDATE, /**< Game controller sensor was updated */ - SDL_CONTROLLERUPDATECOMPLETE_RESERVED_FOR_SDL3, - SDL_CONTROLLERSTEAMHANDLEUPDATED, /**< Game controller Steam handle has changed */ /* Touch events */ SDL_FINGERDOWN = 0x700, @@ -448,7 +446,7 @@ typedef struct SDL_ControllerButtonEvent */ typedef struct SDL_ControllerDeviceEvent { - Uint32 type; /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, ::SDL_CONTROLLERDEVICEREMAPPED, or ::SDL_CONTROLLERSTEAMHANDLEUPDATED */ + Uint32 type; /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, or ::SDL_CONTROLLERDEVICEREMAPPED */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */ } SDL_ControllerDeviceEvent; @@ -582,6 +580,15 @@ typedef struct SDL_QuitEvent Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ } SDL_QuitEvent; +/** + * \brief OS Specific event + */ +typedef struct SDL_OSEvent +{ + Uint32 type; /**< ::SDL_QUIT */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ +} SDL_OSEvent; + /** * \brief A user-defined event type (event.user.*) */ diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_filesystem.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_filesystem.h index 07498898d..4cad657ec 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_filesystem.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_filesystem.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -64,7 +64,7 @@ extern "C" { * directory of the application as it is uncommon to store resources outside * the executable. As such it is not a writable directory. * - * The returned path is guaranteed to end with a path separator ('\\' on + * The returned path is guaranteed to end with a path separator ('\' on * Windows, '/' on most other platforms). * * The pointer returned is owned by the caller. Please call SDL_free() on the @@ -120,7 +120,7 @@ extern DECLSPEC char *SDLCALL SDL_GetBasePath(void); * - ...only use letters, numbers, and spaces. Avoid punctuation like "Game * Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient. * - * The returned path is guaranteed to end with a path separator ('\\' on + * The returned path is guaranteed to end with a path separator ('\' on * Windows, '/' on most other platforms). * * The pointer returned is owned by the caller. Please call SDL_free() on the diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_gamecontroller.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_gamecontroller.h index 281fa356c..140054d36 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_gamecontroller.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_gamecontroller.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -73,8 +73,7 @@ typedef enum SDL_CONTROLLER_TYPE_NVIDIA_SHIELD, SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_LEFT, SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT, - SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_PAIR, - SDL_CONTROLLER_TYPE_MAX + SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_PAIR } SDL_GameControllerType; typedef enum @@ -524,20 +523,6 @@ extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetFirmwareVersion(SDL_GameCont */ extern DECLSPEC const char * SDLCALL SDL_GameControllerGetSerial(SDL_GameController *gamecontroller); -/** - * Get the Steam Input handle of an opened controller, if available. - * - * Returns an InputHandle_t for the controller that can be used with Steam Input API: - * https://partner.steamgames.com/doc/api/ISteamInput - * - * \param gamecontroller the game controller object to query. - * \returns the gamepad handle, or 0 if unavailable. - * - * \since This function is available since SDL 2.30.0. - */ -extern DECLSPEC Uint64 SDLCALL SDL_GameControllerGetSteamHandle(SDL_GameController *gamecontroller); - - /** * Check if a controller has been opened and is currently connected. * @@ -613,9 +598,7 @@ extern DECLSPEC void SDLCALL SDL_GameControllerUpdate(void); * and are centered within ~8000 of zero, though advanced UI will allow users to set * or autodetect the dead zone, which varies between controllers. * - * Trigger axis values range from 0 (released) to SDL_JOYSTICK_AXIS_MAX - * (fully pressed) when reported by SDL_GameControllerGetAxis(). Note that this is not the - * same range that will be reported by the lower-level SDL_GetJoystickAxis(). + * Trigger axis values range from 0 to SDL_JOYSTICK_AXIS_MAX. */ typedef enum { @@ -704,13 +687,8 @@ SDL_GameControllerHasAxis(SDL_GameController *gamecontroller, SDL_GameController * * The axis indices start at index 0. * - * For thumbsticks, the state is a value ranging from -32768 (up/left) - * to 32767 (down/right). - * - * Triggers range from 0 when released to 32767 when fully pressed, and - * never return a negative value. Note that this differs from the value - * reported by the lower-level SDL_GetJoystickAxis(), which normally uses - * the full range. + * The state is a value ranging from -32768 to 32767. Triggers, however, range + * from 0 to 32767 (they never return a negative value). * * \param gamecontroller a game controller * \param axis an axis index (one of the SDL_GameControllerAxis values) diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_gesture.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_gesture.h index 4fffa5f3e..db70b4dd8 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_gesture.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_gesture.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_guid.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_guid.h index 7daa5f1f5..d964223c6 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_guid.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_guid.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_haptic.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_haptic.h index c9ed847df..2462a1e47 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_haptic.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_haptic.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_hidapi.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_hidapi.h index b9d8ffac3..057510035 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_hidapi.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_hidapi.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_hints.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_hints.h index e775a6509..00beef51e 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_hints.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_hints.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -631,110 +631,6 @@ extern "C" { */ #define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS" -/** - * A variable containing a list of arcade stick style controllers. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_ARCADESTICK_DEVICES "SDL_JOYSTICK_ARCADESTICK_DEVICES" - -/** - * A variable containing a list of devices that are not arcade stick style controllers. This will override SDL_HINT_JOYSTICK_ARCADESTICK_DEVICES and the built in device list. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_ARCADESTICK_DEVICES_EXCLUDED "SDL_JOYSTICK_ARCADESTICK_DEVICES_EXCLUDED" - -/** - * A variable containing a list of devices that should not be considerd joysticks. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_BLACKLIST_DEVICES "SDL_JOYSTICK_BLACKLIST_DEVICES" - -/** - * A variable containing a list of devices that should be considered joysticks. This will override SDL_HINT_JOYSTICK_BLACKLIST_DEVICES and the built in device list. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_BLACKLIST_DEVICES_EXCLUDED "SDL_JOYSTICK_BLACKLIST_DEVICES_EXCLUDED" - -/** - * A variable containing a list of flightstick style controllers. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES "SDL_JOYSTICK_FLIGHTSTICK_DEVICES" - -/** - * A variable containing a list of devices that are not flightstick style controllers. This will override SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES and the built in device list. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED "SDL_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED" - -/** - * A variable containing a list of devices known to have a GameCube form factor. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_GAMECUBE_DEVICES "SDL_JOYSTICK_GAMECUBE_DEVICES" - -/** - * A variable containing a list of devices known not to have a GameCube form factor. This will override SDL_HINT_JOYSTICK_GAMECUBE_DEVICES and the built in device list. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_GAMECUBE_DEVICES_EXCLUDED "SDL_JOYSTICK_GAMECUBE_DEVICES_EXCLUDED" - /** * \brief A variable controlling whether the HIDAPI joystick drivers should be used. * @@ -943,17 +839,6 @@ extern "C" { */ #define SDL_HINT_JOYSTICK_HIDAPI_STEAM "SDL_JOYSTICK_HIDAPI_STEAM" -/** - * \brief A variable controlling whether the HIDAPI driver for the Steam Deck builtin controller should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI - */ -#define SDL_HINT_JOYSTICK_HIDAPI_STEAMDECK "SDL_JOYSTICK_HIDAPI_STEAMDECK" - /** * \brief A variable controlling whether the HIDAPI driver for Nintendo Switch controllers should be used. * @@ -1080,24 +965,6 @@ extern "C" { */ #define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED "SDL_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED" -/** - * A variable controlling whether IOKit should be used for controller handling. - * - * This variable can be set to the following values: - * "0" - IOKit is not used - * "1" - IOKit is used (the default) - */ -#define SDL_HINT_JOYSTICK_IOKIT "SDL_JOYSTICK_IOKIT" - -/** - * A variable controlling whether GCController should be used for controller handling. - * - * This variable can be set to the following values: - * "0" - GCController is not used - * "1" - GCController is used (the default) - */ -#define SDL_HINT_JOYSTICK_MFI "SDL_JOYSTICK_MFI" - /** * \brief A variable controlling whether the RAWINPUT joystick drivers should be used for better handling XInput-capable devices. * @@ -1140,32 +1007,6 @@ extern "C" { */ #define SDL_HINT_JOYSTICK_THREAD "SDL_JOYSTICK_THREAD" -/** - * A variable containing a list of throttle style controllers. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_THROTTLE_DEVICES "SDL_JOYSTICK_THROTTLE_DEVICES" - -/** - * A variable containing a list of devices that are not throttle style controllers. This will override SDL_HINT_JOYSTICK_THROTTLE_DEVICES and the built in device list. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_THROTTLE_DEVICES_EXCLUDED "SDL_JOYSTICK_THROTTLE_DEVICES_EXCLUDED" - /** * \brief A variable controlling whether Windows.Gaming.Input should be used for controller handling. * @@ -1175,45 +1016,6 @@ extern "C" { */ #define SDL_HINT_JOYSTICK_WGI "SDL_JOYSTICK_WGI" -/** - * A variable containing a list of wheel style controllers. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_WHEEL_DEVICES "SDL_JOYSTICK_WHEEL_DEVICES" - -/** - * A variable containing a list of devices that are not wheel style controllers. This will override SDL_HINT_JOYSTICK_WHEEL_DEVICES and the built in device list. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_WHEEL_DEVICES_EXCLUDED "SDL_JOYSTICK_WHEEL_DEVICES_EXCLUDED" - -/** - * A variable containing a list of devices known to have all axes centered at zero. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_JOYSTICK_ZERO_CENTERED_DEVICES "SDL_JOYSTICK_ZERO_CENTERED_DEVICES" - /** * \brief Determines whether SDL enforces that DRM master is required in order * to initialize the KMSDRM video backend. @@ -1282,22 +1084,6 @@ extern "C" { */ #define SDL_HINT_LINUX_JOYSTICK_DEADZONES "SDL_LINUX_JOYSTICK_DEADZONES" -/** - * \brief A variable controlling the default SDL log levels. - * - * This variable is a comma separated set of category=level tokens that define the default logging levels for SDL applications. - * - * The category can be a numeric category, one of "app", "error", "assert", "system", "audio", "video", "render", "input", "test", or `*` for any unspecified category. - * - * The level can be a numeric level, one of "verbose", "debug", "info", "warn", "error", "critical", or "quiet" to disable that category. - * - * You can omit the category if you want to set the logging level for all categories. - * - * If this hint isn't set, the default log levels are equivalent to: - * "app=info,assert=warn,test=verbose,*=error" - */ -#define SDL_HINT_LOGGING "SDL_LOGGING" - /** * \brief When set don't force the SDL app to become a foreground process * @@ -1699,32 +1485,6 @@ extern "C" { */ #define SDL_HINT_RENDER_METAL_PREFER_LOW_POWER_DEVICE "SDL_RENDER_METAL_PREFER_LOW_POWER_DEVICE" -/** - * A variable containing a list of ROG gamepad capable mice. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_ROG_GAMEPAD_MICE "SDL_ROG_GAMEPAD_MICE" - -/** - * A variable containing a list of devices that are not ROG gamepad capable mice. This will override SDL_HINT_ROG_GAMEPAD_MICE and the built in device list. - * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. - * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD - * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. - */ -#define SDL_HINT_ROG_GAMEPAD_MICE_EXCLUDED "SDL_ROG_GAMEPAD_MICE_EXCLUDED" - /** * \brief A variable controlling if VSYNC is automatically disable if doesn't reach the enough FPS * @@ -2682,22 +2442,6 @@ extern "C" { */ #define SDL_HINT_TRACKPAD_IS_TOUCH_ONLY "SDL_TRACKPAD_IS_TOUCH_ONLY" -/** - * Cause SDL to call dbus_shutdown() on quit. - * - * This is useful as a debug tool to validate memory leaks, but shouldn't ever - * be set in production applications, as other libraries used by the application - * might use dbus under the hood and this cause cause crashes if they continue - * after SDL_Quit(). - * - * This variable can be set to the following values: - * "0" - SDL will not call dbus_shutdown() on quit (default) - * "1" - SDL will call dbus_shutdown() on quit - * - * This hint is available since SDL 2.30.0. - */ -#define SDL_HINT_SHUTDOWN_DBUS_ON_QUIT "SDL_SHUTDOWN_DBUS_ON_QUIT" - /** * \brief An enumeration of hint priorities diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_joystick.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_joystick.h index 561e01099..b9b4f6228 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_joystick.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_joystick.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_keyboard.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_keyboard.h index 03c7b5a37..86a37ad1a 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_keyboard.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_keyboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -298,10 +298,8 @@ extern DECLSPEC void SDLCALL SDL_ClearComposition(void); extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputShown(void); /** - * Set the rectangle used to type Unicode text inputs. Native input methods - * will place a window with word suggestions near it, without covering the - * text being inputted. - * + * Set the rectangle used to type Unicode text inputs. + * * To start text input in a given location, this function is intended to be * called before SDL_StartTextInput, although some platforms support moving * the rectangle even while text input (and a composition) is active. diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_keycode.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_keycode.h index 57a71bd79..710622302 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_keycode.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_keycode.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_loadso.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_loadso.h index 4edc22e9e..ca59b681c 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_loadso.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_loadso.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_locale.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_locale.h index 0b6118f0e..482dbefe7 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_locale.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_locale.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_log.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_log.h index bd030c6d2..da733c402 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_log.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_log.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -59,7 +59,7 @@ extern "C" { * By default the application category is enabled at the INFO level, * the assert category is enabled at the WARN level, test is enabled * at the VERBOSE level and all other categories are enabled at the - * ERROR level. + * CRITICAL level. */ typedef enum { @@ -352,7 +352,7 @@ extern DECLSPEC void SDLCALL SDL_LogMessage(int category, */ extern DECLSPEC void SDLCALL SDL_LogMessageV(int category, SDL_LogPriority priority, - SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap) SDL_PRINTF_VARARG_FUNCV(3); + const char *fmt, va_list ap); /** * The prototype for the log output callback function. diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_main.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_main.h index a66c84b4e..5cc8e5913 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_main.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_main.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_messagebox.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_messagebox.h index 5ace6f2dd..7896fd129 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_messagebox.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_messagebox.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_metal.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_metal.h index 50f7b2aeb..f36e34878 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_metal.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_metal.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_misc.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_misc.h index 113ba7a15..13ed9c771 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_misc.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_misc.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_mouse.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_mouse.h index 687ff122d..aa0757573 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_mouse.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_mouse.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_mutex.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_mutex.h index eaa21f293..e679d3808 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_mutex.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_mutex.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_name.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_name.h index 71e935455..5c3e07ab7 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_name.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_name.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_opengl.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_opengl.h index 2bb38c5c0..0ba89127a 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_opengl.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_opengl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_opengles.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_opengles.h index 7e9a1ab8d..f4465eaa9 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_opengles.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_opengles.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_opengles2.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_opengles2.h index 96971344d..5e3b717de 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_opengles2.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_opengles2.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_pixels.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_pixels.h index 44757cdcf..9abd57b42 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_pixels.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_pixels.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -61,10 +61,7 @@ typedef enum SDL_PIXELTYPE_ARRAYU16, SDL_PIXELTYPE_ARRAYU32, SDL_PIXELTYPE_ARRAYF16, - SDL_PIXELTYPE_ARRAYF32, - - /* This must be at the end of the list to avoid breaking the existing ABI */ - SDL_PIXELTYPE_INDEX2 + SDL_PIXELTYPE_ARRAYF32 } SDL_PixelType; /** Bitmap pixel order, high bit -> low bit. */ @@ -137,7 +134,6 @@ typedef enum #define SDL_ISPIXELFORMAT_INDEXED(format) \ (!SDL_ISPIXELFORMAT_FOURCC(format) && \ ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \ - (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX2) || \ (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \ (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8))) @@ -181,12 +177,6 @@ typedef enum SDL_PIXELFORMAT_INDEX1MSB = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_1234, 0, 1, 0), - SDL_PIXELFORMAT_INDEX2LSB = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX2, SDL_BITMAPORDER_4321, 0, - 2, 0), - SDL_PIXELFORMAT_INDEX2MSB = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX2, SDL_BITMAPORDER_1234, 0, - 2, 0), SDL_PIXELFORMAT_INDEX4LSB = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0, 4, 0), @@ -286,19 +276,11 @@ typedef enum SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_ABGR8888, - SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_RGBX8888, - SDL_PIXELFORMAT_XRGB32 = SDL_PIXELFORMAT_XRGB8888, - SDL_PIXELFORMAT_BGRX32 = SDL_PIXELFORMAT_BGRX8888, - SDL_PIXELFORMAT_XBGR32 = SDL_PIXELFORMAT_XBGR8888, #else SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_RGBA8888, - SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_XBGR8888, - SDL_PIXELFORMAT_XRGB32 = SDL_PIXELFORMAT_BGRX8888, - SDL_PIXELFORMAT_BGRX32 = SDL_PIXELFORMAT_XRGB8888, - SDL_PIXELFORMAT_XBGR32 = SDL_PIXELFORMAT_RGBX8888, #endif SDL_PIXELFORMAT_YV12 = /**< Planar mode: Y + V + U (3 planes) */ diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_platform.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_platform.h index 6e67b4577..d2a7e052d 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_platform.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_platform.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -166,12 +166,6 @@ #define WINAPI_FAMILY_WINRT 0 #endif /* HAVE_WINAPIFAMILY_H */ -#if (HAVE_WINAPIFAMILY_H) && defined(WINAPI_FAMILY_PHONE_APP) -#define SDL_WINAPI_FAMILY_PHONE (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) -#else -#define SDL_WINAPI_FAMILY_PHONE 0 -#endif - #if WINAPI_FAMILY_WINRT #undef __WINRT__ #define __WINRT__ 1 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_power.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_power.h index 0520065ce..1d75704c4 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_power.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_power.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_quit.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_quit.h index 3f69dc9f2..d8ceb8943 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_quit.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_quit.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_rect.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_rect.h index 5ce1f0b45..9611a311c 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_rect.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_rect.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_render.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_render.h index b7135bb9d..2d3f07366 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_render.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_render.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -42,7 +42,7 @@ * of the many good 3D engines. * * These functions must be called from the main thread. - * See this bug for details: https://github.com/libsdl-org/SDL/issues/986 + * See this bug for details: http://bugzilla.libsdl.org/show_bug.cgi?id=1995 */ #ifndef SDL_render_h_ diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_revision.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_revision.h index ee42f8421..4455a08b6 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_revision.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_revision.h @@ -1,7 +1,7 @@ /* Generated by updaterev.sh, do not edit */ #ifdef SDL_VENDOR_INFO -#define SDL_REVISION "SDL-release-2.30.0-0-g859844eae (" SDL_VENDOR_INFO ")" +#define SDL_REVISION "SDL-release-2.28.5-0-g15ead9a40 (" SDL_VENDOR_INFO ")" #else -#define SDL_REVISION "SDL-release-2.30.0-0-g859844eae" +#define SDL_REVISION "SDL-release-2.28.5-0-g15ead9a40" #endif #define SDL_REVISION_NUMBER 0 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_rwops.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_rwops.h index 9dd99f92b..8615cb542 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_rwops.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_rwops.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_scancode.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_scancode.h index fe13d5b7a..a960a7991 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_scancode.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_scancode.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_sensor.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_sensor.h index 8b89ef6a5..9ecce44b1 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_sensor.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_sensor.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_shape.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_shape.h index 4783cf290..f66babc01 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_shape.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_shape.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_stdinc.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_stdinc.h index 0035a357c..182ed86ee 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_stdinc.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_stdinc.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -257,7 +257,7 @@ typedef uint64_t Uint64; #define SDL_PRIs64 PRIs64 #elif defined(__WIN32__) || defined(__GDK__) #define SDL_PRIs64 "I64d" -#elif defined(__LP64__) && !defined(__APPLE__) +#elif defined(__LINUX__) && defined(__LP64__) #define SDL_PRIs64 "ld" #else #define SDL_PRIs64 "lld" @@ -268,7 +268,7 @@ typedef uint64_t Uint64; #define SDL_PRIu64 PRIu64 #elif defined(__WIN32__) || defined(__GDK__) #define SDL_PRIu64 "I64u" -#elif defined(__LP64__) && !defined(__APPLE__) +#elif defined(__LINUX__) && defined(__LP64__) #define SDL_PRIu64 "lu" #else #define SDL_PRIu64 "llu" @@ -279,7 +279,7 @@ typedef uint64_t Uint64; #define SDL_PRIx64 PRIx64 #elif defined(__WIN32__) || defined(__GDK__) #define SDL_PRIx64 "I64x" -#elif defined(__LP64__) && !defined(__APPLE__) +#elif defined(__LINUX__) && defined(__LP64__) #define SDL_PRIx64 "lx" #else #define SDL_PRIx64 "llx" @@ -290,7 +290,7 @@ typedef uint64_t Uint64; #define SDL_PRIX64 PRIX64 #elif defined(__WIN32__) || defined(__GDK__) #define SDL_PRIX64 "I64X" -#elif defined(__LP64__) && !defined(__APPLE__) +#elif defined(__LINUX__) && defined(__LP64__) #define SDL_PRIX64 "lX" #else #define SDL_PRIX64 "llX" @@ -336,9 +336,7 @@ typedef uint64_t Uint64; #define SDL_PRINTF_FORMAT_STRING #define SDL_SCANF_FORMAT_STRING #define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) -#define SDL_PRINTF_VARARG_FUNCV( fmtargnumber ) #define SDL_SCANF_VARARG_FUNC( fmtargnumber ) -#define SDL_SCANF_VARARG_FUNCV( fmtargnumber ) #else #if defined(_MSC_VER) && (_MSC_VER >= 1600) /* VS 2010 and above */ #include @@ -364,14 +362,10 @@ typedef uint64_t Uint64; #endif #if defined(__GNUC__) #define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __printf__, fmtargnumber, fmtargnumber+1 ))) -#define SDL_PRINTF_VARARG_FUNCV( fmtargnumber ) __attribute__(( format( __printf__, fmtargnumber, 0 ))) #define SDL_SCANF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __scanf__, fmtargnumber, fmtargnumber+1 ))) -#define SDL_SCANF_VARARG_FUNCV( fmtargnumber ) __attribute__(( format( __scanf__, fmtargnumber, 0 ))) #else #define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) -#define SDL_PRINTF_VARARG_FUNCV( fmtargnumber ) #define SDL_SCANF_VARARG_FUNC( fmtargnumber ) -#define SDL_SCANF_VARARG_FUNCV( fmtargnumber ) #endif #endif /* SDL_DISABLE_ANALYZE_MACROS */ @@ -609,11 +603,11 @@ extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2); extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t len); extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, ...) SDL_SCANF_VARARG_FUNC(2); -extern DECLSPEC int SDLCALL SDL_vsscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, va_list ap) SDL_SCANF_VARARG_FUNCV(2); +extern DECLSPEC int SDLCALL SDL_vsscanf(const char *text, const char *fmt, va_list ap); extern DECLSPEC int SDLCALL SDL_snprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ... ) SDL_PRINTF_VARARG_FUNC(3); -extern DECLSPEC int SDLCALL SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap) SDL_PRINTF_VARARG_FUNCV(3); +extern DECLSPEC int SDLCALL SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt, va_list ap); extern DECLSPEC int SDLCALL SDL_asprintf(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); -extern DECLSPEC int SDLCALL SDL_vasprintf(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap) SDL_PRINTF_VARARG_FUNCV(2); +extern DECLSPEC int SDLCALL SDL_vasprintf(char **strp, const char *fmt, va_list ap); #ifndef HAVE_M_PI #ifndef M_PI @@ -694,8 +688,8 @@ extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, size_t * outbytesleft); /** - * This function converts a buffer or string between encodings in one pass, - * returning a string that must be freed with SDL_free() or NULL on error. + * This function converts a buffer or string between encodings in one pass, returning a + * string that must be freed with SDL_free() or NULL on error. * * \since This function is available since SDL 2.0.0. */ @@ -704,8 +698,8 @@ extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode, const char *inbuf, size_t inbytesleft); #define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1) -#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1) -#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1) +#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2-INTERNAL", "UTF-8", S, SDL_strlen(S)+1) +#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4-INTERNAL", "UTF-8", S, SDL_strlen(S)+1) #define SDL_iconv_wchar_utf8(S) SDL_iconv_string("UTF-8", "WCHAR_T", (char *)S, (SDL_wcslen(S)+1)*sizeof(wchar_t)) /* force builds using Clang's static analysis tools to use literal C runtime diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_surface.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_surface.h index ceeb86bd8..d6ee615c5 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_surface.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_surface.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_system.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_system.h index ddae4f8cc..4b7eaddcc 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_system.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_system.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -593,8 +593,7 @@ extern DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void /* Functions used only by GDK */ #if defined(__GDK__) -typedef struct XTaskQueueObject *XTaskQueueHandle; -typedef struct XUser *XUserHandle; +typedef struct XTaskQueueObject * XTaskQueueHandle; /** * Gets a reference to the global async task queue handle for GDK, @@ -611,20 +610,6 @@ typedef struct XUser *XUserHandle; */ extern DECLSPEC int SDLCALL SDL_GDKGetTaskQueue(XTaskQueueHandle * outTaskQueue); -/** - * Gets a reference to the default user handle for GDK. - * - * This is effectively a synchronous version of XUserAddAsync, which always - * prefers the default user and allows a sign-in UI. - * - * \param outUserHandle a pointer to be filled in with the default user - * handle. - * \returns 0 if success, -1 if any error occurs. - * - * \since This function is available since SDL 2.28.0. - */ -extern DECLSPEC int SDLCALL SDL_GDKGetDefaultUser(XUserHandle * outUserHandle); - #endif /* Ends C function definitions when using C++ */ diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_syswm.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_syswm.h index 7b8bd6ef9..b35734deb 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_syswm.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_syswm.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test.h index e5acbee4e..80daaafbd 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_assert.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_assert.h index 4f983350a..341e490fa 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_assert.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_assert.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_common.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_common.h index d977e463f..6de63cad6 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_common.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_common.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_compare.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_compare.h index 61a38d090..5fce25ca1 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_compare.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_compare.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_crc32.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_crc32.h index e3478318d..bf3478210 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_crc32.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_crc32.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_font.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_font.h index 620c82116..18a82ffc8 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_font.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_font.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_fuzzer.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_fuzzer.h index a847ccb01..cfe6a14f2 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_fuzzer.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_fuzzer.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_harness.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_harness.h index bd9e4f8de..26231dcd6 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_harness.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_harness.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_images.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_images.h index b5bcb0a00..121137175 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_images.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_images.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_log.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_log.h index ea9ae5e1c..a27ffc209 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_log.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_log.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_md5.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_md5.h index 3764b0425..538c7ae3e 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_md5.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_md5.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_memory.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_memory.h index 9bd143252..f959177d2 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_memory.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_memory.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_random.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_random.h index 344646aa8..0035a8030 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_random.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_test_random.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_thread.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_thread.h index dc7f5363a..b829bbad5 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_thread.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_thread.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_timer.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_timer.h index 8123e432f..98f9ad16c 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_timer.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_timer.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_touch.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_touch.h index f6a5db413..c12d4a1c8 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_touch.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_touch.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_types.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_types.h index e8d33c651..b5d7192ff 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_types.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_types.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_version.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_version.h index 02143ff7a..7585eece5 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_version.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_version.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -58,8 +58,8 @@ typedef struct SDL_version /* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL */ #define SDL_MAJOR_VERSION 2 -#define SDL_MINOR_VERSION 30 -#define SDL_PATCHLEVEL 0 +#define SDL_MINOR_VERSION 28 +#define SDL_PATCHLEVEL 5 /** * Macro to determine SDL version program was compiled against. diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_video.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_video.h index fa47d3099..c8b2d7a0d 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_video.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/SDL_video.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -1278,8 +1278,7 @@ extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window * window, /** * Return whether the window has a surface associated with it. * - * \returns SDL_TRUE if there is a surface associated with the window, or - * SDL_FALSE otherwise. + * \returns SDL_TRUE if there is a surface associated with the window, or SDL_FALSE otherwise. * * \since This function is available since SDL 2.28.0. * @@ -1341,11 +1340,6 @@ extern DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window * window); * * This function is equivalent to the SDL 1.2 API SDL_UpdateRects(). * - * Note that this function will update _at least_ the rectangles specified, - * but this is only intended as an optimization; in practice, this might - * update more of the screen (or all of the screen!), depending on what - * method SDL uses to send pixels to the system. - * * \param window the window to update * \param rects an array of SDL_Rect structures representing areas of the * surface to copy, in pixels diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/begin_code.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/begin_code.h index a47a7d2b6..4142ffeba 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/begin_code.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/begin_code.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 @@ -36,8 +36,6 @@ #ifndef SDL_DEPRECATED # if defined(__GNUC__) && (__GNUC__ >= 4) /* technically, this arrived in gcc 3.1, but oh well. */ # define SDL_DEPRECATED __attribute__((deprecated)) -# elif defined(_MSC_VER) -# define SDL_DEPRECATED __declspec(deprecated) # else # define SDL_DEPRECATED # endif diff --git a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/close_code.h b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/close_code.h index 50a0e6f3b..b5ff3e204 100644 --- a/libs/SDL2/x86_64-w64-mingw32/include/SDL2/close_code.h +++ b/libs/SDL2/x86_64-w64-mingw32/include/SDL2/close_code.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga + Copyright (C) 1997-2023 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 diff --git a/libs/SDL2/x86_64-w64-mingw32/lib/cmake/SDL2/sdl2-config-version.cmake b/libs/SDL2/x86_64-w64-mingw32/lib/cmake/SDL2/sdl2-config-version.cmake index 82dfeab12..0e6382995 100644 --- a/libs/SDL2/x86_64-w64-mingw32/lib/cmake/SDL2/sdl2-config-version.cmake +++ b/libs/SDL2/x86_64-w64-mingw32/lib/cmake/SDL2/sdl2-config-version.cmake @@ -1,6 +1,6 @@ # sdl2 cmake project-config-version input for ./configure scripts -set(PACKAGE_VERSION "2.30.0") +set(PACKAGE_VERSION "2.28.5") if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) set(PACKAGE_VERSION_COMPATIBLE FALSE) diff --git a/libs/SDL2/x86_64-w64-mingw32/lib/libSDL2.a b/libs/SDL2/x86_64-w64-mingw32/lib/libSDL2.a index fff83b8b3..0fe5391a1 100644 Binary files a/libs/SDL2/x86_64-w64-mingw32/lib/libSDL2.a and b/libs/SDL2/x86_64-w64-mingw32/lib/libSDL2.a differ diff --git a/libs/SDL2/x86_64-w64-mingw32/lib/libSDL2.dll.a b/libs/SDL2/x86_64-w64-mingw32/lib/libSDL2.dll.a index 1f54d8f34..25300e1d3 100755 Binary files a/libs/SDL2/x86_64-w64-mingw32/lib/libSDL2.dll.a and b/libs/SDL2/x86_64-w64-mingw32/lib/libSDL2.dll.a differ diff --git a/libs/SDL2/x86_64-w64-mingw32/lib/libSDL2.la b/libs/SDL2/x86_64-w64-mingw32/lib/libSDL2.la index df09985ee..3c735a348 100644 --- a/libs/SDL2/x86_64-w64-mingw32/lib/libSDL2.la +++ b/libs/SDL2/x86_64-w64-mingw32/lib/libSDL2.la @@ -23,9 +23,9 @@ dependency_libs=' -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 - weak_library_names='' # Version information for libSDL2. -current=3000 -age=3000 -revision=0 +current=2800 +age=2800 +revision=5 # Is this an already installed library? installed=yes @@ -38,4 +38,4 @@ dlopen='' dlpreopen='' # Directory that this library needs to be installed in: -libdir='/Users/valve/release/SDL2/SDL2-2.30.0/x86_64-w64-mingw32/lib' +libdir='/Users/valve/release/SDL2/SDL2-2.28.5/x86_64-w64-mingw32/lib' diff --git a/libs/SDL2/x86_64-w64-mingw32/lib/libSDL2_test.a b/libs/SDL2/x86_64-w64-mingw32/lib/libSDL2_test.a index 3b5999fa2..9bb1d7d3c 100644 Binary files a/libs/SDL2/x86_64-w64-mingw32/lib/libSDL2_test.a and b/libs/SDL2/x86_64-w64-mingw32/lib/libSDL2_test.a differ diff --git a/libs/SDL2/x86_64-w64-mingw32/lib/libSDL2_test.la b/libs/SDL2/x86_64-w64-mingw32/lib/libSDL2_test.la index d9f34a788..0a5cd1126 100644 --- a/libs/SDL2/x86_64-w64-mingw32/lib/libSDL2_test.la +++ b/libs/SDL2/x86_64-w64-mingw32/lib/libSDL2_test.la @@ -38,4 +38,4 @@ dlopen='' dlpreopen='' # Directory that this library needs to be installed in: -libdir='/Users/valve/release/SDL2/SDL2-2.30.0/x86_64-w64-mingw32/lib' +libdir='/Users/valve/release/SDL2/SDL2-2.28.5/x86_64-w64-mingw32/lib' diff --git a/libs/SDL2/x86_64-w64-mingw32/lib/libSDL2main.a b/libs/SDL2/x86_64-w64-mingw32/lib/libSDL2main.a index ded236c5b..0845ae4c7 100644 Binary files a/libs/SDL2/x86_64-w64-mingw32/lib/libSDL2main.a and b/libs/SDL2/x86_64-w64-mingw32/lib/libSDL2main.a differ diff --git a/libs/SDL2/x86_64-w64-mingw32/lib/libSDL2main.la b/libs/SDL2/x86_64-w64-mingw32/lib/libSDL2main.la index 3adf979fe..13216dfb3 100644 --- a/libs/SDL2/x86_64-w64-mingw32/lib/libSDL2main.la +++ b/libs/SDL2/x86_64-w64-mingw32/lib/libSDL2main.la @@ -38,4 +38,4 @@ dlopen='' dlpreopen='' # Directory that this library needs to be installed in: -libdir='/Users/valve/release/SDL2/SDL2-2.30.0/x86_64-w64-mingw32/lib' +libdir='/Users/valve/release/SDL2/SDL2-2.28.5/x86_64-w64-mingw32/lib' diff --git a/libs/SDL2/x86_64-w64-mingw32/lib/pkgconfig/sdl2.pc b/libs/SDL2/x86_64-w64-mingw32/lib/pkgconfig/sdl2.pc index a23ea3051..56b88c4ef 100644 --- a/libs/SDL2/x86_64-w64-mingw32/lib/pkgconfig/sdl2.pc +++ b/libs/SDL2/x86_64-w64-mingw32/lib/pkgconfig/sdl2.pc @@ -1,13 +1,13 @@ # sdl pkg-config source file -prefix=/usr/local/x86_64-w64-mingw32 +prefix=/x86_64-w64-mingw32 exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include Name: sdl2 Description: Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer. -Version: 2.30.0 +Version: 2.28.5 Requires.private: Conflicts: Libs: -L${libdir} -lmingw32 -lSDL2main -lSDL2 -mwindows diff --git a/libs/SDL2/x86_64-w64-mingw32/share/aclocal/sdl2.m4 b/libs/SDL2/x86_64-w64-mingw32/share/aclocal/sdl2.m4 index 274753b11..75b60f6ea 100644 --- a/libs/SDL2/x86_64-w64-mingw32/share/aclocal/sdl2.m4 +++ b/libs/SDL2/x86_64-w64-mingw32/share/aclocal/sdl2.m4 @@ -9,9 +9,8 @@ # * also look for SDL2.framework under Mac OS X # * removed HP/UX 9 support. # * updated for newer autoconf. -# * (v3) use $PKG_CONFIG for pkg-config cross-compiling support -# serial 3 +# serial 2 dnl AM_PATH_SDL2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS @@ -55,7 +54,7 @@ AC_ARG_VAR(SDL2_FRAMEWORK, [Path to SDL2.framework]) if test "x$sdl_pc" = xyes ; then no_sdl="" - SDL2_CONFIG="$PKG_CONFIG sdl2" + SDL2_CONFIG="pkg-config sdl2" else as_save_PATH="$PATH" if test "x$prefix" != xNONE && test "$cross_compiling" != yes; then diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 160174080..486f4e913 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -173,11 +173,13 @@ if("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin") target_compile_definitions(SRB2SDL2 PRIVATE -DMACOSX) endif() -target_link_libraries(SRB2SDL2 PRIVATE gme) -target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_GME) -if(NOT "${SRB2_CONFIG_SYSTEM_LIBRARIES}") - # this sucks but gme doesn't use modern cmake to delineate public headers - target_include_directories(SRB2SDL2 PRIVATE "${libgme_SOURCE_DIR}") +if("${SRB2_CONFIG_USE_GME}") + target_link_libraries(SRB2SDL2 PRIVATE gme) + target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_GME) + if(NOT "${SRB2_CONFIG_SYSTEM_LIBRARIES}") + # this sucks but gme doesn't use modern cmake to delineate public headers + target_include_directories(SRB2SDL2 PRIVATE "${libgme_SOURCE_DIR}") + endif() endif() target_link_libraries(SRB2SDL2 PRIVATE openmpt) @@ -243,6 +245,7 @@ target_compile_options(SRB2SDL2 PRIVATE # This is a direct translation from versions.mk $<$,$>: -Wall + -Wextra -Wno-trigraphs -W # Was controlled by RELAXWARNINGS -Wfloat-equal @@ -310,11 +313,7 @@ target_compile_options(SRB2SDL2 PRIVATE $<$,8.1.0>: -Wno-error=format-overflow - -Wno-error=stringop-truncation - -Wno-error=stringop-overflow -Wno-format-overflow - -Wno-stringop-truncation - -Wno-stringop-overflow -Wno-error=multistatement-macros > @@ -327,7 +326,9 @@ target_compile_options(SRB2SDL2 PRIVATE $<$,$,$>>: -Wall -Wno-absolute-value + -Wextra -Wno-trigraphs + -Wconditional-uninitialized -Wno-error=non-literal-null-conversion -Wno-error=constant-conversion -Wno-error=unused-but-set-variable @@ -344,6 +345,9 @@ target_compile_options(SRB2SDL2 PRIVATE # C++, GNU, Clang and Apple Clang $<$,$,$,$>>: -Wall + -Wextra + -Wno-trigraphs + -Wconditional-uninitialized > # C++, MSVC diff --git a/src/Makefile.d/versions.mk b/src/Makefile.d/versions.mk index b639ad9a1..7c130d908 100644 --- a/src/Makefile.d/versions.mk +++ b/src/Makefile.d/versions.mk @@ -135,11 +135,7 @@ ifdef GCC71 endif ifdef GCC81 WFLAGS+=-Wno-error=format-overflow - WFLAGS+=-Wno-error=stringop-truncation - WFLAGS+=-Wno-error=stringop-overflow WFLAGS+=-Wno-format-overflow - WFLAGS+=-Wno-stringop-truncation - WFLAGS+=-Wno-stringop-overflow WFLAGS+=-Wno-error=multistatement-macros endif diff --git a/src/blua/lvm.c b/src/blua/lvm.c index b74fef4ee..627685b38 100644 --- a/src/blua/lvm.c +++ b/src/blua/lvm.c @@ -134,7 +134,7 @@ void luaV_gettable (lua_State *L, TValue *t, TValue *key, StkId val) { void luaV_settable (lua_State *L, TValue *t, TValue *key, StkId val) { int loop; for (loop = 0; loop < MAXTAGLOOP; loop++) { - TValue *tm; + TValue *tm = NULL; if (ttistable(t)) { /* `t' is a table? */ Table *h = hvalue(t); TValue *oldval = luaH_set(L, h, key); /* do a primitive set */ diff --git a/src/command.c b/src/command.c index 87d4f893f..a46cc98bc 100644 --- a/src/command.c +++ b/src/command.c @@ -2060,16 +2060,16 @@ void CV_StealthSet(consvar_t *var, const char *value) */ static void CV_SetValueMaybeStealth(consvar_t *var, INT32 value, boolean stealth) { - char val[SKINNAMESIZE+1]; + char val[SKINNAMESIZE+1] = "None"; if (var == &cv_forceskin) // Special handling. { const char *tmpskin = NULL; if ((value < 0) || (value >= numskins)) - tmpskin = "None"; + ; else tmpskin = skins[value]->name; - strncpy(val, tmpskin, SKINNAMESIZE); + memcpy(val, tmpskin, SKINNAMESIZE); } else sprintf(val, "%d", value); diff --git a/src/d_player.h b/src/d_player.h index 26f17a1a0..098b4485c 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -603,6 +603,7 @@ typedef struct player_s boolean spectator; boolean outofcoop; boolean removing; + boolean muted; UINT8 bot; struct player_s *botleader; UINT16 lastbuttons; diff --git a/src/dedicated/i_system.c b/src/dedicated/i_system.c index 13d5d1700..858dfaf20 100644 --- a/src/dedicated/i_system.c +++ b/src/dedicated/i_system.c @@ -39,12 +39,6 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T); #include #undef SystemFunction036 -// A little more than the minimum sleep duration on Windows. -// May be incorrect for other platforms, but we don't currently have a way to -// query the scheduler granularity. SDL will do what's needed to make this as -// low as possible though. -#define MIN_SLEEP_DURATION_MS 2.1 - #endif #include #include @@ -95,8 +89,11 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T); #endif #endif -#if defined (__unix__) || (defined (UNIXCOMMON) && !defined (__APPLE__)) +#if defined(UNIXCOMMON) #include +#endif + +#if defined (__unix__) || (defined (UNIXCOMMON) && !defined (__APPLE__)) #include #include #define NEWSIGNALHANDLER @@ -209,6 +206,12 @@ static char returnWadPath[256]; #define MAX_EXIT_FUNCS 32 +// A little more than the minimum sleep duration on Windows. +// May be incorrect for other platforms, but we don't currently have a way to +// query the scheduler granularity. SDL will do what's needed to make this as +// low as possible though. +#define MIN_SLEEP_DURATION_MS 2.1 + UINT8 graphics_started = 0; UINT8 keyboard_started = 0; diff --git a/src/deh_soc.c b/src/deh_soc.c index 41eb28a90..beaf7cbf0 100644 --- a/src/deh_soc.c +++ b/src/deh_soc.c @@ -324,7 +324,7 @@ void readPlayer(MYFILE *f, INT32 num) if (fastcmp(word, "PICNAME")) { SLOTFOUND - strncpy(description[num].picname, word2, 8); + strncpy(description[num].picname, word2, sizeof(description[num].picname)-1); } else if (fastcmp(word, "DISPLAYNAME")) { @@ -355,7 +355,7 @@ void readPlayer(MYFILE *f, INT32 num) else if (fastcmp(word, "NAMETAG") || fastcmp(word, "TAGNAME")) { SLOTFOUND - strncpy(description[num].nametag, word2, 8); + strncpy(description[num].nametag, word2, sizeof(description[num].nametag)-1); } else if (fastcmp(word, "TAGTEXTCOLOR") || fastcmp(word, "TAGTEXTCOLOUR")) { @@ -1163,7 +1163,7 @@ void readgametype(MYFILE *f, char *gtname) INT16 newgtrankingstype = -1; int newgtinttype = 0; char gtdescription[441]; - char gtconst[MAXLINELEN]; + char gtconst[MAXLINELEN+1]; // Empty strings. gtdescription[0] = '\0'; @@ -1677,7 +1677,7 @@ void readlevelheader(MYFILE *f, INT32 num) else if (fastcmp(word, "SKYNUM")) mapheaderinfo[num-1]->skynum = (INT16)i; else if (fastcmp(word, "INTERSCREEN")) - strncpy(mapheaderinfo[num-1]->interscreen, word2, 8); + strncpy(mapheaderinfo[num-1]->interscreen, word2, sizeof(mapheaderinfo[num-1]->interscreen)-1); else if (fastcmp(word, "PRECUTSCENENUM")) mapheaderinfo[num-1]->precutscenenum = (UINT8)i; else if (fastcmp(word, "CUTSCENENUM")) @@ -2294,7 +2294,7 @@ static void readtextpromptpage(MYFILE *f, INT32 num, INT32 pagenum) char name[34]; name[0] = '\x82'; // color yellow name[1] = 0; - strncat(name, word2, 33); + strncat(name, word2, 32); name[33] = 0; // Replace _ with ' ' @@ -2304,7 +2304,7 @@ static void readtextpromptpage(MYFILE *f, INT32 num, INT32 pagenum) name[j] = ' '; } - strncpy(textprompts[num]->page[pagenum].name, name, 32); + strncpy(textprompts[num]->page[pagenum].name, name, sizeof(textprompts[num]->page[pagenum].name)); } else *textprompts[num]->page[pagenum].name = '\0'; @@ -3794,7 +3794,7 @@ void readmaincfg(MYFILE *f) } else if (fastcmp(word, "TITLEPICSNAME")) { - strncpy(ttname, word2, 9); + strncpy(ttname, word2, sizeof(ttname)-1); titlechanged = true; } else if (fastcmp(word, "TITLEPICSX")) @@ -3878,8 +3878,12 @@ void readmaincfg(MYFILE *f) savemoddata = true; // Also save a time attack folder - filenamelen = strlen(gamedatafilename)-4; // Strip off the extension - strncpy(timeattackfolder, gamedatafilename, min(filenamelen, sizeof (timeattackfolder))); + filenamelen = strlen(gamedatafilename); // Strip off the extension + if (filenamelen >= 4) + filenamelen -= 4; + if (filenamelen >= sizeof(timeattackfolder)) + filenamelen = sizeof(timeattackfolder)-1; + strncpy(timeattackfolder, gamedatafilename, filenamelen); timeattackfolder[min(filenamelen, sizeof (timeattackfolder) - 1)] = '\0'; strcpy(savegamename, timeattackfolder); diff --git a/src/deh_tables.c b/src/deh_tables.c index fa86518e2..8a3aae586 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -4834,6 +4834,7 @@ const char *const POWERS_LIST[] = { const char *const HUDITEMS_LIST[] = { "LIVES", + "INPUT", "RINGS", "RINGSNUM", diff --git a/src/doomstat.h b/src/doomstat.h index 6a2d6acf0..c2fc96347 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -165,7 +165,7 @@ extern boolean exitfadestarted; typedef struct { UINT8 numpics; - char picname[8][8]; + char picname[8][8+1]; UINT8 pichires[8]; char *text; UINT16 xcoord[8]; @@ -296,69 +296,69 @@ typedef struct typedef struct { // The original eight, plus one. - char lvlttl[22]; ///< Level name without "Zone". (21 character limit instead of 32, 21 characters can display on screen max anyway) - char subttl[33]; ///< Subtitle for level - UINT8 actnum; ///< Act number or 0 for none. - UINT32 typeoflevel; ///< Combination of typeoflevel flags. - INT16 nextlevel; ///< Map number of next level, or 1100-1102 to end. - INT16 marathonnext; ///< See nextlevel, but for Marathon mode. Necessary to support hub worlds ala SUGOI. - char keywords[33]; ///< Keywords separated by space to search for. 32 characters. - char musname[7]; ///< Music track to play. "" for no music. - UINT16 mustrack; ///< Subsong to play. Only really relevant for music modules and specific formats supported by GME. 0 to ignore. - UINT32 muspos; ///< Music position to jump to. - char forcecharacter[17]; ///< (SKINNAMESIZE+1) Skin to switch to or "" to disable. - UINT8 weather; ///< 0 = sunny day, 1 = storm, 2 = snow, 3 = rain, 4 = blank, 5 = thunder w/o rain, 6 = rain w/o lightning, 7 = heat wave. - INT16 skynum; ///< Sky number to use. - INT16 skybox_scalex; ///< Skybox X axis scale. (0 = no movement, 1 = 1:1 movement, 16 = 16:1 slow movement, -4 = 1:4 fast movement, etc.) - INT16 skybox_scaley; ///< Skybox Y axis scale. - INT16 skybox_scalez; ///< Skybox Z axis scale. + char lvlttl[21+1]; ///< Level name without "Zone". (21 character limit instead of 32, 21 characters can display on screen max anyway) + char subttl[32+1]; ///< Subtitle for level + UINT8 actnum; ///< Act number or 0 for none. + UINT32 typeoflevel; ///< Combination of typeoflevel flags. + INT16 nextlevel; ///< Map number of next level, or 1100-1102 to end. + INT16 marathonnext; ///< See nextlevel, but for Marathon mode. Necessary to support hub worlds ala SUGOI. + char keywords[32+1]; ///< Keywords separated by space to search for. 32 characters. + char musname[7]; ///< Music track to play. "" for no music. + UINT16 mustrack; ///< Subsong to play. Only really relevant for music modules and specific formats supported by GME. 0 to ignore. + UINT32 muspos; ///< Music position to jump to. + char forcecharacter[16+1]; ///< (SKINNAMESIZE+1) Skin to switch to or "" to disable. + UINT8 weather; ///< 0 = sunny day, 1 = storm, 2 = snow, 3 = rain, 4 = blank, 5 = thunder w/o rain, 6 = rain w/o lightning, 7 = heat wave. + INT16 skynum; ///< Sky number to use. + INT16 skybox_scalex; ///< Skybox X axis scale. (0 = no movement, 1 = 1:1 movement, 16 = 16:1 slow movement, -4 = 1:4 fast movement, etc.) + INT16 skybox_scaley; ///< Skybox Y axis scale. + INT16 skybox_scalez; ///< Skybox Z axis scale. // Extra information. - char interscreen[8]; ///< 320x200 patch to display at intermission. - char runsoc[33]; ///< SOC to execute at start of level (32 character limit instead of 63) - char scriptname[33]; ///< Script to use when the map is switched to. (32 character limit instead of 191) - UINT8 precutscenenum; ///< Cutscene number to play BEFORE a level starts. - UINT8 cutscenenum; ///< Cutscene number to use, 0 for none. - INT16 countdown; ///< Countdown until level end? - UINT16 palette; ///< PAL lump to use on this map - UINT8 numlaps; ///< Number of laps in circuit mode, unless overridden. - SINT8 unlockrequired; ///< Is an unlockable required to play this level? -1 if no. - UINT8 levelselect; ///< Is this map available in the level select? If so, which map list is it available in? - SINT8 bonustype; ///< What type of bonus does this level have? (-1 for null.) - SINT8 maxbonuslives; ///< How many bonus lives to award at Intermission? (-1 for unlimited.) + char interscreen[8+1]; ///< 320x200 patch to display at intermission. + char runsoc[32+1]; ///< SOC to execute at start of level (32 character limit instead of 63) + char scriptname[32+1]; ///< Script to use when the map is switched to. (32 character limit instead of 191) + UINT8 precutscenenum; ///< Cutscene number to play BEFORE a level starts. + UINT8 cutscenenum; ///< Cutscene number to use, 0 for none. + INT16 countdown; ///< Countdown until level end? + UINT16 palette; ///< PAL lump to use on this map + UINT8 numlaps; ///< Number of laps in circuit mode, unless overridden. + SINT8 unlockrequired; ///< Is an unlockable required to play this level? -1 if no. + UINT8 levelselect; ///< Is this map available in the level select? If so, which map list is it available in? + SINT8 bonustype; ///< What type of bonus does this level have? (-1 for null.) + SINT8 maxbonuslives; ///< How many bonus lives to award at Intermission? (-1 for unlimited.) - UINT16 levelflags; ///< LF_flags: merged booleans into one UINT16 for space, see below - UINT8 menuflags; ///< LF2_flags: options that affect record attack / nights mode menus + UINT16 levelflags; ///< LF_flags: merged booleans into one UINT16 for space, see below + UINT8 menuflags; ///< LF2_flags: options that affect record attack / nights mode menus - char selectheading[22]; ///< Level select heading. Allows for controllable grouping. - UINT16 startrings; ///< Number of rings players start with. - INT32 sstimer; ///< Timer for special stages. - UINT32 ssspheres; ///< Sphere requirement in special stages. - fixed_t gravity; ///< Map-wide gravity. + char selectheading[22]; ///< Level select heading. Allows for controllable grouping. + UINT16 startrings; ///< Number of rings players start with. + INT32 sstimer; ///< Timer for special stages. + UINT32 ssspheres; ///< Sphere requirement in special stages. + fixed_t gravity; ///< Map-wide gravity. // Title card. - char ltzzpatch[9]; ///< Zig zag patch. - char ltzztext[9]; ///< Zig zag text. - char ltactdiamond[9]; ///< Act diamond. + char ltzzpatch[8+1]; ///< Zig zag patch. + char ltzztext[8+1]; ///< Zig zag text. + char ltactdiamond[8+1]; ///< Act diamond. // Freed animals stuff. - UINT8 numFlickies; ///< Internal. For freed flicky support. - mobjtype_t *flickies; ///< List of freeable flickies in this level. Allocated dynamically for space reasons. Be careful. + UINT8 numFlickies; ///< Internal. For freed flicky support. + mobjtype_t *flickies; ///< List of freeable flickies in this level. Allocated dynamically for space reasons. Be careful. // NiGHTS stuff. - UINT8 numGradedMares; ///< Internal. For grade support. - nightsgrades_t *grades; ///< NiGHTS grades. Allocated dynamically for space reasons. Be careful. + UINT8 numGradedMares; ///< Internal. For grade support. + nightsgrades_t *grades; ///< NiGHTS grades. Allocated dynamically for space reasons. Be careful. // Music stuff. - UINT32 musinterfadeout; ///< Fade out level music on intermission screen in milliseconds - char musintername[7]; ///< Intermission screen music. + UINT32 musinterfadeout; ///< Fade out level music on intermission screen in milliseconds + char musintername[7]; ///< Intermission screen music. char muspostbossname[7]; ///< Post-bossdeath music. UINT16 muspostbosstrack; ///< Post-bossdeath track. UINT32 muspostbosspos; ///< Post-bossdeath position UINT32 muspostbossfadein; ///< Post-bossdeath fade-in milliseconds. - SINT8 musforcereset; ///< Force resetmusic (-1 for default; 0 for force off; 1 for force on) + SINT8 musforcereset; ///< Force resetmusic (-1 for default; 0 for force off; 1 for force on) // Lua stuff. // (This is not ifdeffed so the map header structure can stay identical, just in case.) @@ -638,6 +638,7 @@ extern boolean singletics; extern consvar_t cv_timetic; // display high resolution timer extern consvar_t cv_powerupdisplay; // display powerups +extern consvar_t cv_showinput; // display input viewer outside of time attack extern consvar_t cv_showinputjoy; // display joystick in time attack extern consvar_t cv_forceskin; // force clients to use the server's skin extern consvar_t cv_downloading; // allow clients to downloading WADs. diff --git a/src/f_finale.c b/src/f_finale.c index 0b618a1e3..c221ed52f 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -4387,11 +4387,10 @@ void F_GetPromptPageByNamedTag(const char *tag, INT32 *promptnum, INT32 *pagenum if (!tag || !tag[0]) return; - strncpy(suffixedtag, tag, 33); - suffixedtag[32] = 0; + strncpy(suffixedtag, tag, sizeof(suffixedtag)-1); if (tutorialmode) - suffixed = F_GetTextPromptTutorialTag(suffixedtag, 33); + suffixed = F_GetTextPromptTutorialTag(suffixedtag, sizeof(suffixedtag)-1); for (*promptnum = 0 + tutorialpromptnum; *promptnum < MAX_PROMPTS; (*promptnum)++) { diff --git a/src/f_finale.h b/src/f_finale.h index cb71775d0..4b777eb11 100644 --- a/src/f_finale.h +++ b/src/f_finale.h @@ -96,7 +96,7 @@ typedef enum extern ttmode_enum ttmode; extern UINT8 ttscale; // ttmode user vars -extern char ttname[9]; +extern char ttname[8+1]; extern INT16 ttx; extern INT16 tty; extern INT16 ttloop; diff --git a/src/g_demo.c b/src/g_demo.c index f64f34168..859ac5cba 100644 --- a/src/g_demo.c +++ b/src/g_demo.c @@ -1650,7 +1650,7 @@ static void G_LoadDemoExtraFiles(UINT8 **pp, UINT16 this_demo_version) UINT16 totalfiles; char filename[MAX_WADPATH]; UINT8 md5sum[16]; - filestatus_t ncs; + filestatus_t ncs = FS_NOTFOUND; boolean toomany = false; boolean alreadyloaded; UINT16 i, j; diff --git a/src/g_game.c b/src/g_game.c index 6a99381e7..0e7e2b344 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -5403,7 +5403,7 @@ void G_FreeMapSearch(mapsearchfreq_t *freq, INT32 freqc) INT32 G_FindMapByNameOrCode(const char *mapname, char **realmapnamep) { boolean usemapcode = false; - INT32 newmapnum; + INT32 newmapnum = -1; size_t mapnamelen = strlen(mapname); char *p; diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index acd09f614..75a92c2fb 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -180,7 +180,7 @@ FUNCPRINTF void GL_DBG_Printf(const char *format, ...) // GL_MSG_Warning : Raises a warning. // -----------------+ -static void GL_MSG_Warning(const char *format, ...) +FUNCPRINTF static void GL_MSG_Warning(const char *format, ...) { char str[4096] = ""; va_list arglist; @@ -203,7 +203,7 @@ static void GL_MSG_Warning(const char *format, ...) // GL_MSG_Error : Raises an error. // -----------------+ -static void GL_MSG_Error(const char *format, ...) +FUNCPRINTF static void GL_MSG_Error(const char *format, ...) { char str[4096] = ""; va_list arglist; diff --git a/src/hu_stuff.c b/src/hu_stuff.c index c9744e598..13d499495 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -465,9 +465,12 @@ static void DoSayCommand(SINT8 target, size_t usedargs, UINT8 flags) numwords = COM_Argc() - usedargs; I_Assert(numwords > 0); - if (CHAT_MUTE) // TODO: Per Player mute. + if (CHAT_MUTE) { - HU_AddChatText(va("%s>ERROR: The chat is muted. You can't say anything.", "\x85"), false); + if (cv_mute.value) + HU_AddChatText(va("%s>ERROR: The chat is muted. You can't say anything.", "\x85"), false); + else + HU_AddChatText(va("%s>ERROR: You have been muted. You can't say anything.", "\x85"), false); return; } @@ -496,10 +499,10 @@ static void DoSayCommand(SINT8 target, size_t usedargs, UINT8 flags) // what we're gonna do now is check if the player exists // with that logic, characters 4 and 5 are our numbers: const char *newmsg; - char playernum[3]; + char playernum[3+1]; INT32 spc = 1; // used if playernum[1] is a space. - strncpy(playernum, msg+3, 3); + strncpy(playernum, msg+3, sizeof(playernum)-1); // check for undesirable characters in our "number" if (((playernum[0] < '0') || (playernum[0] > '9')) || ((playernum[1] < '0') || (playernum[1] > '9'))) { @@ -644,9 +647,9 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) msg = (char *)*p; SKIPSTRINGL(*p, HU_MAXMSGLEN + 1); - if ((cv_mute.value || flags & (HU_CSAY|HU_SERVER_SAY)) && playernum != serverplayer && !(IsPlayerAdmin(playernum))) + if ((cv_mute.value || players[playernum].muted || flags & (HU_CSAY|HU_SERVER_SAY)) && playernum != serverplayer && !(IsPlayerAdmin(playernum))) { - CONS_Alert(CONS_WARNING, cv_mute.value ? + CONS_Alert(CONS_WARNING, (cv_mute.value || players[playernum].muted) ? M_GetText("Illegal say command received from %s while muted\n") : M_GetText("Illegal csay command received from non-admin %s\n"), player_names[playernum]); if (server) @@ -962,14 +965,17 @@ static void HU_sendChatMessage(void) // last minute mute check if (CHAT_MUTE) { - HU_AddChatText(va("%s>ERROR: The chat is muted. You can't say anything.", "\x85"), false); + if (cv_mute.value) + HU_AddChatText(va("%s>ERROR: The chat is muted. You can't say anything.", "\x85"), false); + else + HU_AddChatText(va("%s>ERROR: You have been muted. You can't say anything.", "\x85"), false); return; } if (strlen(msg) > 4 && strnicmp(msg, "/pm", 3) == 0) // used /pm { INT32 spc = 1; // used if playernum[1] is a space. - char playernum[3]; + char playernum[3+1]; const char *newmsg; // what we're gonna do now is check if the player exists @@ -982,7 +988,7 @@ static void HU_sendChatMessage(void) return; } - strncpy(playernum, msg+3, 3); + strncpy(playernum, msg+3, sizeof(playernum)-1); // check for undesirable characters in our "number" if (!(isdigit(playernum[0]) && isdigit(playernum[1]))) { @@ -1567,7 +1573,6 @@ static void HU_DrawChat(void) INT32 cflag = 0; const char *ntalk = "Say: ", *ttalk = "Team: "; const char *talk = ntalk; - const char *mute = "Chat has been muted."; #ifdef NETSPLITSCREEN if (splitscreen) @@ -1594,7 +1599,10 @@ static void HU_DrawChat(void) if (CHAT_MUTE) { - talk = mute; + if (cv_mute.value) + talk = "Chat has been muted."; + else + talk = "You have been muted."; typelines = 1; cflag = V_GRAYMAP; // set text in gray if chat is muted. } @@ -1679,13 +1687,14 @@ static void HU_DrawChat(void) // filter: (code needs optimization pls help I'm bad with C) if (w_chat[3]) { - char playernum[3]; + char playernum[3+1]; UINT32 n; // right, that's half important: (w_chat[4] may be a space since /pm0 msg is perfectly acceptable!) if ( ( ((w_chat[3] != 0) && ((w_chat[3] < '0') || (w_chat[3] > '9'))) || ((w_chat[4] != 0) && (((w_chat[4] < '0') || (w_chat[4] > '9'))))) && (w_chat[4] != ' ')) break; - strncpy(playernum, w_chat+3, 3); + strncpy(playernum, w_chat+3, sizeof(playernum)-1); + playernum[3] = 0; n = atoi(playernum); // turn that into a number // special cases: @@ -2982,7 +2991,7 @@ void HU_DoCEcho(const char *msg) { I_OutputMsg("%s\n", msg); // print to log - strncpy(cechotext, msg, sizeof(cechotext)); + strncpy(cechotext, msg, sizeof(cechotext)-1); strncat(cechotext, "\\", sizeof(cechotext) - strlen(cechotext) - 1); cechotext[sizeof(cechotext) - 1] = '\0'; cechotimer = cechoduration; diff --git a/src/hu_stuff.h b/src/hu_stuff.h index b3069c215..9ca50e6e1 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -69,8 +69,8 @@ typedef struct #else #define OLDCHAT (cv_consolechat.value == 1 || dedicated || vid.width < 640 || splitscreen) #endif -#define CHAT_MUTE (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) // this still allows to open the chat but not to type. That's used for scrolling and whatnot. -#define OLD_MUTE (OLDCHAT && cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) // this is used to prevent oldchat from opening when muted. +#define CHAT_MUTE ((cv_mute.value || players[consoleplayer].muted) && !(server || IsPlayerAdmin(consoleplayer))) // this still allows to open the chat but not to type. That's used for scrolling and whatnot. +#define OLD_MUTE (OLDCHAT && (cv_mute.value || players[consoleplayer].muted) && !(server || IsPlayerAdmin(consoleplayer))) // this is used to prevent oldchat from opening when muted. // some functions void HU_AddChatText(const char *text, boolean playsound); diff --git a/src/info.c b/src/info.c index 9f8c2b811..8dd1aac80 100644 --- a/src/info.c +++ b/src/info.c @@ -648,13 +648,13 @@ playersprite_t spr2defaults[NUMPLAYERSPRITES] = { 0, // SPR2_TRNS, - FF_SPR2SUPER|SPR2_STND, // SPR2_NSTD, - FF_SPR2SUPER|SPR2_FALL, // SPR2_NFLT, + SPR2_STND, // SPR2_NSTD, + SPR2_FALL, // SPR2_NFLT, 0, // SPR2_NFLY, (will never be referenced unless skin 0 lacks this) SPR2_NFLY, // SPR2_NDRL, - FF_SPR2SUPER|SPR2_STUN, // SPR2_NSTN, + SPR2_STUN, // SPR2_NSTN, SPR2_NSTN, // SPR2_NPUL, - FF_SPR2SUPER|SPR2_ROLL, // SPR2_NATK, + SPR2_ROLL, // SPR2_NATK, 0, // SPR2_TAL0, (this will look mighty stupid but oh well) SPR2_TAL0, // SPR2_TAL1, diff --git a/src/lua_hud.h b/src/lua_hud.h index ba102f2f4..36ce230ed 100644 --- a/src/lua_hud.h +++ b/src/lua_hud.h @@ -19,11 +19,13 @@ enum hud { hud_stagetitle = 0, hud_textspectator, hud_crosshair, + hud_powerups, // Singleplayer / Co-op hud_score, hud_time, hud_rings, hud_lives, + hud_input, // Match / CTF / Tag / Ringslinger hud_weaponrings, hud_powerstones, diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 52a875e50..d66521263 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -41,6 +41,7 @@ static const char *const hud_disable_options[] = { "stagetitle", "textspectator", "crosshair", + "powerups", "score", "time", diff --git a/src/m_cheat.c b/src/m_cheat.c index 36438a475..07f100717 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -1432,14 +1432,22 @@ void OP_ObjectplaceMovement(player_t *player) // // Objectplace related commands. // -/*void Command_Writethings_f(void) +void Command_Writethings_f(void) { REQUIRE_INLEVEL; REQUIRE_SINGLEPLAYER; REQUIRE_OBJECTPLACE; - P_WriteThings(); -}*/ + if (COM_Argc() > 1) + { + P_WriteThings(COM_Argv(1)); + } + else + { + CONS_Printf(M_GetText("writethings : write out map things to a file, .txt or .lmp automatically appended.\n")); + return; + } +} void Command_ObjectPlace_f(void) { diff --git a/src/m_cheat.h b/src/m_cheat.h index f4ac01d84..564c6da77 100644 --- a/src/m_cheat.h +++ b/src/m_cheat.h @@ -26,7 +26,7 @@ void cht_Init(void); // ObjectPlace // void Command_ObjectPlace_f(void); -//void Command_Writethings_f(void); +void Command_Writethings_f(void); extern consvar_t cv_opflags, cv_ophoopflags, cv_mapthingnum, cv_speed; //extern consvar_t cv_snapto, cv_grid; diff --git a/src/m_menu.c b/src/m_menu.c index fcde0d148..0f6f427cf 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2692,7 +2692,7 @@ static boolean MIT_SetCurTitlePics(UINT32 menutype, INT32 level, INT32 *retval, curhidepics = menupres[menutype].hidetitlepics; curttmode = menupres[menutype].ttmode; curttscale = (menupres[menutype].ttscale != UINT8_MAX ? menupres[menutype].ttscale : ttscale); - strncpy(curttname, menupres[menutype].ttname, 9); + strncpy(curttname, menupres[menutype].ttname, sizeof(curttname)-1); curttx = (menupres[menutype].ttx != INT16_MAX ? menupres[menutype].ttx : ttx); curtty = (menupres[menutype].tty != INT16_MAX ? menupres[menutype].tty : tty); curttloop = (menupres[menutype].ttloop != INT16_MAX ? menupres[menutype].ttloop : ttloop); @@ -11235,7 +11235,8 @@ static void M_DrawRoomMenu(void) if (dot_frame < 0) dot_frame = 0; - strncpy(&text[dot_frame], "...", min(dots, 3 - dot_frame)); + if (dot_frame != 3) + strncpy(&text[dot_frame], "...", min(dots, 3 - dot_frame)); } frame += renderdeltatics; diff --git a/src/m_menu.h b/src/m_menu.h index 3cd2f66d3..99a5b6de4 100644 --- a/src/m_menu.h +++ b/src/m_menu.h @@ -378,7 +378,7 @@ typedef struct char displayname[SKINNAMESIZE+1]; INT16 skinnum[2]; UINT16 oppositecolor; - char nametag[8]; + char nametag[8+1]; patch_t *namepic; UINT16 tagtextcolor; UINT16 tagoutlinecolor; diff --git a/src/netcode/client_connection.c b/src/netcode/client_connection.c index 36ed71826..917e32b59 100644 --- a/src/netcode/client_connection.c +++ b/src/netcode/client_connection.c @@ -307,7 +307,7 @@ boolean CL_SendJoin(void) else player2name = cv_playername2.zstring; - strncpy(netbuffer->u.clientcfg.names[0], cv_playername.zstring, MAXPLAYERNAME); + strncpy(netbuffer->u.clientcfg.names[0], cv_playername.zstring, sizeof(netbuffer->u.clientcfg.names[0])-1); strncpy(netbuffer->u.clientcfg.names[1], player2name, MAXPLAYERNAME); return HSendPacket(servernode, true, 0, sizeof (clientconfig_pak)); diff --git a/src/netcode/commands.c b/src/netcode/commands.c index 46dfbc741..f3bbc8a86 100644 --- a/src/netcode/commands.c +++ b/src/netcode/commands.c @@ -41,6 +41,8 @@ typedef struct banreason_s static banreason_t *reasontail = NULL; //last entry, use prev static banreason_t *reasonhead = NULL; //1st entry, use next +static boolean bans_loaded = false; + void Ban_Add(const char *reason) { banreason_t *reasonlist = malloc(sizeof(*reasonlist)); @@ -85,6 +87,8 @@ void Ban_Load_File(boolean warning) if (!I_ClearBans) return; + bans_loaded = true; + f = fopen(va("%s"PATHSEP"%s", srb2home, "ban.txt"), "r"); if (!f) @@ -124,6 +128,12 @@ void D_SaveBan(void) const char *address, *mask; const char *path = va("%s"PATHSEP"%s", srb2home, "ban.txt"); + if (!bans_loaded) + { + // don't save bans if they were never loaded. + return; + } + if (!reasonhead) { remove(path); diff --git a/src/netcode/d_net.c b/src/netcode/d_net.c index 5a2e229d3..b24409db1 100644 --- a/src/netcode/d_net.c +++ b/src/netcode/d_net.c @@ -940,7 +940,7 @@ void Command_Droprate(void) static boolean ShouldDropPacket(void) { return (packetdropquantity[netbuffer->packettype]) - || (packetdroprate != 0 && rand() < (RAND_MAX * (packetdroprate / 100.f))) || packetdroprate == 100; + || (packetdroprate != 0 && rand() < (((double)RAND_MAX) * (packetdroprate / 100.f))) || packetdroprate == 100; } #endif diff --git a/src/netcode/d_netcmd.c b/src/netcode/d_netcmd.c index c5b402165..0b8f68e1b 100644 --- a/src/netcode/d_netcmd.c +++ b/src/netcode/d_netcmd.c @@ -149,6 +149,10 @@ static void Command_Teamchange_f(void); static void Command_Teamchange2_f(void); static void Command_ServerTeamChange_f(void); +static void Command_MutePlayer_f(void); +static void Command_UnmutePlayer_f(void); +static void Got_MutePlayer(UINT8 **cp, INT32 playernum); + static void Command_Clearscores_f(void); // Remote Administration @@ -209,6 +213,7 @@ static CV_PossibleValue_t matchboxes_cons_t[] = {{0, "Normal"}, {1, "Mystery"}, static CV_PossibleValue_t chances_cons_t[] = {{0, "MIN"}, {9, "MAX"}, {0, NULL}}; static CV_PossibleValue_t pause_cons_t[] = {{0, "Server"}, {1, "All"}, {0, NULL}}; +consvar_t cv_showinput = CVAR_INIT ("showinput", "Off", CV_ALLOWLUA, CV_OnOff, NULL); consvar_t cv_showinputjoy = CVAR_INIT ("showinputjoy", "Off", CV_ALLOWLUA, CV_OnOff, NULL); #ifdef NETGAME_DEVMODE @@ -487,6 +492,10 @@ void D_RegisterServerCommands(void) RegisterNetXCmd(XD_TEAMCHANGE, Got_Teamchange); COM_AddCommand("serverchangeteam", Command_ServerTeamChange_f, COM_LUA); + RegisterNetXCmd(XD_MUTEPLAYER, Got_MutePlayer); + COM_AddCommand("muteplayer", Command_MutePlayer_f, COM_LUA); + COM_AddCommand("unmuteplayer", Command_UnmutePlayer_f, COM_LUA); + RegisterNetXCmd(XD_CLEARSCORES, Got_Clearscores); COM_AddCommand("clearscores", Command_Clearscores_f, COM_LUA); COM_AddCommand("map", Command_Map_f, COM_LUA); @@ -743,6 +752,7 @@ void D_RegisterClientCommands(void) CV_RegisterVar(&cv_timetic); CV_RegisterVar(&cv_powerupdisplay); CV_RegisterVar(&cv_itemfinder); + CV_RegisterVar(&cv_showinput); CV_RegisterVar(&cv_showinputjoy); // time attack ghost options are also saved to config @@ -911,7 +921,7 @@ void D_RegisterClientCommands(void) // ingame object placing COM_AddCommand("objectplace", Command_ObjectPlace_f, COM_LUA); - //COM_AddCommand("writethings", Command_Writethings_f); + COM_AddCommand("writethings", Command_Writethings_f, COM_LUA); CV_RegisterVar(&cv_speed); CV_RegisterVar(&cv_opflags); CV_RegisterVar(&cv_ophoopflags); @@ -1311,7 +1321,7 @@ static void SendNameAndColor(void) CV_StealthSet(&cv_playername, player_names[consoleplayer]); HU_AddChatText("\x85*You must wait to change your name again", false); } - else if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) + else if ((cv_mute.value || players[consoleplayer].muted) && !(server || IsPlayerAdmin(consoleplayer))) CV_StealthSet(&cv_playername, player_names[consoleplayer]); else // Cleanup name if changing it CleanupPlayerName(consoleplayer, cv_playername.zstring); @@ -2486,6 +2496,91 @@ static void Command_Teamchange2_f(void) SendNetXCmd2(XD_TEAMCHANGE, &usvalue, sizeof(usvalue)); } +static void MutePlayer(boolean mute) +{ + UINT8 data[2]; + if (!(server || (IsPlayerAdmin(consoleplayer)))) + { + CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n")); + return; + } + + if (COM_Argc() < 2) + { + CONS_Printf(M_GetText("muteplayer : mute a player\n")); + return; + } + + data[0] = atoi(COM_Argv(1)); + if (data[0] >= MAXPLAYERS || !playeringame[data[0]]) + { + CONS_Alert(CONS_NOTICE, M_GetText("There is no player %u!\n"), (unsigned int)data[0]); + return; + } + + if (players[data[0]].muted && mute) + { + CONS_Printf(M_GetText("%s is already muted!\n"), player_names[data[0]]); + return; + } + else if (!players[data[0]].muted && !mute) + { + CONS_Printf(M_GetText("%s is not muted!\n"), player_names[data[0]]); + return; + } + + data[1] = mute; + SendNetXCmd(XD_MUTEPLAYER, &data, sizeof(data)); +} + +static void Command_MutePlayer_f(void) +{ + MutePlayer(true); +} + +static void Command_UnmutePlayer_f(void) +{ + MutePlayer(false); +} + +static void Got_MutePlayer(UINT8 **cp, INT32 playernum) +{ + UINT8 player = READUINT8(*cp); + UINT8 muted = READUINT8(*cp); + if (playernum != serverplayer && !IsPlayerAdmin(playernum)) + { + CONS_Alert(CONS_WARNING, M_GetText("Illegal mute received from player %s\n"), player_names[playernum]); + if (server) + SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY); + return; + } + + if (player >= MAXPLAYERS || !playeringame[player]) + { + CONS_Alert(CONS_WARNING, M_GetText("Illegal mute received from player %s\n"), player_names[playernum]); + if (server) + SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY); + return; + } + + if (!players[player].muted && muted) + { + if (player == consoleplayer) + CONS_Printf(M_GetText("You have been muted.\n")); + else + CONS_Printf(M_GetText("%s has been muted.\n"), player_names[player]); + } + else if (players[player].muted && !muted) + { + if (player == consoleplayer) + CONS_Printf(M_GetText("You are no longer muted.\n")); + else + CONS_Printf(M_GetText("%s is no longer muted.\n"), player_names[player]); + } + + players[player].muted = muted; +} + static void Command_ServerTeamChange_f(void) { changeteam_union NetPacket; @@ -4783,7 +4878,7 @@ static void ForceSkin_OnChange(void) //Allows the player's name to be changed if cv_mute is off. static void Name_OnChange(void) { - if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) + if ((cv_mute.value || players[consoleplayer].muted) && !(server || IsPlayerAdmin(consoleplayer))) { CONS_Alert(CONS_NOTICE, M_GetText("You may not change your name when chat is muted.\n")); CV_StealthSet(&cv_playername, player_names[consoleplayer]); @@ -4794,7 +4889,7 @@ static void Name_OnChange(void) static void Name2_OnChange(void) { - if (cv_mute.value) //Secondary player can't be admin. + if (cv_mute.value || players[consoleplayer].muted) //Secondary player can't be admin. { CONS_Alert(CONS_NOTICE, M_GetText("You may not change your name when chat is muted.\n")); CV_StealthSet(&cv_playername2, player_names[secondarydisplayplayer]); diff --git a/src/netcode/d_netcmd.h b/src/netcode/d_netcmd.h index 03c50a2fa..f92878a4e 100644 --- a/src/netcode/d_netcmd.h +++ b/src/netcode/d_netcmd.h @@ -149,6 +149,7 @@ typedef enum XD_LUACMD, // 22 XD_LUAVAR, // 23 XD_LUAFILE, // 24 + XD_MUTEPLAYER, // 25 MAXNETXCMD } netxcmd_t; diff --git a/src/netcode/http-mserv.c b/src/netcode/http-mserv.c index 2b52380cf..b8c662a51 100644 --- a/src/netcode/http-mserv.c +++ b/src/netcode/http-mserv.c @@ -134,7 +134,7 @@ HMS_on_read (char *s, size_t _1, size_t n, void *userdata) return n; } -static struct HMS_buffer * +FUNCDEBUG static struct HMS_buffer * HMS_connect (int proto, const char *format, ...) { va_list ap; diff --git a/src/netcode/server_connection.c b/src/netcode/server_connection.c index bbabc8f1d..f4601e4ac 100644 --- a/src/netcode/server_connection.c +++ b/src/netcode/server_connection.c @@ -115,12 +115,12 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime) netbuffer->u.serverinfo.refusereason = GetRefuseReason(node); strncpy(netbuffer->u.serverinfo.gametypename, Gametype_Names[gametype], - sizeof netbuffer->u.serverinfo.gametypename); + sizeof(netbuffer->u.serverinfo.gametypename)-1); netbuffer->u.serverinfo.modifiedgame = (UINT8)modifiedgame; netbuffer->u.serverinfo.cheatsenabled = CV_CheatsEnabled(); netbuffer->u.serverinfo.flags = (dedicated ? SV_DEDICATED : 0); strncpy(netbuffer->u.serverinfo.servername, cv_servername.string, - MAXSERVERNAME); + sizeof(netbuffer->u.serverinfo.servername)-1); strncpy(netbuffer->u.serverinfo.mapname, G_BuildMapName(gamemap), 7); M_Memcpy(netbuffer->u.serverinfo.mapmd5, mapmd5, 16); @@ -184,7 +184,9 @@ static void SV_SendPlayerInfo(INT32 node) } netbuffer->u.playerinfo[i].num = i; - strncpy(netbuffer->u.playerinfo[i].name, (const char *)&player_names[i], MAXPLAYERNAME+1); + memset(netbuffer->u.playerinfo[i].name, 0x00, sizeof(netbuffer->u.playerinfo[i].name)); + memcpy(netbuffer->u.playerinfo[i].name, player_names[i], sizeof(player_names[i])); + netbuffer->u.playerinfo[i].name[MAXPLAYERNAME] = '\0'; //fetch IP address diff --git a/src/p_mobj.c b/src/p_mobj.c index 8bc6abc54..715e87974 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -402,9 +402,9 @@ static boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state) UINT16 stateframe = st->frame; // Add/Remove FF_SPR2SUPER based on certain conditions - if (player->charflags & SF_NOSUPERSPRITES) + if (player->charflags & SF_NOSUPERSPRITES || (player->powers[pw_carry] == CR_NIGHTSMODE && (player->charflags & SF_NONIGHTSSUPER))) stateframe = stateframe & ~FF_SPR2SUPER; - else if (player->powers[pw_super]) + else if (player->powers[pw_super] || (player->powers[pw_carry] == CR_NIGHTSMODE && (player->charflags & SF_SUPER))) stateframe = stateframe | FF_SPR2SUPER; if (stateframe & FF_SPR2SUPER) diff --git a/src/p_saveg.c b/src/p_saveg.c index 6c6548c56..c385bd8e1 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -170,6 +170,7 @@ static void P_NetArchivePlayers(void) WRITEUINT8(save_p, players[i].panim); WRITEUINT8(save_p, players[i].stronganim); WRITEUINT8(save_p, players[i].spectator); + WRITEUINT8(save_p, players[i].muted); WRITEUINT16(save_p, players[i].flashpal); WRITEUINT16(save_p, players[i].flashcount); @@ -399,6 +400,7 @@ static void P_NetUnArchivePlayers(void) players[i].panim = READUINT8(save_p); players[i].stronganim = READUINT8(save_p); players[i].spectator = READUINT8(save_p); + players[i].muted = READUINT8(save_p); players[i].flashpal = READUINT16(save_p); players[i].flashcount = READUINT16(save_p); diff --git a/src/p_setup.c b/src/p_setup.c index 6a5e4c769..93c4937c4 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -877,14 +877,32 @@ static void P_SpawnMapThings(boolean spawnemblems) P_SpawnEmeraldHunt(); } +static void P_WriteTextmap_Things(FILE *f, const mapthing_t *wmapthings); // proto + // Experimental groovy write function! -/*void P_WriteThings(void) +void P_WriteThings(const char *filepath) { size_t i, length; mapthing_t *mt; UINT8 *savebuffer, *savebuf_p; INT16 temp; + if (udmf) + { + FILE *f = fopen(va("%s.txt", filepath), "w"); + if (!f) + { + CONS_Alert(CONS_ERROR, M_GetText("Couldn't write to file %s\n"), filepath); + return; + } + + P_WriteTextmap_Things(f, mapthings); + fclose(f); + + CONS_Printf(M_GetText("%s.txt saved.\n"), filepath); + return; + } + savebuf_p = savebuffer = (UINT8 *)malloc(nummapthings * sizeof (mapthing_t)); if (!savebuf_p) @@ -908,12 +926,12 @@ static void P_SpawnMapThings(boolean spawnemblems) length = savebuf_p - savebuffer; - FIL_WriteFile(va("newthings%d.lmp", gamemap), savebuffer, length); + FIL_WriteFile(va("%s.lmp", filepath), savebuffer, length); free(savebuffer); savebuf_p = NULL; - CONS_Printf(M_GetText("newthings%d.lmp saved.\n"), gamemap); -}*/ + CONS_Printf(M_GetText("%s.lmp saved.\n"), filepath); +} // // MAP LOADING FUNCTIONS @@ -2150,6 +2168,60 @@ typedef struct mapthing_t *angleanchor; } sectorspecialthings_t; +static void P_WriteTextmap_Things(FILE *f, const mapthing_t *wmapthings) +{ + size_t i, j; + mtag_t firsttag; + + // Actual writing + for (i = 0; i < nummapthings; i++) + { + fprintf(f, "thing // %s\n", sizeu1(i)); + fprintf(f, "{\n"); + firsttag = Tag_FGet(&wmapthings[i].tags); + if (firsttag != 0) + fprintf(f, "id = %d;\n", firsttag); + if (wmapthings[i].tags.count > 1) + { + fprintf(f, "moreids = \""); + for (j = 1; j < wmapthings[i].tags.count; j++) + { + if (j > 1) + fprintf(f, " "); + fprintf(f, "%d", wmapthings[i].tags.tags[j]); + } + fprintf(f, "\";\n"); + } + fprintf(f, "x = %d;\n", wmapthings[i].x); + fprintf(f, "y = %d;\n", wmapthings[i].y); + if (wmapthings[i].z != 0) + fprintf(f, "height = %d;\n", wmapthings[i].z); + fprintf(f, "angle = %d;\n", wmapthings[i].angle); + if (wmapthings[i].pitch != 0) + fprintf(f, "pitch = %d;\n", wmapthings[i].pitch); + if (wmapthings[i].roll != 0) + fprintf(f, "roll = %d;\n", wmapthings[i].roll); + if (wmapthings[i].type != 0) + fprintf(f, "type = %d;\n", wmapthings[i].type); + if (wmapthings[i].spritexscale != FRACUNIT) + fprintf(f, "scalex = %f;\n", FIXED_TO_FLOAT(wmapthings[i].spritexscale)); + if (wmapthings[i].spriteyscale != FRACUNIT) + fprintf(f, "scaley = %f;\n", FIXED_TO_FLOAT(wmapthings[i].spriteyscale)); + if (wmapthings[i].scale != FRACUNIT) + fprintf(f, "mobjscale = %f;\n", FIXED_TO_FLOAT(wmapthings[i].scale)); + if (wmapthings[i].options & MTF_OBJECTFLIP) + fprintf(f, "flip = true;\n"); + for (j = 0; j < NUMMAPTHINGARGS; j++) + if (wmapthings[i].args[j] != 0) + fprintf(f, "arg%s = %d;\n", sizeu1(j), wmapthings[i].args[j]); + for (j = 0; j < NUMMAPTHINGSTRINGARGS; j++) + if (mapthings[i].stringargs[j]) + fprintf(f, "stringarg%s = \"%s\";\n", sizeu1(j), mapthings[i].stringargs[j]); + fprintf(f, "}\n"); + fprintf(f, "\n"); + } +} + static void P_WriteTextmap(void) { size_t i, j; @@ -2417,52 +2489,7 @@ static void P_WriteTextmap(void) } fprintf(f, "namespace = \"srb2\";\n"); - for (i = 0; i < nummapthings; i++) - { - fprintf(f, "thing // %s\n", sizeu1(i)); - fprintf(f, "{\n"); - firsttag = Tag_FGet(&wmapthings[i].tags); - if (firsttag != 0) - fprintf(f, "id = %d;\n", firsttag); - if (wmapthings[i].tags.count > 1) - { - fprintf(f, "moreids = \""); - for (j = 1; j < wmapthings[i].tags.count; j++) - { - if (j > 1) - fprintf(f, " "); - fprintf(f, "%d", wmapthings[i].tags.tags[j]); - } - fprintf(f, "\";\n"); - } - fprintf(f, "x = %d;\n", wmapthings[i].x); - fprintf(f, "y = %d;\n", wmapthings[i].y); - if (wmapthings[i].z != 0) - fprintf(f, "height = %d;\n", wmapthings[i].z); - fprintf(f, "angle = %d;\n", wmapthings[i].angle); - if (wmapthings[i].pitch != 0) - fprintf(f, "pitch = %d;\n", wmapthings[i].pitch); - if (wmapthings[i].roll != 0) - fprintf(f, "roll = %d;\n", wmapthings[i].roll); - if (wmapthings[i].type != 0) - fprintf(f, "type = %d;\n", wmapthings[i].type); - if (wmapthings[i].spritexscale != FRACUNIT) - fprintf(f, "scalex = %f;\n", FIXED_TO_FLOAT(wmapthings[i].spritexscale)); - if (wmapthings[i].spriteyscale != FRACUNIT) - fprintf(f, "scaley = %f;\n", FIXED_TO_FLOAT(wmapthings[i].spriteyscale)); - if (wmapthings[i].scale != FRACUNIT) - fprintf(f, "mobjscale = %f;\n", FIXED_TO_FLOAT(wmapthings[i].scale)); - if (wmapthings[i].options & MTF_OBJECTFLIP) - fprintf(f, "flip = true;\n"); - for (j = 0; j < NUMMAPTHINGARGS; j++) - if (wmapthings[i].args[j] != 0) - fprintf(f, "arg%s = %d;\n", sizeu1(j), wmapthings[i].args[j]); - for (j = 0; j < NUMMAPTHINGSTRINGARGS; j++) - if (mapthings[i].stringargs[j]) - fprintf(f, "stringarg%s = \"%s\";\n", sizeu1(j), mapthings[i].stringargs[j]); - fprintf(f, "}\n"); - fprintf(f, "\n"); - } + P_WriteTextmap_Things(f, wmapthings); for (i = 0; i < numvertexes; i++) { diff --git a/src/p_setup.h b/src/p_setup.h index f9e51024d..61c445c65 100644 --- a/src/p_setup.h +++ b/src/p_setup.h @@ -71,7 +71,7 @@ boolean P_AddFolder(const char *folderpath); boolean P_RunSOC(const char *socfilename); void P_LoadSoundsRange(UINT16 wadnum, UINT16 first, UINT16 num); void P_LoadMusicsRange(UINT16 wadnum, UINT16 first, UINT16 num); -//void P_WriteThings(void); +void P_WriteThings(const char *filepath); size_t P_PrecacheLevelFlats(void); void P_AllocMapHeader(INT16 i); diff --git a/src/p_spec.c b/src/p_spec.c index 572258165..805817fb0 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -363,7 +363,7 @@ void P_ParseAnimationDefintion(SINT8 istexture) // Increase the size to make room for the new animation definition maxanims++; animdefs = (animdef_t *)Z_Realloc(animdefs, sizeof(animdef_t)*(maxanims + 1), PU_STATIC, NULL); - strncpy(animdefs[i].startname, animdefsToken, 9); + strncpy(animdefs[i].startname, animdefsToken, sizeof(animdefs[i].startname)-1); } // animdefs[i].startname is now set to animdefsToken either way. diff --git a/src/p_user.c b/src/p_user.c index 9d0eed288..9fc1f8c9b 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4977,7 +4977,7 @@ void P_DoJumpShield(player_t *player) } else { - player->pflags &= ~(PF_JUMPED|PF_NOJUMPDAMAGE); + player->pflags |= PF_NOJUMPDAMAGE; P_SetMobjState(player->mo, S_PLAY_FALL); S_StartSound(player->mo, sfx_wdjump); } @@ -11307,7 +11307,7 @@ void P_DoTailsOverlay(player_t *player, mobj_t *tails) fixed_t backwards = -1*FRACUNIT; boolean doswim = (player->panim == PA_ABILITY && (player->mo->eflags & MFE_UNDERWATER)); boolean doroll = (player->panim == PA_ROLL || (player->panim == PA_JUMP && !(player->charflags & SF_NOJUMPSPIN)) || doswim); - angle_t rollangle; + angle_t rollangle = 0; boolean panimchange; INT32 ticnum = 0; statenum_t chosenstate; @@ -12089,7 +12089,7 @@ void P_PlayerThink(player_t *player) // deez New User eXperiences. { angle_t oldang = player->drawangle, diff = 0; - UINT8 factor; + UINT8 factor = 0; // Directionchar! // Camera angle stuff. if (player->exiting // no control, no modification @@ -13199,7 +13199,7 @@ void P_ForceLocalAngle(player_t *player, angle_t angle) boolean P_PlayerFullbright(player_t *player) { return (player->powers[pw_super] - || ((player->powers[pw_carry] == CR_NIGHTSMODE && (((skin_t *)player->mo->skin)->flags & (SF_SUPER|SF_NONIGHTSSUPER)) == SF_SUPER) // Super colours? Super bright! + || ((player->powers[pw_carry] == CR_NIGHTSMODE && (player->charflags & (SF_SUPER|SF_NONIGHTSSUPER)) == SF_SUPER) // Super colours? Super bright! && (player->exiting || !(player->mo->state >= &states[S_PLAY_NIGHTS_TRANS1] && player->mo->state < &states[S_PLAY_NIGHTS_TRANS6])))); // Note the < instead of <= diff --git a/src/r_segs.c b/src/r_segs.c index a10ddfd37..e07ced86a 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -193,7 +193,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2) if (frontsector->numlights) { dc_numlights = frontsector->numlights; - if (dc_numlights >= dc_maxlights) + if (dc_numlights > dc_maxlights) { dc_maxlights = dc_numlights; dc_lightlist = Z_Realloc(dc_lightlist, sizeof (*dc_lightlist) * dc_maxlights, PU_STATIC, NULL); @@ -349,7 +349,6 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2) { lighttable_t **xwalllights; - sprbotscreen = INT32_MAX; sprtopscreen = windowtop = (centeryfrac - FixedMul(dc_texturemid, spryscale)); realbot = FixedMul(textureheight[texnum], spryscale) + sprtopscreen; @@ -456,10 +455,13 @@ static void R_DrawRepeatMaskedColumn(column_t *col, unsigned lengthcol) static void R_DrawRepeatFlippedMaskedColumn(column_t *col, unsigned lengthcol) { - do { + while (sprtopscreen < sprbotscreen) { R_DrawFlippedMaskedColumn(col, lengthcol); - sprtopscreen += dc_texheight*spryscale; - } while (sprtopscreen < sprbotscreen); + if ((INT64)sprtopscreen + (INT64)dc_texheight*spryscale > (INT64)INT32_MAX) // prevent overflow + sprtopscreen = INT32_MAX; + else + sprtopscreen += dc_texheight*spryscale; + } } // Returns true if a fake floor is translucent. @@ -759,7 +761,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) if (vertflip) // vertically flipped? colfunc_2s = R_DrawRepeatFlippedMaskedColumn; else - colfunc_2s = R_DrawRepeatMaskedColumn; // render the usual 2sided single-patch packed texture + colfunc_2s = R_DrawRepeatMaskedColumn; lengthcol = textures[texnum]->height; @@ -804,6 +806,8 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) else if (bottom_frac > (INT64)CLAMPMIN) sprbotscreen = windowbottom = (fixed_t)bottom_frac; else sprbotscreen = windowbottom = CLAMPMIN; + fixed_t bottomclip = sprbotscreen; + top_frac += top_step; bottom_frac += bottom_step; @@ -836,14 +840,13 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) lighttable_t **xwalllights; fixed_t height; fixed_t bheight = 0; - INT32 solid = 0; - INT32 lighteffect = 0; + boolean lighteffect = false; for (i = 0; i < dc_numlights; i++) { // Check if the current light effects the colormap/lightlevel rlight = &dc_lightlist[i]; - lighteffect = !(dc_lightlist[i].flags & FOF_NOSHADE); + lighteffect = !(rlight->flags & FOF_NOSHADE); if (lighteffect) { lightnum = rlight->lightnum; @@ -876,11 +879,11 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) } } - solid = 0; // don't carry over solid-cutting flag from the previous light - // Check if the current light can cut the current 3D floor. + boolean solid = false; + if (rlight->flags & FOF_CUTSOLIDS && !(pfloor->fofflags & FOF_EXTRA)) - solid = 1; + solid = true; else if (rlight->flags & FOF_CUTEXTRA && pfloor->fofflags & FOF_EXTRA) { if (rlight->flags & FOF_EXTRA) @@ -888,13 +891,13 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) // The light is from an extra 3D floor... Check the flags so // there are no undesired cuts. if ((rlight->flags & (FOF_FOG|FOF_SWIMMABLE)) == (pfloor->fofflags & (FOF_FOG|FOF_SWIMMABLE))) - solid = 1; + solid = true; } else - solid = 1; + solid = true; } else - solid = 0; + solid = false; height = rlight->height; rlight->height += rlight->heightstep; @@ -910,14 +913,14 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) if (lighteffect) dc_colormap = rlight->rcolormap; if (solid && windowtop < bheight) - windowtop = bheight; + sprtopscreen = windowtop = bheight; continue; } - windowbottom = height; - if (windowbottom >= sprbotscreen) + sprbotscreen = windowbottom = height; + if (windowbottom >= bottomclip) { - windowbottom = sprbotscreen; + sprbotscreen = windowbottom = bottomclip; // draw the texture colfunc_2s (col, lengthcol); for (i++; i < dc_numlights; i++) @@ -935,10 +938,11 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) windowtop = bheight; else windowtop = windowbottom + 1; + sprtopscreen = windowtop; if (lighteffect) dc_colormap = rlight->rcolormap; } - windowbottom = sprbotscreen; + sprbotscreen = windowbottom = bottomclip; // draw the texture, if there is any space left if (windowtop < windowbottom) colfunc_2s (col, lengthcol); @@ -1080,6 +1084,9 @@ static void R_RenderSegLoop (void) if (bottomtexture) R_CheckTextureCache(bottomtexture); + if (dc_numlights) + colfunc = colfuncs[COLDRAWFUNC_SHADOWED]; + for (; rw_x < rw_stopx; rw_x++) { // mark floor / ceiling areas diff --git a/src/r_translation.c b/src/r_translation.c index 390545802..a53b30e9f 100644 --- a/src/r_translation.c +++ b/src/r_translation.c @@ -556,7 +556,7 @@ static boolean ParseDecimal(tokenizer_t *sc, double *out) return M_StringToDecimal(tkn, out); } -static struct PaletteRemapParseResult *ThrowError(const char *format, ...) +FUNCPRINTF static struct PaletteRemapParseResult *ThrowError(const char *format, ...) { const size_t err_size = 512 * sizeof(char); @@ -792,7 +792,7 @@ static struct PaletteRemapParseResult *PaletteRemap_ParseTranslation(const char return result; } -static void PrintError(const char *name, const char *format, ...) +FUNCDEBUG static void PrintError(const char *name, const char *format, ...) { char error[256]; diff --git a/src/s_sound.c b/src/s_sound.c index a579292ff..aa049899f 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -1910,7 +1910,7 @@ static void S_AddMusicStackEntry(const char *mname, UINT16 mflags, boolean loopi if (!music_stacks) { music_stacks = Z_Calloc(sizeof (*mst), PU_MUSIC, NULL); - strncpy(music_stacks->musname, (status == JT_MASTER ? mname : (S_CheckQueue() ? queue_name : mapmusname)), 7); + strncpy(music_stacks->musname, (status == JT_MASTER ? mname : (S_CheckQueue() ? queue_name : mapmusname)), sizeof(music_stacks->musname)-1); music_stacks->musflags = (status == JT_MASTER ? mflags : (S_CheckQueue() ? queue_flags : mapmusflags)); music_stacks->looping = (status == JT_MASTER ? looping : (S_CheckQueue() ? queue_looping : true)); music_stacks->position = (status == JT_MASTER ? position : (S_CheckQueue() ? queue_position : S_GetMusicPosition())); @@ -2033,7 +2033,7 @@ boolean S_RecallMusic(UINT16 status, boolean fromfirst) if (result) { *entry = *result; - strncpy(entry->musname, result->musname, 7); + memcpy(entry->musname, result->musname, sizeof(entry->musname)); } // no result, just grab mapmusname @@ -2255,7 +2255,7 @@ void S_ChangeMusicEx(const char *mmusic, UINT16 mflags, boolean looping, UINT32 if (S_MusicDisabled()) return; - strncpy(newmusic, mmusic, 7); + strncpy(newmusic, mmusic, sizeof(newmusic)-1); if (LUA_HookMusicChange(music_name, &hook_param)) return; newmusic[6] = 0; diff --git a/src/s_sound.h b/src/s_sound.h index 288859c8d..d64778fc3 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -238,7 +238,7 @@ UINT32 S_GetMusicPosition(void); typedef struct musicstack_s { - char musname[7]; + char musname[7+1]; UINT16 musflags; boolean looping; UINT32 position; diff --git a/src/screen.c b/src/screen.c index 13de69fcb..9a82a1561 100644 --- a/src/screen.c +++ b/src/screen.c @@ -44,6 +44,8 @@ // SRB2Kart #include "r_fps.h" // R_GetFramerateCap +#include "lua_hud.h" // LUA_HudEnabled + // -------------------------------------------- // assembly or c drawer routines for 8bpp/16bpp // -------------------------------------------- @@ -489,6 +491,7 @@ void SCR_ClosedCaptions(void) basey -= 8; else if ((modeattacking == ATTACKING_NIGHTS) || (!(maptol & TOL_NIGHTS) + && LUA_HudEnabled(hud_powerups) && ((cv_powerupdisplay.value == 2) // "Always" || (cv_powerupdisplay.value == 1 && !camera.chase)))) // "First-person only" basey -= 16; diff --git a/src/sdl/Srb2SDL-vc10.vcxproj b/src/sdl/Srb2SDL-vc10.vcxproj index bebecd8d0..86ffa7082 100644 --- a/src/sdl/Srb2SDL-vc10.vcxproj +++ b/src/sdl/Srb2SDL-vc10.vcxproj @@ -191,7 +191,8 @@ 4244;4267;4146;4003 HAVE_CURL;%(PreprocessorDefinitions) - ..\libs\curl\include;%(AdditionalIncludeDirectories) + ..\..\libs\curl\include;%(AdditionalIncludeDirectories) + false @@ -204,7 +205,7 @@ libcurl.dll.a;libz32.a;%(AdditionalDependencies) - ..\libs\zlib\win32;..\libs\curl\lib32;%(AdditionalLibraryDirectories) + ..\..\libs\zlib\win32;..\..\libs\curl\lib32;%(AdditionalLibraryDirectories) diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index 5509f8cab..9f0fa0250 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -41,12 +41,6 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T); #include #undef SystemFunction036 -// A little more than the minimum sleep duration on Windows. -// May be incorrect for other platforms, but we don't currently have a way to -// query the scheduler granularity. SDL will do what's needed to make this as -// low as possible though. -#define MIN_SLEEP_DURATION_MS 2.1 - #endif #include #include @@ -108,8 +102,11 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T); #endif #endif -#if defined (__unix__) || (defined (UNIXCOMMON) && !defined (__APPLE__)) +#if defined(UNIXCOMMON) #include +#endif + +#if defined (__unix__) || (defined (UNIXCOMMON) && !defined (__APPLE__)) #include #include #define NEWSIGNALHANDLER @@ -222,6 +219,12 @@ static char returnWadPath[256]; #include "../byteptr.h" #endif +// A little more than the minimum sleep duration on Windows. +// May be incorrect for other platforms, but we don't currently have a way to +// query the scheduler granularity. SDL will do what's needed to make this as +// low as possible though. +#define MIN_SLEEP_DURATION_MS 2.1 + /** \brief The JoyReset function \param JoySet Joystick info to reset @@ -1711,7 +1714,7 @@ const char *I_GetJoyName(INT32 joyindex) { tempname = SDL_JoystickNameForIndex(joyindex); if (tempname) - strncpy(joyname, tempname, 255); + strncpy(joyname, tempname, sizeof(joyname)-1); } return joyname; } @@ -2854,7 +2857,7 @@ size_t I_GetRandomBytes(char *destination, size_t count) { #if defined (__unix__) || defined (UNIXCOMMON) || defined(__APPLE__) FILE *rndsource; - size_t actual_bytes; + size_t actual_bytes = 0; if (!(rndsource = fopen("/dev/urandom", "r"))) if (!(rndsource = fopen("/dev/random", "r"))) diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index a5be3a754..8f2ca3408 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -140,15 +140,18 @@ static void Midiplayer_Onchange(void) restart = true; } - if (stricmp(Mix_GetSoundFonts(), cv_midisoundfontpath.string)) + if (!Mix_GetSoundFonts() || stricmp(Mix_GetSoundFonts(), cv_midisoundfontpath.string)) { if (!Mix_SetSoundFonts(cv_midisoundfontpath.string)) // == 0 means error CONS_Alert(CONS_ERROR, "Sound font error: %s", Mix_GetError()); else restart = true; } - +#if SDL_MIXER_VERSION_ATLEAST(2,5,0) + Mix_SetTimidityCfg(cv_miditimiditypath.string); +#else Mix_Timidity_addToPathList(cv_miditimiditypath.string); +#endif if (restart) S_StartEx(true); @@ -159,7 +162,7 @@ static void MidiSoundfontPath_Onchange(void) if (Mix_GetMidiPlayer() != MIDI_Fluidsynth || (I_SongType() != MU_NONE && I_SongType() != MU_MID_EX)) return; - if (stricmp(Mix_GetSoundFonts(), cv_midisoundfontpath.string)) + if (!Mix_GetSoundFonts() || stricmp(Mix_GetSoundFonts(), cv_midisoundfontpath.string)) { char *miditoken; char *source = strdup(cv_midisoundfontpath.string); @@ -286,8 +289,12 @@ void I_StartupSound(void) #ifdef HAVE_MIXERX Mix_SetMidiPlayer(cv_midiplayer.value); Mix_SetSoundFonts(cv_midisoundfontpath.string); +#if SDL_MIXER_VERSION_ATLEAST(2,5,0) + Mix_SetTimidityCfg(cv_miditimiditypath.string); +#else Mix_Timidity_addToPathList(cv_miditimiditypath.string); #endif +#endif #if SDL_MIXER_VERSION_ATLEAST(1,2,11) Mix_Init(MIX_INIT_FLAC|MIX_INIT_MP3|MIX_INIT_OGG|MIX_INIT_MOD); #endif @@ -942,7 +949,12 @@ UINT32 I_GetSongLength(void) else { #ifdef HAVE_MIXERX +#if SDL_MIXER_VERSION_ATLEAST(2,5,0) + double xlength = Mix_MusicDuration(music); +#else double xlength = Mix_GetMusicTotalTime(music); +#endif + if (xlength >= 0) return (UINT32)(xlength*1000); #endif @@ -1198,10 +1210,14 @@ boolean I_LoadSong(char *data, size_t len) #ifdef HAVE_MIXERX if (Mix_GetMidiPlayer() != cv_midiplayer.value) Mix_SetMidiPlayer(cv_midiplayer.value); - if (stricmp(Mix_GetSoundFonts(), cv_midisoundfontpath.string)) + if (!Mix_GetSoundFonts() || stricmp(Mix_GetSoundFonts(), cv_midisoundfontpath.string)) Mix_SetSoundFonts(cv_midisoundfontpath.string); +#if SDL_MIXER_VERSION_ATLEAST(2,5,0) + Mix_SetTimidityCfg(cv_miditimiditypath.string); +#else Mix_Timidity_addToPathList(cv_miditimiditypath.string); // this overwrites previous custom path #endif +#endif #ifdef HAVE_OPENMPT /* diff --git a/src/st_stuff.c b/src/st_stuff.c index 1f4e61822..b3e392499 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -139,6 +139,7 @@ static patch_t *fireflower; hudinfo_t hudinfo[NUMHUDITEMS] = { { 16, 176, V_SNAPTOLEFT|V_SNAPTOBOTTOM}, // HUD_LIVES + { 16, 152, V_SNAPTOLEFT|V_SNAPTOBOTTOM}, // HUD_INPUT { 16, 42, V_SNAPTOLEFT|V_SNAPTOTOP}, // HUD_RINGS { 96, 42, V_SNAPTOLEFT|V_SNAPTOTOP}, // HUD_RINGSNUM @@ -814,7 +815,7 @@ static inline void ST_drawRings(void) static void ST_drawLivesArea(void) { - INT32 v_colmap = V_YELLOWMAP, livescount; + INT32 v_colmap = V_YELLOWMAP, livescount = -1; boolean notgreyedout = false; if (!stplyr->skincolor) @@ -1037,32 +1038,36 @@ static void ST_drawInput(void) INT32 col; UINT8 offs; - INT32 x = hudinfo[HUD_LIVES].x, y = hudinfo[HUD_LIVES].y; + INT32 x = hudinfo[HUD_INPUT].x, y = hudinfo[HUD_INPUT].y; if (stplyr->powers[pw_carry] == CR_NIGHTSMODE) - y -= 16; + y += 8; + else if (modeattacking || !LUA_HudEnabled(hud_lives)) + y += 24; + else if (G_RingSlingerGametype() && LUA_HudEnabled(hud_powerstones)) + y -= 5; if (F_GetPromptHideHud(y)) return; // O backing - V_DrawFill(x, y-1, 16, 16, hudinfo[HUD_LIVES].f|20); - V_DrawFill(x, y+15, 16, 1, hudinfo[HUD_LIVES].f|29); + V_DrawFill(x, y-1, 16, 16, hudinfo[HUD_INPUT].f|20); + V_DrawFill(x, y+15, 16, 1, hudinfo[HUD_INPUT].f|29); if (cv_showinputjoy.value) // joystick render! { - /*V_DrawFill(x , y , 16, 1, hudinfo[HUD_LIVES].f|16); - V_DrawFill(x , y+15, 16, 1, hudinfo[HUD_LIVES].f|16); - V_DrawFill(x , y+ 1, 1, 14, hudinfo[HUD_LIVES].f|16); - V_DrawFill(x+15, y+ 1, 1, 14, hudinfo[HUD_LIVES].f|16); -- red's outline*/ + /*V_DrawFill(x , y , 16, 1, hudinfo[HUD_INPUT.f|16); + V_DrawFill(x , y+15, 16, 1, hudinfo[HUD_INPUT].f|16); + V_DrawFill(x , y+ 1, 1, 14, hudinfo[HUD_INPUT].f|16); + V_DrawFill(x+15, y+ 1, 1, 14, hudinfo[HUD_INPUT].f|16); -- red's outline*/ if (stplyr->cmd.sidemove || stplyr->cmd.forwardmove) { // joystick hole - V_DrawFill(x+5, y+4, 6, 6, hudinfo[HUD_LIVES].f|29); + V_DrawFill(x+5, y+4, 6, 6, hudinfo[HUD_INPUT].f|29); // joystick top V_DrawFill(x+3+stplyr->cmd.sidemove/12, y+2-stplyr->cmd.forwardmove/12, - 10, 10, hudinfo[HUD_LIVES].f|29); + 10, 10, hudinfo[HUD_INPUT].f|29); V_DrawFill(x+3+stplyr->cmd.sidemove/9, y+1-stplyr->cmd.forwardmove/9, 10, 10, accent); @@ -1070,10 +1075,10 @@ static void ST_drawInput(void) else { // just a limited, greyed out joystick top - V_DrawFill(x+3, y+11, 10, 1, hudinfo[HUD_LIVES].f|29); + V_DrawFill(x+3, y+11, 10, 1, hudinfo[HUD_INPUT].f|29); V_DrawFill(x+3, y+1, - 10, 10, hudinfo[HUD_LIVES].f|16); + 10, 10, hudinfo[HUD_INPUT].f|16); } } else // arrows! @@ -1087,10 +1092,10 @@ static void ST_drawInput(void) else { offs = 1; - col = hudinfo[HUD_LIVES].f|16; - V_DrawFill(x- 2, y+10, 6, 1, hudinfo[HUD_LIVES].f|29); - V_DrawFill(x+ 4, y+ 9, 1, 1, hudinfo[HUD_LIVES].f|29); - V_DrawFill(x+ 5, y+ 8, 1, 1, hudinfo[HUD_LIVES].f|29); + col = hudinfo[HUD_INPUT].f|16; + V_DrawFill(x- 2, y+10, 6, 1, hudinfo[HUD_INPUT].f|29); + V_DrawFill(x+ 4, y+ 9, 1, 1, hudinfo[HUD_INPUT].f|29); + V_DrawFill(x+ 5, y+ 8, 1, 1, hudinfo[HUD_INPUT].f|29); } V_DrawFill(x- 2, y+ 5-offs, 6, 6, col); V_DrawFill(x+ 4, y+ 6-offs, 1, 4, col); @@ -1105,12 +1110,12 @@ static void ST_drawInput(void) else { offs = 1; - col = hudinfo[HUD_LIVES].f|16; - V_DrawFill(x+ 5, y+ 3, 1, 1, hudinfo[HUD_LIVES].f|29); - V_DrawFill(x+ 6, y+ 4, 1, 1, hudinfo[HUD_LIVES].f|29); - V_DrawFill(x+ 7, y+ 5, 2, 1, hudinfo[HUD_LIVES].f|29); - V_DrawFill(x+ 9, y+ 4, 1, 1, hudinfo[HUD_LIVES].f|29); - V_DrawFill(x+10, y+ 3, 1, 1, hudinfo[HUD_LIVES].f|29); + col = hudinfo[HUD_INPUT].f|16; + V_DrawFill(x+ 5, y+ 3, 1, 1, hudinfo[HUD_INPUT].f|29); + V_DrawFill(x+ 6, y+ 4, 1, 1, hudinfo[HUD_INPUT].f|29); + V_DrawFill(x+ 7, y+ 5, 2, 1, hudinfo[HUD_INPUT].f|29); + V_DrawFill(x+ 9, y+ 4, 1, 1, hudinfo[HUD_INPUT].f|29); + V_DrawFill(x+10, y+ 3, 1, 1, hudinfo[HUD_INPUT].f|29); } V_DrawFill(x+ 5, y- 2-offs, 6, 6, col); V_DrawFill(x+ 6, y+ 4-offs, 4, 1, col); @@ -1125,10 +1130,10 @@ static void ST_drawInput(void) else { offs = 1; - col = hudinfo[HUD_LIVES].f|16; - V_DrawFill(x+12, y+10, 6, 1, hudinfo[HUD_LIVES].f|29); - V_DrawFill(x+11, y+ 9, 1, 1, hudinfo[HUD_LIVES].f|29); - V_DrawFill(x+10, y+ 8, 1, 1, hudinfo[HUD_LIVES].f|29); + col = hudinfo[HUD_INPUT].f|16; + V_DrawFill(x+12, y+10, 6, 1, hudinfo[HUD_INPUT].f|29); + V_DrawFill(x+11, y+ 9, 1, 1, hudinfo[HUD_INPUT].f|29); + V_DrawFill(x+10, y+ 8, 1, 1, hudinfo[HUD_INPUT].f|29); } V_DrawFill(x+12, y+ 5-offs, 6, 6, col); V_DrawFill(x+11, y+ 6-offs, 1, 4, col); @@ -1143,8 +1148,8 @@ static void ST_drawInput(void) else { offs = 1; - col = hudinfo[HUD_LIVES].f|16; - V_DrawFill(x+ 5, y+17, 6, 1, hudinfo[HUD_LIVES].f|29); + col = hudinfo[HUD_INPUT].f|16; + V_DrawFill(x+ 5, y+17, 6, 1, hudinfo[HUD_INPUT].f|29); } V_DrawFill(x+ 5, y+12-offs, 6, 6, col); V_DrawFill(x+ 6, y+11-offs, 4, 1, col); @@ -1160,16 +1165,16 @@ static void ST_drawInput(void) else\ {\ offs = 1;\ - col = hudinfo[HUD_LIVES].f|16;\ - V_DrawFill(x+16+(xoffs), y+9+(yoffs), 10, 1, hudinfo[HUD_LIVES].f|29);\ + col = hudinfo[HUD_INPUT].f|16;\ + V_DrawFill(x+16+(xoffs), y+9+(yoffs), 10, 1, hudinfo[HUD_INPUT].f|29);\ }\ V_DrawFill(x+16+(xoffs), y+(yoffs)-offs, 10, 10, col);\ - V_DrawCharacter(x+16+1+(xoffs), y+1+(yoffs)-offs, hudinfo[HUD_LIVES].f|symb, false) + V_DrawCharacter(x+16+1+(xoffs), y+1+(yoffs)-offs, hudinfo[HUD_INPUT].f|symb, false) drawbutt( 4,-3, BT_JUMP, 'J'); drawbutt(15,-3, BT_SPIN, 'S'); - V_DrawFill(x+16+4, y+8, 21, 10, hudinfo[HUD_LIVES].f|20); // sundial backing + V_DrawFill(x+16+4, y+8, 21, 10, hudinfo[HUD_INPUT].f|20); // sundial backing if (stplyr->mo) { UINT8 i, precision; @@ -1189,7 +1194,7 @@ static void ST_drawInput(void) { V_DrawFill(x+16+14-(i*xcomp)/precision, y+12-(i*ycomp)/precision, - 1, 1, hudinfo[HUD_LIVES].f|16); + 1, 1, hudinfo[HUD_INPUT].f|16); } if (ycomp <= 0) @@ -1206,7 +1211,7 @@ static void ST_drawInput(void) if (stplyr->pflags & PF_AUTOBRAKE) { V_DrawThinString(x, y, - hudinfo[HUD_LIVES].f| + hudinfo[HUD_INPUT].f| ((!stplyr->powers[pw_carry] && (stplyr->pflags & PF_APPLYAUTOBRAKE) && !(stplyr->cmd.sidemove || stplyr->cmd.forwardmove) @@ -1219,22 +1224,22 @@ static void ST_drawInput(void) switch (P_ControlStyle(stplyr)) { case CS_LMAOGALOG: - V_DrawThinString(x, y, hudinfo[HUD_LIVES].f, "ANALOG"); + V_DrawThinString(x, y, hudinfo[HUD_INPUT].f, "ANALOG"); y -= 8; break; case CS_SIMPLE: - V_DrawThinString(x, y, hudinfo[HUD_LIVES].f, "AUTOMATIC"); + V_DrawThinString(x, y, hudinfo[HUD_INPUT].f, "AUTOMATIC"); y -= 8; break; case CS_STANDARD: - V_DrawThinString(x, y, hudinfo[HUD_LIVES].f, "MANUAL"); + V_DrawThinString(x, y, hudinfo[HUD_INPUT].f, "MANUAL"); y -= 8; break; case CS_LEGACY: - V_DrawThinString(x, y, hudinfo[HUD_LIVES].f, "STRAFE"); + V_DrawThinString(x, y, hudinfo[HUD_INPUT].f, "STRAFE"); y -= 8; break; @@ -1243,7 +1248,7 @@ static void ST_drawInput(void) } } if (!demosynced) // should always be last, so it doesn't push anything else around - V_DrawThinString(x, y, hudinfo[HUD_LIVES].f|((leveltime & 4) ? V_YELLOWMAP : V_REDMAP), "BAD DEMO!!"); + V_DrawThinString(x, y, hudinfo[HUD_INPUT].f|((leveltime & 4) ? V_YELLOWMAP : V_REDMAP), "BAD DEMO!!"); } static patch_t *lt_patches[3]; @@ -2816,14 +2821,14 @@ static void ST_overlayDrawer(void) || ((splitscreen && stplyr == &players[secondarydisplayplayer]) && !camera2.chase)) { ST_drawFirstPersonHUD(); - if (cv_powerupdisplay.value) + if (cv_powerupdisplay.value && LUA_HudEnabled(hud_powerups)) ST_drawPowerupHUD(); // same as it ever was... } - else if (cv_powerupdisplay.value == 2) + else if (cv_powerupdisplay.value == 2 && LUA_HudEnabled(hud_powerups)) ST_drawPowerupHUD(); // same as it ever was... } - else if (!(netgame || multiplayer) && cv_powerupdisplay.value == 2) + else if (!(netgame || multiplayer) && cv_powerupdisplay.value == 2 && LUA_HudEnabled(hud_powerups)) ST_drawPowerupHUD(); // same as it ever was... if (!(netgame || multiplayer) || !hu_showscores) @@ -2844,7 +2849,7 @@ static void ST_overlayDrawer(void) if (!hu_showscores && (netgame || multiplayer) && LUA_HudEnabled(hud_textspectator)) ST_drawTextHUD(); - if (modeattacking && !(demoplayback && hu_showscores)) + if ((cv_showinput.value && !players[displayplayer].spectator) || (modeattacking && !(demoplayback && hu_showscores))) ST_drawInput(); ST_drawDebugInfo(); diff --git a/src/st_stuff.h b/src/st_stuff.h index 07dfac3ec..6f6bac1fa 100644 --- a/src/st_stuff.h +++ b/src/st_stuff.h @@ -92,6 +92,7 @@ typedef struct typedef enum { HUD_LIVES, + HUD_INPUT, HUD_RINGS, HUD_RINGSNUM, diff --git a/src/v_video.c b/src/v_video.c index cb7db487e..355bdf860 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -384,13 +384,14 @@ void V_CubeApply(UINT8 *red, UINT8 *green, UINT8 *blue) const char *R_GetPalname(UINT16 num) { - static char palname[9]; - char newpal[9] = "PLAYPAL"; + static char palname[8+1]; + char newpal[9] = "PLAYPAL\0"; if (num > 0 && num <= 10000) snprintf(newpal, 8, "PAL%04u", num-1); - strncpy(palname, newpal, 8); + strncpy(palname, newpal, sizeof(palname)-1); + palname[8] = 0; return palname; } diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index f33b3bf3f..19aa22c9b 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -18,4 +18,6 @@ if(NOT "${SRB2_CONFIG_SYSTEM_LIBRARIES}") include("cpm-openmpt.cmake") endif() -include("cpm-libgme.cmake") +if("${SRB2_CONFIG_USE_GME}") + include("cpm-libgme.cmake") +endif() diff --git a/thirdparty/cpm-sdl2.cmake b/thirdparty/cpm-sdl2.cmake index 90e5bd0fe..0bb404e4c 100644 --- a/thirdparty/cpm-sdl2.cmake +++ b/thirdparty/cpm-sdl2.cmake @@ -20,9 +20,9 @@ endif() CPMAddPackage( NAME SDL2 - VERSION 2.30.0 + VERSION 2.28.5 GITHUB_REPOSITORY "libsdl-org/SDL" - GIT_TAG release-2.30.0 + GIT_TAG release-2.28.5 EXCLUDE_FROM_ALL ON OPTIONS ${internal_sdl2_options} )