Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 29 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,43 @@ jobs:
run: |
$VNAME=$(cat VERSION | sed "s/+dev$/+dev-$(git rev-parse --short HEAD)/")
echo "versionName=$VNAME" >> $env:GITHUB_ENV
- name: Cache deps
id: cache-deps
uses: actions/cache@v5
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
key: lazarus-4.2-nsis-3.05
path: |
c:\lazarus
c:\Program Files (x86)\NSIS
- if: ${{ steps.cache-deps.outputs.cache-hit != 'true' }}
Comment thread
dgruss marked this conversation as resolved.
name: Install Dependencies
msystem: MSYS
update: false
install: >-
autoconf-wrapper
automake-wrapper
git
make
pkgconf
mingw-w64-x86_64-gcc
mingw-w64-x86_64-tools
- name: Install Dependencies
run: |
choco install wget --no-progress
wget https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2032%20bits/Lazarus%204.2/lazarus-4.2-fpc-3.2.2-win32.exe/download -O lazarus-installer.exe --timeout 60 --progress=dot:giga
Start-Process -FilePath "./lazarus-installer.exe" -ArgumentList "/verysilent" -Wait
wget "https://sourceforge.net/projects/nsis/files/NSIS%203/3.05/nsis-3.05-setup.exe/download" -O nsis-3.05-setup.exe --timeout 60
curl.exe -L --max-time 60 -o fpc-installer.exe "https://sourceforge.net/projects/freepascal/files/Win32/3.2.2/fpc-3.2.2.win32.and.win64.exe/download"
curl.exe -L --max-time 60 -o nsis-3.05-setup.exe "https://sourceforge.net/projects/nsis/files/NSIS%203/3.05/nsis-3.05-setup.exe/download"
Start-Process -FilePath ".\\fpc-installer.exe" -ArgumentList "/TYPE=full /VERYSILENT /SP- /SUPPRESSMSGBOXES /NORESTART" -Wait
./nsis-3.05-setup.exe /S
- name: Build
run: |
c:\lazarus\lazbuild src\ultrastardx-win.lpi --lazarusdir=c:\lazarus
- name: Add prebuilt DLLs
- name: Download prebuilt DLLs
run: |
python dldlls.py
7z x -y usdx-dlls-i686.zip -ogame "*.dll"
7z x -y usdx-dlls-x86_64.zip -ogame "*.dll"
env:
ARTIFACT_ACCESS_TOKEN: ${{ secrets.MxeActionsReadAccessToken }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build
shell: msys2 {0}
run: |
export PATH="/usr/bin:/mingw64/bin:/c/FPC/3.2.2/bin:/c/FPC/3.2.2/bin/i386-win32:$PATH"
export MAKE="/usr/bin/make"
export FPCCFG="/c/FPC/3.2.2/bin/i386-win32/fpc.cfg"
export FPCDIR="/c/FPC/3.2.2"
export FPCMAKE="/c/FPC/3.2.2/bin/i386-win32/fpcmake"
./autogen.sh
./configure
make
- name: Create installer
run: |
del game\*.debug
Expand Down
10 changes: 5 additions & 5 deletions COMPILING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Prebuilt DLLs for SDL2, SDL2_image, FFmpeg, SQLite, PortAudio, and Lua can be fo
1. Start Lazarus.
2. Choose Project → Open Project … in the menu bar. A file-dialog box will show.
3. Change to the src subdirectory of your USDX working copy (e.g. ultrastardx/src).
* If you are running Windows, open the ultrastardx-win.lpi project-file (Preferably use the win32 verison of lazarus, as the included libraries are 32 bit).
* If you are running Windows, open the ultrastardx-win.lpi project-file (use the win64 version of Lazarus, as the included libraries are 64 bit).
* On Unix-like systems use the ultrastardx-unix.lpi file.
4. Now you can compile USDX by choosing the menu entry Run → Build or pressing Ctrl+F9.
5. If you want to compile and/or start USDX directly choose Run → Run or press F9.
Expand All @@ -43,11 +43,11 @@ Optional libraries:

#### Windows using MSYS2
- Install [MSYS2](https://www.msys2.org)
- Install [FPC](https://www.freepascal.org). You need at least a custom installation with the Free Pascal Utils (for `fpcres`) and the Units.
- `pacman -S autoconf-wrapper automake-wrapper gcc git make mingw-w64-x86_64-SDL2 mingw-w64-x86_64-SDL2_gfx mingw-w64-x86_64-SDL2_image mingw-w64-x86_64-SDL2_mixer mingw-w64-x86_64-SDL2_net mingw-w64-x86_64-SDL2_ttf mingw-w64-x86_64-ffmpeg mingw-w64-x86_64-lua51 pkgconf`
- Install [FPC](https://www.freepascal.org). Use the Win32 cross-to-Win64 installer so you get the Win64 RTL units.
- `pacman -S autoconf-wrapper automake-wrapper git make mingw-w64-x86_64-gcc mingw-w64-x86_64-tools`
- Add some information to `.bash_profile`:
* Path to FPC, something like `PATH="${PATH}:/c/FPC/3.2.2/bin/i386-win32"`
* Path to mingw64 libraries, `PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:/mingw64/lib/pkgconfig"`
* Path to the cross compiler: `PATH="${PATH}:/c/FPC/3.2.2/bin/i386-win32"`
* FPC config and base: `FPCCFG="/c/FPC/3.2.2/bin/i386-win32/fpc.cfg"` and `FPCDIR="/c/FPC/3.2.2"`

### Compile and run
- `git clone https://github.com/UltraStar-Deluxe/USDX`
Expand Down
6 changes: 6 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ USE_PROJECTM_CWRAPPER = @USE_PROJECTM_CWRAPPER@

OPENCV_CWRAPPER_DIR := $(USDX_LIB_DIR)/openCV3
USE_OPENCV_CWRAPPER = @USE_OPENCV_CWRAPPER@
USE_OPENCV_CWRAPPER_DLL ?= no
ifeq ($(EXEEXT),.exe)
USE_OPENCV_CWRAPPER_DLL := yes
endif

#################################################
# Dependencies
Expand All @@ -93,8 +97,10 @@ DEPS += $(PROJECTM_CWRAPPER_DIR)
endif

ifeq ($(USE_OPENCV_CWRAPPER), yes)
ifneq ($(USE_OPENCV_CWRAPPER_DLL), yes)
DEPS += $(OPENCV_CWRAPPER_DIR)
endif
endif

#################################################
# general targets
Expand Down
27 changes: 24 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ AC_ARG_WITH([local-projectM-presets],
# add OpenCV option
AC_ARG_WITH([opencv-cxx-api],
[AS_HELP_STRING([--with-opencv-cxx-api],
[use current OpenCV C++ API @<:@default=no@:>@])],
[with_opencv_cxx_api=$withval], [with_opencv_cxx_api="no"])
[use current OpenCV C++ API @<:@default=auto (yes on Windows, no elsewhere)@:>@])],
[with_opencv_cxx_api=$withval], [with_opencv_cxx_api="auto"])

# print misc options header
AC_ARG_WITH([cfg-dummy2], [
Expand Down Expand Up @@ -158,6 +158,15 @@ if [[ "$FPC_VERSION_MAJOR" -lt 3 ]]; then
])
fi

# On Windows, the OpenCV C-wrapper is required for compiling with current OpenCV.
# Keep explicit user values, but auto-enable when no value was provided.
if [[ "$with_opencv_cxx_api" = auto ]]; then
case "$FPC_PLATFORM" in
win32|win64) with_opencv_cxx_api=yes ;;
*) with_opencv_cxx_api=no ;;
esac
fi

# find and test the C compiler (for C-libs and wrappers)
AC_PROG_CC
AC_LANG([C])
Expand Down Expand Up @@ -186,6 +195,15 @@ fi
# check for libraries
# -----------------------------------------

use_generated_config=yes
if test x$FPC_PLATFORM = xwin32 -o x$FPC_PLATFORM = xwin64; then
use_generated_config=no
AC_MSG_NOTICE([Using src/config-win.inc for Windows library configuration; skipping pkg-config checks for bundled runtime DLLs.])
libprojectM_USE_CWRAPPER=no
AC_SUBST(USE_PROJECTM_CWRAPPER, $libprojectM_USE_CWRAPPER)
opencv_USE_CWRAPPER=yes
AC_SUBST(USE_OPENCV_CWRAPPER, $opencv_USE_CWRAPPER)
else
# find sdl2
PKG_HAVE([sdl2], [sdl2], yes)

Expand Down Expand Up @@ -433,6 +451,7 @@ fi
AC_SUBST_DEFINE(HAVE_PORTMIDI, $portmidi_HAVE)
AC_SUBST_DEFINE(HAVE_PORTTIME, $porttime_HAVE)
AC_SUBST(porttime_LIB_NAME)
fi

# determine linker-flags
if test x$FPC_PLATFORM = xdarwin; then
Expand All @@ -448,7 +467,9 @@ AC_SUBST(LIBS)

AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([src/Makefile])
AC_CONFIG_FILES([src/config-$FPC_PLATFORM.inc:src/config.inc.in])
if [[ "$use_generated_config" = yes ]]; then
AC_CONFIG_FILES([src/config-$FPC_PLATFORM.inc:src/config.inc.in])
fi
if [[ x$libprojectM_USE_CWRAPPER = xyes ]]; then
AC_CONFIG_FILES([src/lib/projectM/cwrapper/Makefile])
fi
Expand Down
12 changes: 12 additions & 0 deletions dists/autogen/m4/fpc.m4
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,18 @@ if test x$FPC_PLATFORM = xdarwin; then
fi
fi

# The official Windows x86_64 FPC package uses the generic "fpc" driver
# as a 32-bit cross-compiler targeting x86_64.
case "$host_os" in
mingw*|msys*|cygwin*)
case "$host_cpu" in
x86_64|amd64)
PFLAGS+=" -Px86_64 "
;;
esac
;;
esac

AC_SUBST(FPC_PLATFORM)
AC_SUBST(FPC_PROCESSOR)
AC_SUBST(FPC_CPLATFORM)
Expand Down
20 changes: 18 additions & 2 deletions dldlls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
import json
import sys
import os
import zipfile

sha = '67f6a4f9305a2ee1508215ad4a861f23f7b8e3da'
filename = 'usdx-dlls-i686'
sha = 'cf77d4e33eb71ad972f32bfb2633fb6ad704dc4a'
filename = 'usdx-dlls-x86_64'
urlbase = 'https://api.github.com/repos/UltraStar-Deluxe/mxe/'
headers = {
'Accept': 'application/vnd.github+json',
Expand All @@ -22,6 +23,19 @@

print('Searching for binaries built from commit ' + sha)

def download_bass():
bass_url = 'https://www.un4seen.com/files/bass24.zip'
zip_name = 'bass24.zip'
target = 'game/bass.dll'
with urllib.request.urlopen(bass_url) as dl, open(zip_name, 'wb') as out:
out.write(dl.read())
with zipfile.ZipFile(zip_name, 'r') as zf:
member = 'x64/bass.dll'
with zf.open(member) as src, open(target, 'wb') as dst:
dst.write(src.read())
print('Downloaded ' + member + ' to ' + target)


def search_releases():
pagesuffix = ''
page = 1
Expand Down Expand Up @@ -69,6 +83,8 @@ def search_artifacts():
print('No workflow artifact matches')
return None

download_bass()

dllurl = search_releases()
if dllurl == None and token != None:
dllurl = search_artifacts()
Expand Down
Binary file removed game/bass.dll
Binary file not shown.
Binary file removed game/cv210.dll
Binary file not shown.
Binary file removed game/cxcore210.dll
Binary file not shown.
Binary file removed game/glew32.dll
Binary file not shown.
Binary file removed game/highgui210.dll
Binary file not shown.
Binary file removed game/libprojectM.dll
Binary file not shown.
Binary file removed game/opengl32_.dll
Binary file not shown.
Binary file removed game/projectM-cwrapper.dll
Binary file not shown.
2 changes: 2 additions & 0 deletions installer/settings/files_main_uninstall.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
Delete "$INSTDIR\libjpeg-9.dll"
Delete "$INSTDIR\libpng16-16.dll"
Delete "$INSTDIR\libprojectM.dll"
Delete "$INSTDIR\libprojectM-0.dll"
Comment thread
dgruss marked this conversation as resolved.
Delete "$INSTDIR\libprojectM2.dll"
Delete "$INSTDIR\libssl32.dll"
Delete "$INSTDIR\libtiff-5.dll"
Expand All @@ -66,6 +67,7 @@
Delete "$INSTDIR\opengl32_.dll"
Delete "$INSTDIR\pcre3.dll"
Delete "$INSTDIR\portaudio_x86.dll"
Delete "$INSTDIR\portaudio_x64.dll"
Comment thread
dgruss marked this conversation as resolved.
Delete "$INSTDIR\portmixer.dll"
Delete "$INSTDIR\postproc-53.dll"
Delete "$INSTDIR\projectM-cwrapper.dll"
Expand Down
11 changes: 11 additions & 0 deletions src/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,15 @@ USE_PROJECTM_CWRAPPER := @USE_PROJECTM_CWRAPPER@
OPENCV_CWRAPPER_DIR := $(USDX_LIB_DIR)/openCV3
OPENCV_CWRAPPER_LIB := $(OPENCV_CWRAPPER_DIR)/libopenCV-cwrapper.a
USE_OPENCV_CWRAPPER := @USE_OPENCV_CWRAPPER@
USE_OPENCV_CWRAPPER_DLL ?= no
ifeq ($(EXEEXT),.exe)
USE_OPENCV_CWRAPPER_DLL := yes
endif
OPENCV_CWRAPPER_DLL_DIR ?= $(OPENCV_CWRAPPER_DIR)

ifeq ($(USE_OPENCV_CWRAPPER), yes)
PFLAGS_ALL += -Fl$(OPENCV_CWRAPPER_DLL_DIR)
endif

#################################################
# Static libs
Expand All @@ -165,8 +174,10 @@ STATIC_LIBS += $(PROJECTM_CWRAPPER_LIB)
endif

ifeq ($(USE_OPENCV_CWRAPPER), yes)
ifneq ($(USE_OPENCV_CWRAPPER_DLL), yes)
STATIC_LIBS += $(OPENCV_CWRAPPER_LIB)
endif
endif

#################################################
# general targets
Expand Down
4 changes: 2 additions & 2 deletions src/base/UPlatformWindows.pas
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ procedure TPlatformWindows.DetectLocalExecution();
// Note: Do not use IsReadOnly() as it does not check file privileges, so
// a non-read-only file might not be writable for us.
Handle := ConfigIni.Open(fmOpenReadWrite);
if (Handle <> -1) then
if (Handle <> INVALID_HANDLE_VALUE) then
begin
FileClose(Handle);
UseLocalDirs := true;
Expand All @@ -183,7 +183,7 @@ procedure TPlatformWindows.DetectLocalExecution();
begin
// try to create config.ini
Handle := ConfigIni.CreateFile();
if (Handle <> -1) then
if (Handle <> INVALID_HANDLE_VALUE) then
begin
FileClose(Handle);
UseLocalDirs := true;
Expand Down
10 changes: 6 additions & 4 deletions src/config-win.inc
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@

{$DEFINE HaveProjectM}
{$IF Defined(HaveProjectM) and Defined(IncludeConstants)}
ProjectM_DataDir = 'Visuals\projectM';
PROJECTM_VERSION_MAJOR = 1;
PROJECTM_VERSION_MINOR = 1;
PROJECTM_VERSION_RELEASE = 0;
ProjectM_DataDir = 'visuals\projectM';
PROJECTM_VERSION_MAJOR = 2;
PROJECTM_VERSION_MINOR = 2;
PROJECTM_VERSION_RELEASE = 1;
{$IFEND}

{$UNDEF HavePortaudio}
Expand All @@ -74,3 +74,5 @@
{$UNDEF HavePortmixer}

{$DEFINE UseMIDIPort}

{$DEFINE UseOpenCVWrapper}
3 changes: 1 addition & 2 deletions src/lib/freetype/freetype.pas
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ interface

const
{$IF Defined(MSWINDOWS)}
ft_lib = 'freetype6.dll';
ft_lib = 'libfreetype-6.dll';
{$ELSEIF Defined(DARWIN)}
ft_lib = 'libfreetype.dylib';
{$LINKLIB libfreetype}
Expand Down Expand Up @@ -1900,4 +1900,3 @@ function FT_IS_SCALABLE(face : FT_Face ) : cbool;
end;

end.

4 changes: 2 additions & 2 deletions src/lib/midi/MidiIn.pas
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,8 @@ procedure TMidiInput.Open;
Pctlinfo^.hWindow := Handle; { Control's window handle }
PCtlInfo^.SysexOnly := FSysexOnly;
FError := midiInOpen(@FMidiHandle, FDeviceId,
dword(@midiHandler),
dword(PCtlInfo),
PtrUInt(@midiHandler),
PtrUInt(PCtlInfo),
CALLBACK_FUNCTION);

if FError <> MMSYSERR_NOERROR then
Expand Down
4 changes: 2 additions & 2 deletions src/lib/midi/MidiOut.pas
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,8 @@ function Tmidioutput.Open: boolean;
Pctlinfo^.hWindow := Handle; { Control's window handle }

FError := midioutOpen(@FMidiHandle, FDeviceId,
dword(@midiHandler),
dword(PCtlInfo),
PtrUInt(@midiHandler),
PtrUInt(PCtlInfo),
CALLBACK_FUNCTION);
{ FError := midioutOpen(@FMidiHandle, FDeviceId,
Handle,
Expand Down
Loading