Add rpi to buildbot script, fix crashing when rpi system only supports 32 but not 24 bit depth

This commit is contained in:
UnknownShadow200 2020-01-22 23:43:35 +11:00
parent b923754c86
commit 0790ac405b
2 changed files with 16 additions and 3 deletions

View file

@ -32,6 +32,10 @@ WIN32_FLAGS="-mwindows -nostartfiles -Wl,-e_main_real -DCC_NOMAIN"
WIN64_FLAGS="-mwindows -nostartfiles -Wl,-emain_real -DCC_NOMAIN"
LINUX_FLAGS="-fvisibility=hidden -rdynamic -DCC_BUILD_X11ICON"
# I cloned https://github.com/raspberrypi/tools to get prebuilt cross compilers
# Then I copied across various files/folders from /usr/include and /usr/lib as needed
RPI_PATH=~/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc-4.8.3
# -----------------------------
build_win32() {
echo "Building win32.."
@ -77,7 +81,7 @@ build_osx64() {
$CLANG64_PATH *.c $ALL_FLAGS -fvisibility=hidden -rdynamic -DCC_COMMIT_SHA=\"$LATEST\" -o cc-osx64 -framework Cocoa -framework OpenAL -framework OpenGL -lcurl -lobjc
}
build_web() {
build_web() {
echo "Building web.."
rm cc.js
$EMSCRIPTEN_PATH *.c -O1 -o cc.js -s FETCH=1 -s WASM=0 -s LEGACY_VM_SUPPORT=1 -s ALLOW_MEMORY_GROWTH=1 --preload-file texpacks/default.zip -w
@ -90,6 +94,12 @@ build_web() {
sed -i 's#eventHandler.useCapture);#{ useCapture: eventHandler.useCapture, passive: false });#g' cc.js
}
build_rpi() {
echo "Building rpi.."
rm cc-rpi
$RPI_PATH *.c $ALL_FLAGS -fvisibility=hidden -rdynamic -DCC_COMMIT_SHA=\"$LATEST\" -o cc-rpi -DCC_BUILD_RPI -I ~/rpi/include -L ~/rpi/lib *.c -lGLESv2 -lEGL -lX11 -lcurl -lopenal -lm -lpthread -ldl -lrt -Wl,-rpath-link ~/rpi/lib
}
# -----------------------------
cd $SOURCE_DIR/src/
echo $PWD
@ -104,4 +114,5 @@ build_nix32
build_nix64
build_osx32
build_osx64
build_web
build_web
build_rpi

View file

@ -3700,7 +3700,9 @@ static XVisualInfo GLContext_SelectVisual(struct GraphicsMode* mode) {
XVisualInfo info;
cc_result res;
res = XMatchVisualInfo(win_display, win_screen, 24, TrueColor, &info);
res = XMatchVisualInfo(win_display, win_screen, 24, TrueColor, &info) ||
XMatchVisualInfo(win_display, win_screen, 32, TrueColor, &info);
if (!res) Logger_Abort("Selecting visual");
return info;
}