diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6cccdbdcf..0f2a6213e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,9 +12,9 @@ jobs: { macos-xcode: { - runs-on: macos-10.15, + runs-on: macos-12, env: { - DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer + DEVELOPER_DIR: /Applications/Xcode_13.4.app/Contents/Developer }, steps: [ { @@ -44,27 +44,37 @@ } ] }, - # macos-scons: { - # runs-on: macos-10.15, - # steps: [ - # { - # name: checkout, - # uses: actions/checkout@v2, - # with: { submodules: true } - # }, - # { - # name: install dependencies, - # run: brew install scons SFML Boost - # }, - # { - # name: build and unit test, - # run: ./.github/workflows/scripts/mac/scons-build.sh - # } - # ] - # }, + macos-scons: { + runs-on: macos-12, + steps: [ + { + name: checkout, + uses: actions/checkout@v2, + with: { submodules: true } + }, + { + name: install dependencies, + run: brew install scons SFML Boost + }, + { + name: build and unit test, + run: ./.github/workflows/scripts/mac/scons-build.sh + } + ] + }, win-vs32: { runs-on: windows-2019, + env: { + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" + }, steps: [ + { + name: Export GitHub Actions cache environment variables, + uses: actions/github-script@v7, + with: { + script: "core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');" + } + }, { name: checkout, uses: actions/checkout@v2, @@ -72,7 +82,8 @@ }, { name: install dependencies, - run: '.\.github\workflows\scripts\win\install-deps.bat x86' + run: '${{ github.workspace }}\.github\workflows\scripts\win\install-deps.bat x86', + working-directory: proj/vs2017 }, { name: build, @@ -82,7 +93,17 @@ }, win-vs64: { runs-on: windows-2019, + env: { + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" + }, steps: [ + { + name: Export GitHub Actions cache environment variables, + uses: actions/github-script@v7, + with: { + script: "core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');" + } + }, { name: checkout, uses: actions/checkout@v2, @@ -90,7 +111,8 @@ }, { name: install dependencies, - run: '.\.github\workflows\scripts\win\install-deps.bat x64' + run: '${{ github.workspace }}\.github\workflows\scripts\win\install-deps.bat x64', + working-directory: proj/vs2017 }, { name: build, @@ -104,7 +126,17 @@ }, win-scons: { runs-on: windows-2019, + env: { + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" + }, steps: [ + { + name: Export GitHub Actions cache environment variables, + uses: actions/github-script@v7, + with: { + script: "core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');" + } + }, { name: checkout, uses: actions/checkout@v2, @@ -116,7 +148,11 @@ }, { name: install dependencies, - run: '.\.github\workflows\scripts\win\install-deps.bat x64' + run: '${{ github.workspace }}\.github\workflows\scripts\win\install-deps.bat x64', + working-directory: proj/vs2017 + }, + { + run: "dir C:/vcpkg/packages/boost-system_x64-windows/lib" }, { name: build and unit test, @@ -138,7 +174,8 @@ # }, # { # name: install dependencies, - # run: '.\.github\workflows\scripts\win\install-deps.bat x64' + # run: 'vcpkg install', + # working-directory: proj/vs2017 # }, # { # name: build and unit test, @@ -147,7 +184,7 @@ # ] # }, linux: { - runs-on: ubuntu-20.04, + runs-on: ubuntu-22.04, steps: [ { name: checkout, @@ -156,7 +193,7 @@ }, { name: install dependencies, - run: 'sudo apt-get install scons libxml2-utils zlib1g libsfml-dev libboost-all-dev zenity' + run: 'sudo apt-get update && sudo apt-get install scons libxml2-utils zlib1g libsfml-dev libboost-all-dev zenity' }, { name: install TGUI, diff --git a/.github/workflows/scripts/linux/install-tgui.sh b/.github/workflows/scripts/linux/install-tgui.sh index 67713ddb9..876bcdccb 100755 --- a/.github/workflows/scripts/linux/install-tgui.sh +++ b/.github/workflows/scripts/linux/install-tgui.sh @@ -3,7 +3,7 @@ git clone --depth 1 -b 0.9 https://github.com/texus/TGUI.git cd TGUI export CLICOLOR_FORCE=1 -cmake . +cmake -D TGUI_CXX_STANDARD=14 . make cmake --install . cd .. # Probably not needed but... diff --git a/.github/workflows/scripts/mac/scons-build.sh b/.github/workflows/scripts/mac/scons-build.sh index ce73e603d..10ee22d2d 100755 --- a/.github/workflows/scripts/mac/scons-build.sh +++ b/.github/workflows/scripts/mac/scons-build.sh @@ -2,5 +2,6 @@ export CC="$(brew --prefix llvm)/bin/clang" export CXX="$(brew --prefix llvm)/bin/clang++" +export SDKROOT="$(xcrun --show-sdk-path)" scons CXXFLAGS="-I/usr/local/opt/zlib/include" LINKFLAGS="-L/usr/local/opt/zlib/lib" diff --git a/.github/workflows/scripts/win/install-deps.bat b/.github/workflows/scripts/win/install-deps.bat index bfefd96b6..00f16ee7f 100644 --- a/.github/workflows/scripts/win/install-deps.bat +++ b/.github/workflows/scripts/win/install-deps.bat @@ -1,2 +1,2 @@ -vcpkg install zlib:%1-windows sfml:%1-windows opengl:%1-windows boost-any:%1-windows boost-dynamic-bitset:%1-windows boost-ptr-container:%1-windows boost-core:%1-windows boost-filesystem:%1-windows boost-system:%1-windows boost-date-time:%1-windows boost-chrono:%1-windows boost-math:%1-windows +vcpkg install --feature-flags=manifests,binarycaching --triplet %1-windows diff --git a/.github/workflows/scripts/win/msvc-build.bat b/.github/workflows/scripts/win/msvc-build.bat index b1b0d6f3d..199f89f22 100644 --- a/.github/workflows/scripts/win/msvc-build.bat +++ b/.github/workflows/scripts/win/msvc-build.bat @@ -4,6 +4,6 @@ vcpkg integrate install setlocal enabledelayedexpansion for /f "usebackq tokens=*" %%i in (`vswhere -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe`) do ( - "%%i" -clp:ForceConsoleColor -target:Build -property:Configuration=Release -property:Platform=%1 "proj/vs2017/Blades of Exile.sln" + "%%i" -clp:ForceConsoleColor -target:Build -property:Configuration=Release -property:Platform=%1 -property:VcpkgEnableManifest=true "proj/vs2017/Blades of Exile.sln" exit /b !errorlevel! ) diff --git a/.github/workflows/scripts/win/scons-build.bat b/.github/workflows/scripts/win/scons-build.bat index a3cfed6f0..4e1b6b6a0 100644 --- a/.github/workflows/scripts/win/scons-build.bat +++ b/.github/workflows/scripts/win/scons-build.bat @@ -2,7 +2,7 @@ setlocal enabledelayedexpansion for /f "usebackq tokens=*" %%i in (`vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -find **/Auxiliary/Build/vcvarsall.bat`) do ( - %%i + call "%%i" x86_amd64 ) -scons +scons bits=64 diff --git a/README.md b/README.md index 1c6d27257..6d4f34e0f 100644 --- a/README.md +++ b/README.md @@ -77,11 +77,11 @@ If you are using the Visual Studio toolset, we recommend installing Use the following commands to install the required dependencies: For 32-bit builds: - vcpkg install zlib:x86-windows sfml:x86-windows opengl:x86-windows boost-any:x86-windows boost-dynamic-bitset:x86-windows boost-ptr-container:x86-windows boost-core:x86-windows boost-filesystem:x86-windows boost-system:x86-windows boost-date-time:x86-windows boost-chrono:x86-windows boost-math:x86-windows + vcpkg install --triplet=x86-windows zlib sfml opengl boost-any boost-dynamic-bitset boost-ptr-container boost-core boost-filesystem boost-system boost-date-time boost-chrono boost-math boost-spirit For 64-bit builds: - vcpkg install zlib:x64-windows sfml:x64-windows opengl:x64-windows boost-any:x64-windows boost-dynamic-bitset:x64-windows boost-ptr-container:x64-windows boost-core:x64-windows boost-filesystem:x64-windows boost-system:x64-windows boost-date-time:x64-windows boost-chrono:x64-windows boost-math:x64-windows + vcpkg install --triplet=x64-windows zlib sfml opengl boost-any boost-dynamic-bitset boost-ptr-container boost-core boost-filesystem boost-system boost-date-time boost-chrono boost-math boost-spirit If this is the first time installing packages with vcpkg since install you will need to run the `integrate` command: diff --git a/SConstruct b/SConstruct index c8cf7fb5f..457cf01c4 100644 --- a/SConstruct +++ b/SConstruct @@ -91,10 +91,10 @@ if platform == "darwin": /usr/include /usr/local/include """), FRAMEWORKPATH=Split(""" - /System/Library/Frameworks - /Library/Frameworks - %s/Library/Frameworks - """ % os.environ['HOME'])) + {SDKROOT}/System/Library/Frameworks + {SDKROOT}/Library/Frameworks + {HOME}/Library/Frameworks + """.format(HOME = os.environ['HOME'], SDKROOT = os.environ['SDKROOT']))) def build_app_package(env, source, build_dir, info): source_name = source[0].name pkg_path = path.join(build_dir, "%s.app/Contents/" % source_name) @@ -111,6 +111,7 @@ if platform == "darwin": return all(not lib.startswith(x) for x in system_prefixes) def get_deps_for(source): deps = subprocess.check_output(['otool', '-L', source]).splitlines()[1:] + deps = map(lambda s: s.decode('utf-8'), deps) deps = list(map(str.strip, deps)) deps = list(filter(is_user_lib, deps)) deps = [x.split()[0] for x in deps] @@ -157,10 +158,19 @@ if platform == "darwin": break elif platform == "win32": if 'msvc' in env['TOOLS']: + vcpkg_prefix = (os.environ['HOME'] if 'HOME' in os.environ else 'C:') + '/vcpkg/' + vcpkg_installed = vcpkg_prefix + 'installed/x{env["bits"]}-windows' + vcpkg_other_packages = Glob(vcpkg_prefix + f'packages/**x{env["bits"]}-windows') + vcpkg_other_includes = [d.get_abspath() + '\\include' for d in vcpkg_other_packages] + vcpkg_other_libs = [d.get_abspath() + '\\lib' for d in vcpkg_other_packages] + project_includes = ['src/' + dir for dir in filter(lambda dir: os.path.isdir('src/' + dir), os.listdir('src'))] + include_paths=[vcpkg_installed + '/include'] + vcpkg_other_includes + project_includes env.Append( - LINKFLAGS=['/SUBSYSTEM:WINDOWS','/ENTRY:mainCRTStartup','/MACHINE:X86'], + LINKFLAGS=['/SUBSYSTEM:WINDOWS','/ENTRY:mainCRTStartup',f'/MACHINE:X{env["bits"]}'], CXXFLAGS=['/EHsc','/MD','/FIglobal.hpp'], - LIBPATH=("C:\Program Files (x86)\Microsoft Visual Studio " + env['MSVC_VERSION'] + "\VC\lib"), + CPPPATH=include_paths, + INCLUDEPATH=include_paths, + LIBPATH=[vcpkg_installed + '/lib'] + vcpkg_other_libs, LIBS=Split(""" kernel32 user32 @@ -210,7 +220,7 @@ if platform == 'darwin': # pretty sketchy, but should point to your boost install if subprocess.call(['which', '-s', 'brew']) == 0: # HomeBrew - brew_boost_version = '1.58.0' + brew_boost_version = '1.85.0' env.Append( LIBPATH=['/usr/local/Cellar/boost/'+brew_boost_version+'/lib'], CPPPATH=['/usr/local/Cellar/boost/'+brew_boost_version+'/include']) @@ -247,16 +257,17 @@ if not env.GetOption('clean'): print('zlib must be installed!') Exit(1) - def check_lib(lib, disp, suffixes=[], versions=[]): - if platform == "win32" and lib.startswith("boost"): - lib = "lib" + lib + def check_lib(lib, disp, suffixes=[], versions=[], msvc_versions=[]): if "mingw" in env["TOOLS"] and lib.startswith("sfml"): lib = "lib" + lib possible_names = [lib] if platform == "win32": if 'msvc' in env['TOOLS']: - vc_suffix = '-vc' + env['MSVC_VERSION'].replace('.','') - possible_names.append(lib + vc_suffix) + msvc_versions.append(env['MSVC_VERSION'].replace('.','')) + msvc_versions = list(set(msvc_versions)) + for version in msvc_versions: + vc_suffix = '-vc' + version + possible_names.append(lib + vc_suffix) n = len(possible_names) for i in range(n): for suff in suffixes: @@ -279,7 +290,9 @@ if not env.GetOption('clean'): print(" If you're sure it's installed, try passing INCLUDEPATH=...") Exit(1) - boost_versions = ['-1_54', '-1_55', '-1_56', '-1_57', '-1_58'] # This is a bit of a hack. :( + boost_versions = ['-1_84'] # This is a bit of a hack. :( + msvc_versions = ['140', '141', '142', '143'] # This is a new bit of a hack. :( + suffixes = ['-mt', '-mt-x64', '-mt-x32'] bundled_libs = [] @@ -289,8 +302,8 @@ if not env.GetOption('clean'): check_header('boost/any.hpp', 'Boost.Any') check_header('boost/math_fwd.hpp', 'Boost.Math') check_header('boost/spirit/include/classic.hpp', 'Boost.Spirit.Classic') - check_lib('boost_system', 'Boost.System', ['-mt'], boost_versions) - check_lib('boost_filesystem', 'Boost.Filesystem', ['-mt'], boost_versions) + check_lib('boost_system', 'Boost.System', suffixes, boost_versions, msvc_versions) + check_lib('boost_filesystem', 'Boost.Filesystem', suffixes, boost_versions, msvc_versions) check_lib('sfml-system', 'SFML-system') check_lib('sfml-window', 'SFML-window') check_lib('sfml-audio', 'SFML-audio') @@ -393,12 +406,12 @@ elif platform == "win32": break # Extra: Microsoft redistributable libraries installer if 'msvc' in env["TOOLS"]: - if path.exists("dep/VCRedistInstall.exe"): - env.Install("build/Blades of Exile/", "dep/VCRedistInstall.exe") + if path.exists("deps/VCRedistInstall.exe"): + env.Install("build/Blades of Exile/", "deps/VCRedistInstall.exe") else: print("WARNING: Cannot find installer for the MSVC redistributable libraries for your version of Visual Studio.") print("Please download it from Microsoft's website and place it at:") - print(" dep/VCRedistInstall.exe") + print(" deps/VCRedistInstall.exe") # Create it so its lack doesn't cause makensis to break # (Because the installer is an optional component.) open("build/Blades of Exile/VCRedistInstall.exe", 'w').close() diff --git a/deps/VCRedistInstall.exe b/deps/VCRedistInstall.exe new file mode 100644 index 000000000..9ea49556c Binary files /dev/null and b/deps/VCRedistInstall.exe differ diff --git a/doc/editor/Contents.html b/doc/editor/Contents.html index 79937a174..e616eddd0 100644 --- a/doc/editor/Contents.html +++ b/doc/editor/Contents.html @@ -79,7 +79,6 @@
  • Item Ability Types
  • Starting Terrain Types
  • Blades Sound Effects
  • -
  • Text Messages
  • Spell and Alchemy Lists
  • Special Encounter Examples
  • diff --git a/doc/editor/Items.html b/doc/editor/Items.html index 11934dc97..4614dceb4 100644 --- a/doc/editor/Items.html +++ b/doc/editor/Items.html @@ -13,7 +13,7 @@

    Section 8 - Editing Item Types

    Your default scenario comes with 383 premade item types, number 0 to 382, and you can -have 400 item types overall. Like terrain types, you can customize the item types to suit +add as many new types as you wish. Like terrain types, you can customize the item types to suit your scenario. Click on Edit Item Types to bring up a list of items, and click on an item type to bring up the item editing window. This window has these options: