Skip to content
This repository was archived by the owner on Apr 8, 2026. It is now read-only.

Commit f24958f

Browse files
committed
up test sdl
1 parent 28a5f6c commit f24958f

3 files changed

Lines changed: 45 additions & 27 deletions

File tree

build/build-macos.sh

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
version=""
44
main_version=""
5+
replace_sdl="false"
56

67
for line in `cat ./build/version`
78
do
@@ -13,6 +14,17 @@ do
1314
main_version=$line
1415
done
1516

17+
build_sdl_arm64()
18+
{
19+
git clone https://github.com/libsdl-org/SDL.git
20+
cd SDL
21+
mkdir build
22+
cd build
23+
../configure
24+
make -j8
25+
cd ../../
26+
}
27+
1628
build_osx()
1729
{
1830
zip_name="colormc-macos-$main_version$version-$2.zip"
@@ -48,7 +60,17 @@ build_osx()
4860

4961
chmod a+x $dir/ColorMC.Launcher
5062

63+
if [$1 = 'aarch64'] && [replace_sdl = 'true'] ;then
64+
build_sdl_arm64
65+
fi
66+
5167
cd ./src/build_out/$1-dotnet
68+
69+
if [$1 = 'aarch64'] && [replace_sdl = 'true'] ;then
70+
rm libSDL2-2.0.dylib
71+
cp ../../../SDL/build/build/.libs/libSDL2-2.0.0.dylib libSDL2-2.0.dylib
72+
fi
73+
5274
codesign --force --deep --sign - ColorMC.app
5375
zip -r $zip_name ./ColorMC.app
5476
mv $zip_name ../../../build_out/$zip_name
@@ -92,29 +114,25 @@ build_osx_min()
92114

93115
chmod a+x $dir/ColorMC.Launcher
94116

117+
if [$1 = 'aarch64'] && [replace_sdl = 'true'] ;then
118+
build_sdl_arm64
119+
fi
120+
95121
cd ./src/build_out/$1-min
122+
123+
if [$1 = 'aarch64'] && [replace_sdl = 'true'] ;then
124+
rm libSDL2-2.0.dylib
125+
cp ../../../SDL/build/build/.libs/libSDL2-2.0.0.dylib libSDL2-2.0.dylib
126+
fi
127+
96128
zip -r $zip_name ./ColorMC.app
97129
mv $zip_name ../../../build_out/$zip_name
98130
cd ../../../
99131

100132
echo "$zip_name build done"
101133
}
102134

103-
build_sdl_arm64()
104-
{
105-
git clone https://github.com/libsdl-org/SDL.git
106-
cd SDL
107-
mkdir build
108-
cd build
109-
../configure
110-
make
111-
112-
113-
}
114-
115135
build_osx osx-x64 x86_64
116136
build_osx osx-arm64 aarch64
117137
build_osx_min osx-x64 x86_64
118-
build_osx_min osx-arm64 aarch64
119-
120-
build_sdl_arm64
138+
build_osx_min osx-arm64 aarch64

src/ColorMC.Gui/App.axaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public override void OnFrameworkInitializationCompleted()
103103
ImageManager.Init(ColorMCGui.RunDir);
104104
WindowManager.Init(ColorMCGui.RunDir);
105105
GameCount.Init(ColorMCGui.RunDir);
106-
if (SystemInfo.Os != OsType.MacOS)
106+
//if (SystemInfo.Os != OsType.MacOS)
107107
{
108108
SdlUtils.Init();
109109
}

src/ColorMC.Gui/MusicPlayer/Media.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -102,21 +102,21 @@ public static void Init()
102102
{
103103
try
104104
{
105-
if (SystemInfo.Os != OsType.MacOS)
106-
{
105+
// if (SystemInfo.Os != OsType.MacOS)
106+
// {
107107
if (SdlUtils.SdlInit)
108108
{
109109
s_player = new SdlPlayer(SdlUtils.Sdl);
110110
}
111-
else
112-
{
113-
s_player = new OpenALPlayer();
114-
}
115-
}
116-
else
117-
{
118-
s_player = new OpenALPlayer();
119-
}
111+
// else
112+
// {
113+
// s_player = new OpenALPlayer();
114+
// }
115+
// }
116+
// else
117+
// {
118+
// s_player = new OpenALPlayer();
119+
// }
120120
}
121121
catch
122122
{

0 commit comments

Comments
 (0)