Skip to content

Commit

Permalink
Fix Windows builds and regression tests for SDL3.
Browse files Browse the repository at this point in the history
  • Loading branch information
AliceLR committed Apr 16, 2024
1 parent 815d409 commit a29ffff
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/SDLmzx.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ static inline HWND SDL_GetWindowProperty_HWND(SDL_Window *window)
static inline void *SDL_GetWindowProperty_HWND(SDL_Window *window)
{
return SDL_GetProperty(SDL_GetWindowProperties(window),
SDL_PROPERTY_WINDOW_WIN32_HWND_POINTER, NULL);
SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL);
}
#endif /* _WIN32 */

Expand Down
4 changes: 4 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@

#ifdef CONFIG_SDL
#if CONFIG_SDL == 3
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
#include <SDL3/SDL_main.h>
#else
#include <SDL.h> /* SDL_main */
Expand Down
4 changes: 4 additions & 0 deletions testworlds/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,12 @@ fi
# Coupled with the software renderer, this will disable video in MZX, speeding things up
# and allowing for automated testing. Disabling the SDL audio driver will prevent annoying
# noises from occuring during tests, but shouldn't affect audio-related tests.
# SDL 1.2 and SDL2
export SDL_VIDEODRIVER=dummy
export SDL_AUDIODRIVER=dummy
# SDL3
export SDL_VIDEO_DRIVER=dummy
export SDL_AUDIO_DRIVER=dummy

# Standalone mode will allow tests.mzx to terminate MZX and no_titlescreen mode
# simplifies things. Disable auto update checking to save time. Some platforms
Expand Down
2 changes: 1 addition & 1 deletion unit/configure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "../src/io/vio.h"

#ifdef CONFIG_SDL
#include <SDL_version.h>
#include "../src/SDLmzx.h"
#endif

#ifdef CONFIG_EDITOR
Expand Down

0 comments on commit a29ffff

Please sign in to comment.