Build changes. 32 bit Linux/Windows/macOS now supported.
This commit is contained in:
parent
9535e202b9
commit
39748f28fb
15 changed files with 232 additions and 135 deletions
BIN
singe/BreatheFire-65pg.ttf
(Stored with Git LFS)
Normal file
BIN
singe/BreatheFire-65pg.ttf
(Stored with Git LFS)
Normal file
Binary file not shown.
|
@ -464,3 +464,7 @@ OVERLAY_UPDATED = 1
|
|||
|
||||
SINGLE_MOUSE = 100
|
||||
MANY_MOUSE = 200
|
||||
|
||||
-- Make old random number calls still work
|
||||
random = {}
|
||||
random.new = math.random
|
||||
|
|
|
@ -254,8 +254,7 @@ table.sort(GAME_LIST, compareTitles)
|
|||
if GAME_COUNT == 0 then
|
||||
debugPrint("No games found! Exiting.")
|
||||
singeQuit()
|
||||
end
|
||||
|
||||
else
|
||||
discPlay()
|
||||
overlaySetResolution(vldpGetWidth(), vldpGetHeight())
|
||||
|
||||
|
@ -322,3 +321,4 @@ end
|
|||
|
||||
-- Prime the pump
|
||||
loadGameAssets(true)
|
||||
end
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
# Copyright (C) 2006-2020 Scott Duensing <scott@kangaroopunch.com>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# modify it under the terms of the GNU General Public Licens
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
|
@ -25,7 +25,7 @@ if [[ -z $1 ]]; then
|
|||
# G_PLATFORM=mingw
|
||||
# G_PLATFORM=linux
|
||||
# G_PLATFORM=pi
|
||||
G_BITS=64
|
||||
G_BITS=32
|
||||
G_THIRDPARTY=$(pwd)/thirdparty
|
||||
G_DEST="$(pwd)/../thirdparty-build/${G_PLATFORM}/${G_BITS}"
|
||||
G_TYPE=static
|
||||
|
@ -39,6 +39,7 @@ else
|
|||
G_PROJECT=$6
|
||||
fi
|
||||
|
||||
G_OPTIMIZE="-O2"
|
||||
G_INSTALLED="${G_DEST}/installed"
|
||||
G_L="-------------------------------------------------------------------------------"
|
||||
|
||||
|
@ -52,7 +53,6 @@ case "${G_PLATFORM}" in
|
|||
G_CCOMPILER="${G_CROSS_HOME}/${G_CROSS}-gcc"
|
||||
G_CPPCOMPILER="${G_CROSS_HOME}/${G_CROSS}-g++"
|
||||
G_RANLIB="${G_CROSS_HOME}/${G_CROSS}-ranlib"
|
||||
G_LUAPLAT="posix"
|
||||
G_ARCH="armv6"
|
||||
G_SYSROOT="/opt/cross/pi/buster"
|
||||
;;
|
||||
|
@ -60,31 +60,46 @@ case "${G_PLATFORM}" in
|
|||
linux)
|
||||
G_OS="linux"
|
||||
G_CROSS="x86_64-linux-gnu"
|
||||
G_CCOMPILER="gcc"
|
||||
G_CPPCOMPILER="g++"
|
||||
G_RANLIB="ranlib"
|
||||
G_LUAPLAT="linux"
|
||||
if [[ "${G_BITS}" == "32" ]]; then
|
||||
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=638418
|
||||
G_CCOMPILER="${G_CROSS}-gcc -m32"
|
||||
G_CPPCOMPILER="${G_CROSS}-g++ -m32"
|
||||
G_ARCH="i386"
|
||||
else
|
||||
G_CCOMPILER="${G_CROSS}-gcc"
|
||||
G_CPPCOMPILER="${G_CROSS}-g++"
|
||||
G_ARCH="x86_64"
|
||||
fi
|
||||
G_RANLIB="${G_CROSS}-ranlib"
|
||||
;;
|
||||
|
||||
mingw)
|
||||
# Be sure to use the posix compilers:
|
||||
# sudo update-alternatives --config x86_64-w64-mingw32-g++
|
||||
# sudo update-alternatives --config i686-w64-mingw32-g++
|
||||
G_OS="mingw32"
|
||||
G_CROSS="x86_64-w64-mingw32"
|
||||
if [[ "${G_BITS}" == "32" ]]; then
|
||||
G_ARCH="i686"
|
||||
else
|
||||
G_ARCH="x86_64"
|
||||
fi
|
||||
G_CROSS="${G_ARCH}-w64-mingw32"
|
||||
G_CCOMPILER="${G_CROSS}-gcc"
|
||||
G_CPPCOMPILER="${G_CROSS}-g++"
|
||||
G_RANLIB="${G_CROSS}-ranlib"
|
||||
G_LUAPLAT="generic"
|
||||
G_ARCH="x86_64"
|
||||
;;
|
||||
|
||||
mac)
|
||||
G_OS="darwin"
|
||||
G_CROSS="x86_64-apple-darwin15"
|
||||
G_CCOMPILER="o64-clang"
|
||||
G_CPPCOMPILER="o64-clang++"
|
||||
G_RANLIB="${G_CROSS}-ranlib"
|
||||
G_LUAPLAT="generic"
|
||||
if [[ "${G_BITS}" == "32" ]]; then
|
||||
G_ARCH="i386"
|
||||
else
|
||||
G_ARCH="x86_64"
|
||||
fi
|
||||
G_CROSS="${G_ARCH}-apple-darwin15"
|
||||
G_CCOMPILER="${G_CROSS}-clang"
|
||||
G_CPPCOMPILER="${G_CROSS}-clang++"
|
||||
G_RANLIB="${G_CROSS}-ranlib"
|
||||
O_MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET}
|
||||
export MACOSX_DEPLOYMENT_TARGET=10.8
|
||||
;;
|
||||
|
@ -132,9 +147,9 @@ function autoBuild() {
|
|||
|
||||
export CC=${G_CCOMPILER}
|
||||
export CXX=${G_CPPCOMPILER}
|
||||
export CFLAGS="${MORE_CFLAGS} -isystem${G_INSTALLED}/include"
|
||||
export CFLAGS="${G_OPTIMIZE} ${MORE_CFLAGS} -isystem${G_INSTALLED}/include"
|
||||
export CXXFLAGS="${MORE_CFLAGS} ${MORE_CXXFLAGS} -isystem${G_INSTALLED}/include"
|
||||
export CPPFLAGS="${MORE_CFLAGS} -isystem${G_INSTALLED}/include"
|
||||
export CPPFLAGS="${G_OPTIMIZE} ${MORE_CFLAGS} -isystem${G_INSTALLED}/include"
|
||||
export LDFLAGS="${MORE_LIBS} -L${G_INSTALLED}/lib"
|
||||
export LD_LIBRARY_PATH="${G_INSTALLED}/lib"
|
||||
export PKG_CONFIG_LIBDIR="${G_INSTALLED}/lib/pkgconfig"
|
||||
|
@ -316,7 +331,7 @@ if [[ ! -e "${G_INSTALLED}/lib/libz.a" ]]; then
|
|||
echo ${G_L}
|
||||
mkdir -p "${G_DEST}/zlib"
|
||||
pushd "${G_DEST}/zlib"
|
||||
RANLIB="${G_RANLIB}" CC="${G_CCOMPILER}" "${G_THIRDPARTY}/zlib/configure" --static --prefix="${G_INSTALLED}"
|
||||
RANLIB="${G_RANLIB}" CC="${G_CCOMPILER}" CFLAGS="${G_OPTIMIZE}" "${G_THIRDPARTY}/zlib/configure" --static --prefix="${G_INSTALLED}"
|
||||
make
|
||||
make install
|
||||
popd
|
||||
|
@ -330,7 +345,7 @@ if [[ ! -e "${G_INSTALLED}/lib/libbz2.a" ]]; then
|
|||
mkdir -p "${G_DEST}/bzip2"
|
||||
pushd "${G_DEST}/bzip2"
|
||||
cp -fr "${G_THIRDPARTY}/bzip2/." .
|
||||
make install PREFIX="${G_INSTALLED}" CC="${G_CCOMPILER}" RANLIB="${G_RANLIB}"
|
||||
make install PREFIX="${G_INSTALLED}" CC="${G_CCOMPILER}" CFLAGS="${G_OPTIMIZE}" RANLIB="${G_RANLIB}"
|
||||
popd
|
||||
fi
|
||||
|
||||
|
@ -342,7 +357,7 @@ if [[ ! -e "${G_INSTALLED}/lib/liblua.a" ]]; then
|
|||
mkdir -p "${G_DEST}/lua"
|
||||
pushd "${G_DEST}/lua"
|
||||
cp -fr "${G_THIRDPARTY}/lua/." .
|
||||
make ${G_LUAPLAT} CC="${G_CCOMPILER}" RANLIB="${G_RANLIB}"
|
||||
make generic CC="${G_CCOMPILER}" CFLAGS="${G_OPTIMIZE}" RANLIB="${G_RANLIB}"
|
||||
make install INSTALL_TOP="${G_INSTALLED}"
|
||||
popd
|
||||
fi
|
||||
|
@ -355,14 +370,23 @@ if [[ ! -e "${G_INSTALLED}/lib/libjbig.a" ]]; then
|
|||
mkdir -p "${G_DEST}/SDL2_image/jbig"
|
||||
pushd "${G_DEST}/SDL2_image/jbig"
|
||||
cp -fr "${G_THIRDPARTY}/jbigkit/." .
|
||||
make lib CC="${G_CCOMPILER}" RANLIB="${G_RANLIB}"
|
||||
make lib CC="${G_CCOMPILER}" CFLAGS="${G_OPTIMIZE}" RANLIB="${G_RANLIB}"
|
||||
cp -f libjbig/*.a "${G_INSTALLED}/lib/."
|
||||
cp -f libjbig/*.h "${G_INSTALLED}/include/."
|
||||
popd
|
||||
fi
|
||||
|
||||
# === XZ Utils ===
|
||||
if [[ "${G_OS}" == "mingw32" ]]; then
|
||||
# -O2 breaks windres
|
||||
O_OPTIMIZE=${G_OPTIMIZE}
|
||||
G_OPTIMIZE=""
|
||||
fi
|
||||
autoBuild liblzma.a xz
|
||||
if [[ "${G_OS}" == "mingw32" ]]; then
|
||||
G_OPTIMIZE=${O_OPTIMIZE}
|
||||
O_OPTIMIZE=""
|
||||
fi
|
||||
|
||||
# === TIFF ===
|
||||
autoBuild libtiff.a SDL2_image/external/tiff-4.1.0
|
||||
|
@ -389,7 +413,11 @@ autoBuild libvorbis.a SDL2_mixer/external/libvorbis-1.3.6
|
|||
autoBuild libmodplug.a SDL2_mixer/external/libmodplug-0.8.9.0 "ac_cv_c_bigendian=no"
|
||||
|
||||
# === MPG123 ===
|
||||
if [[ "${G_ARCH}" == "i386" ]]; then
|
||||
autoBuild libmpg123.a SDL2_mixer/external/mpg123-1.25.13 "--with-cpu=x86"
|
||||
else
|
||||
autoBuild libmpg123.a SDL2_mixer/external/mpg123-1.25.13
|
||||
fi
|
||||
|
||||
# === Opus ===
|
||||
autoBuild libopus.a SDL2_mixer/external/opus-1.3.1
|
||||
|
@ -453,7 +481,7 @@ if [[ "${G_PLATFORM}" == "pi" ]]; then
|
|||
MORE_LIBS="-Wl,-rpath-link,${G_SYSROOT}/opt/vc/lib -L${G_SYSROOT}/opt/vc/lib -lbcm_host"
|
||||
fi
|
||||
if [[ "${G_PLATFORM}" == "mac" ]]; then
|
||||
MAC_SDL_LIBS="-lm -liconv -Wl,-framework,CoreAudio -Wl,-framework,AudioUnit -Wl,-framework,AudioToolbox -Wl,-framework,ForceFeedback -lobjc -Wl,-framework,CoreVideo -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,IOKit -Wl,-weak_framework,QuartzCore -Wl,-weak_framework,Metal"
|
||||
MAC_SDL_LIBS="-lSDL2 -lm -liconv -Wl,-framework,CoreAudio -Wl,-framework,AudioUnit -Wl,-framework,AudioToolbox -Wl,-framework,ForceFeedback -lobjc -Wl,-framework,CoreVideo -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,IOKit -Wl,-weak_framework,QuartzCore -Wl,-weak_framework,Metal"
|
||||
MORE_LIBS=${MAC_SDL_LIBS}
|
||||
fi
|
||||
autoBuild libSDL2_image.a SDL2_image "--disable-jpg-shared --disable-png-shared --disable-tif-shared --disable-webp-shared"
|
|
@ -37,12 +37,10 @@ function doBuild() {
|
|||
# Override this
|
||||
QMAKE_CFLAGS="-isystem ../../thirdparty-build/${OSNAME}/${OSARCH}/installed/include -isystem ../../singe/thirdparty/arg_parser -isystem ../../singe/thirdparty/manymouse"
|
||||
|
||||
pushd "${SOURCE_DIR}/.."
|
||||
mkdir -p build/${OSNAME}/${OSARCH}
|
||||
pushd "${SOURCE_DIR}/.." &> /dev/null
|
||||
mkdir -p build
|
||||
cd build
|
||||
if [[ -d temp ]]; then
|
||||
rm -rf temp
|
||||
fi
|
||||
[[ -d temp ]] && rm -rf temp
|
||||
mkdir -p temp
|
||||
cd temp
|
||||
|
||||
|
@ -59,17 +57,36 @@ function doBuild() {
|
|||
${CROSS}-${CCOMPILER} ${QMAKE_CFLAGS} ${EXTRA_CFLAGS} -c "${SOURCE}" -o ${O}
|
||||
done
|
||||
|
||||
TARGET="${SOURCE_DIR}/../build/${OSNAME}/${OSARCH}/${TARGET}${EXT}"
|
||||
TARGET="${SOURCE_DIR}/../build/${TARGET}${EXT}"
|
||||
echo "Linking ${TARGET}..."
|
||||
${CROSS}-${CPPCOMPILER} -o "${TARGET}" ${OFILES} ${EXTRA_OFILES} "-L${SOURCE_DIR}/../thirdparty-build/${OSNAME}/${OSARCH}/installed/lib" ${EXTRA_LD_FLAGS}
|
||||
# The grep nonsense hides a warning we don't care about.
|
||||
${CROSS}-${CPPCOMPILER} -o "${TARGET}" ${OFILES} ${EXTRA_OFILES} "-L${SOURCE_DIR}/../thirdparty-build/${OSNAME}/${OSARCH}/installed/lib" ${EXTRA_LD_FLAGS} 2>&1 | grep -v loslib || true
|
||||
|
||||
echo "Compressing ${TARGET}..."
|
||||
${CROSS}-strip "${TARGET}"
|
||||
upx -9 "${TARGET}"
|
||||
|
||||
popd
|
||||
cd ..
|
||||
rm -rf temp
|
||||
|
||||
popd &> /dev/null
|
||||
}
|
||||
|
||||
|
||||
# Find Singe version
|
||||
G_VERSION=$(grep VERSION_STRING singe.h | cut -d '"' -f 2)
|
||||
|
||||
|
||||
# 32 Bit Linux
|
||||
echo -e "${G_L}\nLinux i386\n${G_L}"
|
||||
CROSS="x86_64-linux-gnu"
|
||||
CCOMPILER="gcc"
|
||||
CPPCOMPILER="g++"
|
||||
EXTRA_CFLAGS="-m32 -O2"
|
||||
EXTRA_OFILES=""
|
||||
EXTRA_LD_FLAGS="-m32 -l:everything.a -lpthread -lXv -lX11 -lXext -lm -ldl -lrt"
|
||||
doBuild Singe-${G_VERSION}-Linux-i386 linux 32
|
||||
|
||||
# 64 Bit Linux
|
||||
echo -e "${G_L}\nLinux x86_64\n${G_L}"
|
||||
CROSS="x86_64-linux-gnu"
|
||||
|
@ -78,7 +95,23 @@ CPPCOMPILER="g++"
|
|||
EXTRA_CFLAGS="-O2"
|
||||
EXTRA_OFILES=""
|
||||
EXTRA_LD_FLAGS="-l:everything.a -lpthread -lXv -lX11 -lXext -lm -ldl -lrt"
|
||||
doBuild Singe-Linux-x86_64 linux 64
|
||||
doBuild Singe-${G_VERSION}-Linux-x86_64 linux 64
|
||||
|
||||
# 32 Bit Windows
|
||||
echo -e "${G_L}\nWindows i686\n${G_L}"
|
||||
CROSS="i686-w64-mingw32"
|
||||
CCOMPILER="gcc"
|
||||
CPPCOMPILER="g++"
|
||||
EXTRA_CFLAGS="-O2"
|
||||
EXTRA_OFILES="/tmp/singe.res"
|
||||
EXTRA_LD_FLAGS="-mwindows -static -lmingw32 -l:everything.a -lm -lbcrypt -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lsetupapi -lversion -luuid -Dmain=SDL_main"
|
||||
xcf2png icon.xcf -o /tmp/icon.png
|
||||
icotool -c -o /tmp/icon.ico /tmp/icon.png
|
||||
${CROSS}-windres singe.rc -O coff -o /tmp/singe.res
|
||||
doBuild Singe-${G_VERSION}-Windows-i686 mingw 32 .exe
|
||||
rm /tmp/icon.ico
|
||||
rm /tmp/icon.png
|
||||
rm /tmp/singe.res
|
||||
|
||||
# 64 Bit Windows
|
||||
echo -e "${G_L}\nWindows x86_64\n${G_L}"
|
||||
|
@ -90,8 +123,8 @@ EXTRA_OFILES="/tmp/singe.res"
|
|||
EXTRA_LD_FLAGS="-mwindows -static -lmingw32 -l:everything.a -lm -lbcrypt -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lsetupapi -lversion -luuid -Dmain=SDL_main"
|
||||
xcf2png icon.xcf -o /tmp/icon.png
|
||||
icotool -c -o /tmp/icon.ico /tmp/icon.png
|
||||
x86_64-w64-mingw32-windres singe.rc -O coff -o /tmp/singe.res
|
||||
doBuild Singe-Windows-x86_64 mingw 64 .exe
|
||||
${CROSS}-windres singe.rc -O coff -o /tmp/singe.res
|
||||
doBuild Singe-${G_VERSION}-Windows-x86_64 mingw 64 .exe
|
||||
rm /tmp/icon.ico
|
||||
rm /tmp/icon.png
|
||||
rm /tmp/singe.res
|
||||
|
@ -105,7 +138,19 @@ CPPCOMPILER="g++"
|
|||
EXTRA_CFLAGS="-O2 --sysroot ${SYSROOT}"
|
||||
EXTRA_OFILES=""
|
||||
EXTRA_LD_FLAGS="--sysroot ${SYSROOT} -l:everything.a -Wl,-rpath-link,${SYSROOT}/opt/vc/lib -L${SYSROOT}/opt/vc/lib -lbcm_host -lasound -lpthread -lm -ldl -lsndio -lmmal_core -lmmal_util -lmmal_vc_client -lvdpau -ldrm -lgbm -lX11 -lsamplerate"
|
||||
doBuild Singe-Pi-armv6 pi 32
|
||||
doBuild Singe-${G_VERSION}-Pi-armv6 pi 32
|
||||
|
||||
# 32 Bit macOS
|
||||
echo -e "${G_L}\nmacOS i386\n${G_L}"
|
||||
CROSS="i386-apple-darwin15"
|
||||
CCOMPILER="clang"
|
||||
CPPCOMPILER="clang++"
|
||||
EXTRA_CFLAGS="-O2"
|
||||
EXTRA_LD_FLAGS="-Wl,-no_pie -stdlib=libc++ -leverything -lm -liconv -Wl,-framework,CoreAudio -Wl,-framework,AudioUnit -Wl,-framework,AudioToolbox -Wl,-framework,ForceFeedback -lobjc -Wl,-framework,CoreVideo -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,IOKit -Wl,-weak_framework,QuartzCore -Wl,-weak_framework,Metal"
|
||||
O_MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET}
|
||||
export MACOSX_DEPLOYMENT_TARGET=10.8
|
||||
doBuild Singe-${G_VERSION}-macOS-i386 mac 32
|
||||
export MACOSX_DEPLOYMENT_TARGET=${O_MACOSX_DEPLOYMENT_TARGET}
|
||||
|
||||
# 64 Bit macOS
|
||||
echo -e "${G_L}\nmacOS x86_64\n${G_L}"
|
||||
|
@ -116,5 +161,5 @@ EXTRA_CFLAGS="-O2"
|
|||
EXTRA_LD_FLAGS="-stdlib=libc++ -leverything -lm -liconv -Wl,-framework,CoreAudio -Wl,-framework,AudioUnit -Wl,-framework,AudioToolbox -Wl,-framework,ForceFeedback -lobjc -Wl,-framework,CoreVideo -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,IOKit -Wl,-weak_framework,QuartzCore -Wl,-weak_framework,Metal"
|
||||
O_MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET}
|
||||
export MACOSX_DEPLOYMENT_TARGET=10.8
|
||||
doBuild Singe-macOS-x86_64 mac 64
|
||||
doBuild Singe-${G_VERSION}-macOS-x86_64 mac 64
|
||||
export MACOSX_DEPLOYMENT_TARGET=${O_MACOSX_DEPLOYMENT_TARGET}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/bash -x
|
||||
#!/bin/bash -xe
|
||||
|
||||
#
|
||||
# Singe 2
|
||||
|
@ -19,9 +19,23 @@
|
|||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
|
||||
SOURCEDIR=$1
|
||||
DESTDIR=$2
|
||||
TARGET=$3
|
||||
|
||||
strip "${DESTDIR}/${TARGET}"
|
||||
upx -9 "${DESTDIR}/${TARGET}"
|
||||
function buildDependencies() {
|
||||
local BITS=$1
|
||||
local PLATFORM=$2
|
||||
./buildPrerequisites.sh "$(pwd)/thirdparty" "$(pwd)/../thirdparty-build" ${BITS} ${PLATFORM} static "$(pwd)"
|
||||
}
|
||||
|
||||
|
||||
buildDependencies 32 linux
|
||||
buildDependencies 64 linux
|
||||
|
||||
buildDependencies 32 pi
|
||||
|
||||
buildDependencies 32 mingw
|
||||
buildDependencies 64 mingw
|
||||
|
||||
buildDependencies 32 mac
|
||||
buildDependencies 64 mac
|
||||
|
||||
./buildRelease.sh
|
12
singe/main.c
12
singe/main.c
|
@ -605,10 +605,6 @@ void launcher(char *exeName, ConfigT *conf) {
|
|||
Mix_Quit();
|
||||
SDL_Quit();
|
||||
utilTraceEnd();
|
||||
|
||||
#ifdef _WIN32
|
||||
if (!conf->noConsole) getchar();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -724,7 +720,7 @@ void showUsage(char *name, char *message) {
|
|||
} else {
|
||||
// Winders
|
||||
temp = utilCreateString("Menu.bat");
|
||||
data = utilCreateString("@echo off\n\r\n\r%s -k -x 720 -y 480 -d data -v Singe\\menuBackground.mkv Singe\\Menu.singe\n\r", utilGetLastPathComponent(name));
|
||||
data = utilCreateString("@start %s -k -x 720 -y 480 -d data -v Singe\\menuBackground.mkv Singe\\Menu.singe\n", utilGetLastPathComponent(name));
|
||||
}
|
||||
created |= extractFile(temp, (unsigned char *)data, strlen(data));
|
||||
utilChMod(temp, 0777);
|
||||
|
@ -742,7 +738,7 @@ void showUsage(char *name, char *message) {
|
|||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
getchar();
|
||||
if (utilGetConsoleEnabled()) getchar();
|
||||
#endif
|
||||
exit(result);
|
||||
}
|
||||
|
@ -766,5 +762,9 @@ int main(int argc, char *argv[]) {
|
|||
destroyConf(&conf);
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
if (utilGetConsoleEnabled()) getchar();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ static_FALSE {
|
|||
BUILDTHIRDARGS = \"$$PWD/thirdparty\" \"$$OUT_PWD/../thirdparty-build\" $$BITNESS $$PLATFORM $$LIBTYPE \"$$PWD\"
|
||||
|
||||
platformLinux {
|
||||
BUILDTHIRD.commands = bash $$PWD/preBuild.sh $$BUILDTHIRDARGS
|
||||
BUILDTHIRD.commands = bash $$PWD/buildPrerequisites.sh $$BUILDTHIRDARGS
|
||||
BUILDTHIRD.target = this
|
||||
PRE_TARGETDEPS += this
|
||||
QMAKE_EXTRA_TARGETS += BUILDTHIRD
|
||||
|
@ -252,9 +252,9 @@ dynamic {
|
|||
}
|
||||
|
||||
OTHER_FILES += \
|
||||
preBuild.sh \
|
||||
postLink.sh \
|
||||
buildRelease.sh \
|
||||
buildTheWorld.sh \
|
||||
buildPrerequisites.sh \
|
||||
singe.rc \
|
||||
controls.cfg \
|
||||
Framework.singe \
|
||||
|
@ -262,10 +262,7 @@ OTHER_FILES += \
|
|||
Menu.singe
|
||||
|
||||
platformLinux {
|
||||
#QMAKE_POST_LINK += bash $$PWD/postLink.sh "$$PWD" "$$DESTDIR" "$$TARGET"
|
||||
|
||||
# === Generate some data for our buildRelease script ===
|
||||
|
||||
FILEINFO = "SOURCES=\"$$SOURCES\"" \
|
||||
"HEADERS=\"$$HEADERS\"" \
|
||||
"LINUX_LIBS=\"$$LIBS\"" \
|
||||
|
|
|
@ -667,8 +667,8 @@ distclean-generic:
|
|||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
@FLaC__HAS_DOXYGEN_FALSE@distclean-local:
|
||||
@FLaC__HAS_DOXYGEN_FALSE@install-data-local:
|
||||
@FLaC__HAS_DOXYGEN_FALSE@distclean-local:
|
||||
@FLaC__HAS_DOXYGEN_FALSE@uninstall-local:
|
||||
clean: clean-recursive
|
||||
|
||||
|
|
|
@ -394,9 +394,9 @@ distclean-generic:
|
|||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
@HAVE_DOXYGEN_FALSE@install-data-local:
|
||||
@HAVE_DOXYGEN_FALSE@clean-local:
|
||||
@HAVE_DOXYGEN_FALSE@uninstall-local:
|
||||
@HAVE_DOXYGEN_FALSE@clean-local:
|
||||
@HAVE_DOXYGEN_FALSE@install-data-local:
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool clean-local mostlyclean-am
|
||||
|
|
|
@ -1018,9 +1018,9 @@ distclean-generic:
|
|||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
@HAVE_DOXYGEN_FALSE@clean-local:
|
||||
@HAVE_DOXYGEN_FALSE@install-data-local:
|
||||
@HAVE_DOXYGEN_FALSE@uninstall-local:
|
||||
@HAVE_DOXYGEN_FALSE@clean-local:
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool clean-local \
|
||||
|
|
18
singe/thirdparty/manymouse/macosx_hidutilities.c
vendored
18
singe/thirdparty/manymouse/macosx_hidutilities.c
vendored
|
@ -158,7 +158,7 @@ typedef recDevice* pRecDevice;
|
|||
static IONotificationPortRef gNotifyPort;
|
||||
static io_iterator_t gAddedIter;
|
||||
static CFRunLoopRef gRunLoop;
|
||||
#endif USE_NOTIFICATIONS
|
||||
#endif //USE_NOTIFICATIONS
|
||||
|
||||
// for element retrieval
|
||||
static pRecDevice gCurrentGetDevice = NULL;
|
||||
|
@ -386,7 +386,7 @@ static void hid_AddElement (CFTypeRef refElement, pRecElement * ppElementCurrent
|
|||
#if 0
|
||||
else
|
||||
HIDReportError ("CFNumberGetValue error when getting value for refUsage or refUsagePage.");
|
||||
#endif 0
|
||||
#endif // 0
|
||||
}
|
||||
else // collection
|
||||
pElement = (pRecElement) malloc (sizeof (recElement));
|
||||
|
@ -741,7 +741,7 @@ static pRecDevice hid_DisposeDevice (pRecDevice pDevice)
|
|||
#if 0
|
||||
if (kIOReturnSuccess != result)
|
||||
HIDReportErrorNum ("hid_DisposeDevice: HIDDequeueDevice error: 0x%8.8X.", result);
|
||||
#endif 1
|
||||
#endif //1
|
||||
|
||||
hid_DisposeDeviceElements (pDevice->pListElements);
|
||||
pDevice->pListElements = NULL;
|
||||
|
@ -765,7 +765,7 @@ static pRecDevice hid_DisposeDevice (pRecDevice pDevice)
|
|||
if (kIOReturnSuccess != result)
|
||||
HIDReportErrorNum ("hid_DisposeDevice: IOObjectRelease error: 0x%8.8X.", result);
|
||||
}
|
||||
#endif USE_NOTIFICATIONS
|
||||
#endif //USE_NOTIFICATIONS
|
||||
|
||||
// remove this device from the device list
|
||||
if (gpDeviceList == pDevice) // head of list?
|
||||
|
@ -868,7 +868,7 @@ static unsigned long HIDDequeueDevice (pRecDevice pDevice)
|
|||
CFRelease(pDevice->queueRunLoopSource);
|
||||
pDevice->queueRunLoopSource = NULL;
|
||||
}
|
||||
#endif USE_ASYNC_EVENTS
|
||||
#endif //USE_ASYNC_EVENTS
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -949,7 +949,7 @@ static unsigned long HIDCreateOpenDeviceInterface (UInt32 hidDevice, pRecDevice
|
|||
plugInResult = (*ppPlugInInterface)->QueryInterface (ppPlugInInterface,
|
||||
CFUUIDGetUUIDBytes (kIOHIDDeviceInterfaceID), (void *) &(pDevice->interface));
|
||||
if (S_OK != plugInResult)
|
||||
HIDReportErrorNum ("CouldnÕt query HID class device interface from plugInInterface", plugInResult);
|
||||
HIDReportErrorNum ("Couldn't query HID class device interface from plugInInterface", plugInResult);
|
||||
IODestroyPlugInInterface (ppPlugInInterface); // replace (*ppPlugInInterface)->Release (ppPlugInInterface)
|
||||
}
|
||||
else
|
||||
|
@ -1072,7 +1072,7 @@ static void hid_RemovalCallbackFunction(void * target, IOReturn result, void * r
|
|||
pDevice->disconnect = DISCONNECT_TELLUSER;
|
||||
}
|
||||
|
||||
#endif USE_NOTIFICATIONS
|
||||
#endif //USE_NOTIFICATIONS
|
||||
|
||||
|
||||
|
||||
|
@ -1143,7 +1143,7 @@ static void hid_AddDevices (void *refCon, io_iterator_t iterator)
|
|||
HIDReportErrorNum ("hid_AddDevices: IOServiceAddInterestNotification error: x0%8.8lX.", result);
|
||||
#else
|
||||
result = (*(IOHIDDeviceInterface**)pNewDevice->interface)->setRemovalCallback (pNewDevice->interface, hid_RemovalCallbackFunction,pNewDeviceAt,0);
|
||||
#endif USE_NOTIFICATIONS
|
||||
#endif //USE_NOTIFICATIONS
|
||||
|
||||
// release the device object, it is no longer needed
|
||||
result = IOObjectRelease (ioHIDDeviceObject);
|
||||
|
@ -1243,7 +1243,7 @@ static Boolean HIDBuildDeviceList (UInt32 usagePage, UInt32 usage)
|
|||
return true;
|
||||
}
|
||||
}
|
||||
#endif USE_NOTIFICATIONS
|
||||
#endif //USE_NOTIFICATIONS
|
||||
// IOServiceGetMatchingServices consumes a reference to the dictionary, so we don't need to release the dictionary ref.
|
||||
hidMatchDictionary = NULL;
|
||||
}
|
||||
|
|
|
@ -155,6 +155,11 @@ void utilFixPathSeparators(char **path, bool slash) {
|
|||
}
|
||||
|
||||
|
||||
bool utilGetConsoleEnabled(void) {
|
||||
return _consoleEnabled;
|
||||
}
|
||||
|
||||
|
||||
char *utilGetFileExtension(char *filename) {
|
||||
char *start = filename + strlen(filename);
|
||||
int32_t x;
|
||||
|
|
|
@ -42,6 +42,7 @@ void utilDie(char *fmt, ...);
|
|||
void utilEnableConsole(bool enable);
|
||||
bool utilFileExists(char *filename);
|
||||
void utilFixPathSeparators(char **path, bool slash);
|
||||
bool utilGetConsoleEnabled(void);
|
||||
char *utilGetFileExtension(char *filename);
|
||||
char *utilGetLastPathComponent(char *pathname);
|
||||
char utilGetPathSeparator(void);
|
||||
|
|
|
@ -630,7 +630,7 @@ int32_t videoUpdate(int32_t playerHandle, SDL_Texture **texture) {
|
|||
}
|
||||
|
||||
// Used to determine if we should play two frames rapidly to catch up to audio
|
||||
v->audioDelta = labs(v->audioPosition - (int64_t)((double)v->timestamp * 0.001 * (double)v->audioProps->SampleRate));
|
||||
v->audioDelta = labs((long)(v->audioPosition - (int64_t)((double)v->timestamp * 0.001 * (double)v->audioProps->SampleRate)));
|
||||
|
||||
// Did we trip the audio sync compensation?
|
||||
if (v->audioDelta > threshold) {
|
||||
|
|
Loading…
Add table
Reference in a new issue