Skip to content

Commit 09a70fa

Browse files
committed
Rename remaining old SDL2 functions
1 parent 14c6c84 commit 09a70fa

5 files changed

Lines changed: 30 additions & 6 deletions

File tree

.github/workflows/linux-build.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,32 @@ jobs:
1010
steps:
1111
- uses: actions/checkout@v4
1212
- name: Install build tools
13-
run: sudo apt-get update && sudo apt-get install -y cmake ninja-build build-essential
13+
run: >-
14+
sudo apt-get update --allow-releaseinfo-change &&
15+
sudo apt-get install -y
16+
cmake ninja-build build-essential git pkg-config
17+
libasound2-dev libpulse-dev libudev-dev libx11-dev libxext-dev
18+
libxrandr-dev libxcursor-dev libxi-dev libxss-dev libxtst-dev
19+
libwayland-dev libxkbcommon-dev libdrm-dev libgbm-dev
20+
libegl1-mesa-dev libgl1-mesa-dev
21+
libflac-dev libogg-dev libvorbis-dev libmpg123-dev libopusfile-dev
22+
libxmp-dev
23+
- name: Build SDL3
24+
run: |
25+
mkdir -p /tmp/sdl3
26+
cd /tmp/sdl3
27+
git clone --depth 1 --branch release-3.4.0 https://github.com/libsdl-org/SDL.git
28+
cmake -S SDL -B SDL/build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local
29+
cmake --build SDL/build
30+
sudo cmake --install SDL/build
31+
- name: Build SDL3_mixer
32+
run: |
33+
mkdir -p /tmp/sdl3
34+
cd /tmp/sdl3
35+
git clone --depth 1 https://github.com/libsdl-org/SDL_mixer.git
36+
cmake -S SDL_mixer -B SDL_mixer/build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DSDLMIXER_VENDORED=OFF -DSDLMIXER_MOD_XMP=ON -DSDLMIXER_MOD_XMP_LITE=OFF -DSDLMIXER_MOD_XMP_SHARED=OFF
37+
cmake --build SDL_mixer/build
38+
sudo cmake --install SDL_mixer/build
1439
- name: Configure
1540
run: cmake -S . -B build -G Ninja
1641
- name: Build

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ target_include_directories(openfodder PRIVATE
125125
${CMAKE_CURRENT_BINARY_DIR}/Source)
126126

127127
target_compile_definitions(openfodder PRIVATE
128-
SDL_ENABLE_OLD_NAMES
129128
UNICODE
130129
_UNICODE
131130
_USE_MATH_DEFINES)

Source/Amiga/Sound_Amiga.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class cSound_Amiga : public cSound {
4444

4545
SDL_AudioSpec mAudioSpec;
4646
SDL_AudioStream* mAudioStream;
47-
SDL_mutex* mLock;
47+
SDL_Mutex* mLock;
4848

4949
std::vector<Audio::AudioStream*> mCurrentSfx;
5050

Source/Surface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ cSurface::~cSurface() {
7676

7777
void cSurface::clearSDLSurface( uint32 pColor ) {
7878

79-
SDL_FillRect( mSDLSurface, 0, pColor );
79+
SDL_FillSurfaceRect(mSDLSurface, nullptr, pColor);
8080
}
8181

8282
void cSurface::palette_SetToBlack() {

Source/Window.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,8 @@ bool cWindow::isResized() const {
446446
* Is either mouse button currently pressed
447447
*/
448448
bool cWindow::isMouseButtonPressed_Global() const {
449-
return (SDL_GetMouseState(NULL, NULL) & SDL_BUTTON(SDL_BUTTON_LEFT)) ||
450-
(SDL_GetMouseState(NULL, NULL) & SDL_BUTTON(SDL_BUTTON_RIGHT));
449+
return (SDL_GetMouseState(NULL, NULL) & SDL_BUTTON_MASK(SDL_BUTTON_LEFT)) ||
450+
(SDL_GetMouseState(NULL, NULL) & SDL_BUTTON_MASK(SDL_BUTTON_RIGHT));
451451
}
452452

453453
/**

0 commit comments

Comments
 (0)