1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-28 13:09:40 +00:00

Merge branch 'master' of https://gitlab.com/madsbuvi/openmw into openxr_vr

This commit is contained in:
Mads Buvik Sandvei 2020-10-22 20:39:53 +02:00
commit 4f8f0cc8ac
635 changed files with 11239 additions and 6910 deletions

View file

@ -1,50 +1,89 @@
stages: stages:
- build - build
Debian: .Debian:
tags: tags:
- docker - docker
- linux - linux
image: debian:bullseye image: debian:bullseye
cache: cache:
key: cache.002
paths: paths:
- apt-cache/ - apt-cache/
- ccache/ - ccache/
before_script: before_script:
- export APT_CACHE_DIR=`pwd`/apt-cache && mkdir -pv $APT_CACHE_DIR - export APT_CACHE_DIR=`pwd`/apt-cache && mkdir -pv $APT_CACHE_DIR
- apt-get update -yq - apt-get update -yq
- apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -y cmake build-essential libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libboost-iostreams-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libswresample-dev libsdl2-dev libqt5opengl5-dev libopenal-dev libopenscenegraph-dev libunshield-dev libtinyxml-dev libmygui-dev libbullet-dev ccache - apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -y cmake build-essential libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libboost-iostreams-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libswresample-dev libsdl2-dev libqt5opengl5-dev libopenal-dev libopenscenegraph-dev libunshield-dev libtinyxml-dev libmygui-dev libbullet-dev liblz4-dev ccache git clang
stage: build stage: build
script: script:
- export CCACHE_BASEDIR="`pwd`" - export CCACHE_BASEDIR="`pwd`"
- export CCACHE_DIR="`pwd`/ccache" && mkdir -pv "$CCACHE_DIR" - export CCACHE_DIR="`pwd`/ccache" && mkdir -pv "$CCACHE_DIR"
- ccache -z -M 250M - ccache -z -M "${CCACHE_SIZE}"
- cores_to_use=$((`nproc`-2)); if (( $cores_to_use < 1 )); then cores_to_use=1; fi - CI/before_script.linux.sh
- mkdir build; cd build; cmake -DCMAKE_BUILD_TYPE=MinSizeRel ../ -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache - cd build
- make -j$cores_to_use - cmake --build . -- -j $(nproc)
- DESTDIR=artifacts make install - cmake --install .
- if [[ "${BUILD_TESTS_ONLY}" ]]; then ./openmw_test_suite; fi
- ccache -s - ccache -s
artifacts: artifacts:
paths: paths:
- build/artifacts/ - build/install/
Debian_GCC:
extends: .Debian
cache:
key: Debian_GCC.v2
variables:
CC: gcc
CXX: g++
CCACHE_SIZE: 3G
Debian_GCC_tests:
extends: .Debian
cache:
key: Debian_GCC_tests.v2
variables:
CC: gcc
CXX: g++
CCACHE_SIZE: 1G
BUILD_TESTS_ONLY: 1
Debian_Clang:
extends: .Debian
cache:
key: Debian_Clang.v2
variables:
CC: clang
CXX: clang++
CCACHE_SIZE: 2G
Debian_Clang_tests:
extends: .Debian
cache:
key: Debian_Clang_tests.v2
variables:
CC: clang
CXX: clang++
CCACHE_SIZE: 1G
BUILD_TESTS_ONLY: 1
MacOS: MacOS:
tags: tags:
- macos - macos
- xcode
except:
- branches # because our CI VMs are not public, MRs can't use them and timeout
stage: build stage: build
allow_failure: true only:
variables:
- $CI_PROJECT_ID == "7107382"
script: script:
- rm -fr build/* # remove anything in the build directory - rm -fr build/* # remove anything in the build directory
- CI/before_install.osx.sh - CI/before_install.osx.sh
- CI/before_script.osx.sh - CI/before_script.osx.sh
- cd build; make -j2 package - cd build; make -j2 package
- for dmg in *.dmg; do mv "$dmg" "${dmg%.dmg}_${CI_COMMIT_REF_NAME}_${CI_JOB_ID}.dmg"; done
artifacts: artifacts:
paths: paths:
- build/OpenMW-*.dmg - build/OpenMW-*.dmg
- "build/**/*.log"
variables: &engine-targets variables: &engine-targets
targets: "openmw_vr,openmw-essimporter,openmw-iniimporter,openmw-launcher,openmw-wizard" targets: "openmw_vr,openmw-essimporter,openmw-iniimporter,openmw-launcher,openmw-wizard"
@ -57,6 +96,7 @@ variables: &cs-targets
- windows - windows
before_script: before_script:
- Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" - Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
- choco source add -n=openmw-proxy -s="https://repo.openmw.org/repository/Chocolately/" --priority=1
- choco install git --force --params "/GitAndUnixToolsOnPath" -y - choco install git --force --params "/GitAndUnixToolsOnPath" -y
- choco install 7zip -y - choco install 7zip -y
- choco install cmake.install --installargs 'ADD_CMAKE_TO_PATH=System' -y - choco install cmake.install --installargs 'ADD_CMAKE_TO_PATH=System' -y
@ -146,6 +186,7 @@ Windows_Ninja_CS_RelWithDebInfo:
- windows - windows
before_script: before_script:
- Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" - Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
- choco source add -n=openmw-proxy -s="https://repo.openmw.org/repository/Chocolately/" --priority=1
- choco install git --force --params "/GitAndUnixToolsOnPath" -y - choco install git --force --params "/GitAndUnixToolsOnPath" -y
- choco install 7zip -y - choco install 7zip -y
- choco install cmake.install --installargs 'ADD_CMAKE_TO_PATH=System' -y - choco install cmake.install --installargs 'ADD_CMAKE_TO_PATH=System' -y
@ -226,4 +267,36 @@ Windows_MSBuild_CS_RelWithDebInfo:
- .Windows_MSBuild_Base - .Windows_MSBuild_Base
variables: variables:
<<: *cs-targets <<: *cs-targets
config: "RelWithDebInfo" config: "RelWithDebInfo"
Debian_AndroidNDK_arm64-v8a:
tags:
- linux
image: debian:bullseye
variables:
CCACHE_SIZE: 3G
cache:
key: Debian_AndroidNDK_arm64-v8a.v2
paths:
- apt-cache/
- ccache/
before_script:
- export APT_CACHE_DIR=`pwd`/apt-cache && mkdir -pv $APT_CACHE_DIR
- echo "deb http://deb.debian.org/debian unstable main contrib" > /etc/apt/sources.list
- echo "google-android-ndk-installer google-android-installers/mirror select https://dl.google.com" | debconf-set-selections
- apt-get update -yq
- apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -y cmake ccache curl unzip git build-essential google-android-ndk-installer
stage: build
script:
- export CCACHE_BASEDIR="`pwd`"
- export CCACHE_DIR="`pwd`/ccache" && mkdir -pv "$CCACHE_DIR"
- ccache -z -M "${CCACHE_SIZE}"
- CI/before_install.android.sh
- CI/before_script.android.sh
- cd build
- cmake --build . -- -j $(nproc)
- cmake --install .
- ccache -s
artifacts:
paths:
- build/install/

View file

@ -23,7 +23,7 @@ addons:
# FFmpeg # FFmpeg
libavcodec-dev, libavformat-dev, libavutil-dev, libswresample-dev, libswscale-dev, libavcodec-dev, libavformat-dev, libavutil-dev, libswresample-dev, libswscale-dev,
# Audio, Video and Misc. deps # Audio, Video and Misc. deps
libsdl2-dev, libqt5opengl5-dev, libopenal-dev, libunshield-dev, libtinyxml-dev, libsdl2-dev, libqt5opengl5-dev, libopenal-dev, libunshield-dev, libtinyxml-dev, liblz4-dev
# The other ones from OpenMW ppa # The other ones from OpenMW ppa
libbullet-dev, libopenscenegraph-dev, libmygui-dev libbullet-dev, libopenscenegraph-dev, libmygui-dev
] ]
@ -37,14 +37,20 @@ addons:
build_command: "make VERBOSE=1 -j3" build_command: "make VERBOSE=1 -j3"
matrix: matrix:
include: include:
- name: OpenMW (all) on MacOS 10.15 with Xcode 12 - name: OpenMW (all) on MacOS 10.15 with Xcode 11.6
os: osx os: osx
osx_image: xcode12 osx_image: xcode11.6
if: branch != coverity_scan if: branch != coverity_scan
- name: OpenMW (all) on Ubuntu Focal with GCC - name: OpenMW (all) on Ubuntu Focal with GCC
os: linux os: linux
dist: focal dist: focal
if: branch != coverity_scan if: branch != coverity_scan
- name: OpenMW (tests only) on Ubuntu Focal with GCC
os: linux
dist: focal
if: branch != coverity_scan
env:
- BUILD_TESTS_ONLY: 1
- name: OpenMW (openmw) on Ubuntu Focal with Clang's Static Analysis - name: OpenMW (openmw) on Ubuntu Focal with Clang's Static Analysis
os: linux os: linux
dist: focal dist: focal
@ -71,9 +77,9 @@ before_script:
script: script:
- cd ./build - cd ./build
- if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then ${ANALYZE} make -j3; fi - if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then ${ANALYZE} make -j3; fi
# - if [ "${COVERITY_SCAN_BRANCH}" != 1 ] && [ "${TRAVIS_OS_NAME}" = "osx" ]; then make package; fi - if [ "${COVERITY_SCAN_BRANCH}" != 1 ] && [ "${TRAVIS_OS_NAME}" = "osx" ]; then make package; fi
# - if [ "${COVERITY_SCAN_BRANCH}" != 1 ] && [ "${TRAVIS_OS_NAME}" = "osx" ]; then ../CI/check_package.osx.sh; fi - if [ "${COVERITY_SCAN_BRANCH}" != 1 ] && [ "${TRAVIS_OS_NAME}" = "osx" ]; then ../CI/check_package.osx.sh; fi
- if [ "${COVERITY_SCAN_BRANCH}" != 1 ] && [ "${TRAVIS_OS_NAME}" = "linux" ]; then ./openmw_test_suite; fi - if [ "${COVERITY_SCAN_BRANCH}" != 1 ] && [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "${BUILD_TESTS_ONLY}" ]; then ./openmw_test_suite; fi
- if [ "${COVERITY_SCAN_BRANCH}" != 1 ] && [ "${TRAVIS_OS_NAME}" = "linux" ]; then cd .. && ./CI/check_tabs.sh; fi - if [ "${COVERITY_SCAN_BRANCH}" != 1 ] && [ "${TRAVIS_OS_NAME}" = "linux" ]; then cd .. && ./CI/check_tabs.sh; fi
- cd "${TRAVIS_BUILD_DIR}" - cd "${TRAVIS_BUILD_DIR}"
- ccache -s - ccache -s

View file

@ -10,7 +10,10 @@ If you feel your name is missing from this list, please notify a developer.
Programmers Programmers
----------- -----------
Marc Zinnschlag (Zini) - Lead Programmer/Project Manager Bret Curtis (psi29a) - Project leader 2019-present
Marc Zinnschlag (Zini) - Project leader 2010-2018
Nicolay Korslund - Project leader 2008-2010
scrawl - Top contributor
Adam Hogan (aurix) Adam Hogan (aurix)
Aesylwinn Aesylwinn
@ -39,7 +42,6 @@ Programmers
Austin Salgat (Salgat) Austin Salgat (Salgat)
Ben Shealy (bentsherman) Ben Shealy (bentsherman)
Berulacks Berulacks
Bret Curtis (psi29a)
Britt Mathis (galdor557) Britt Mathis (galdor557)
Capostrophic Capostrophic
Carl Maxwell Carl Maxwell
@ -146,7 +148,6 @@ Programmers
Nathan Jeffords (blunted2night) Nathan Jeffords (blunted2night)
NeveHanter NeveHanter
Nialsy Nialsy
Nicolay Korslund
Nikolay Kasyanov (corristo) Nikolay Kasyanov (corristo)
nobrakal nobrakal
Nolan Poe (nopoe) Nolan Poe (nopoe)
@ -175,7 +176,6 @@ Programmers
Roman Siromakha (elsid) Roman Siromakha (elsid)
Sandy Carter (bwrsandman) Sandy Carter (bwrsandman)
Scott Howard (maqifrnswa) Scott Howard (maqifrnswa)
scrawl
Sebastian Wick (swick) Sebastian Wick (swick)
Sergey Fukanchik Sergey Fukanchik
Sergey Shambir (sergey-shambir) Sergey Shambir (sergey-shambir)
@ -302,4 +302,4 @@ Thanks to Kevin Ryan,
for creating the icon used for the Data Files tab of the OpenMW Launcher. for creating the icon used for the Data Files tab of the OpenMW Launcher.
Thanks to DejaVu team, Thanks to DejaVu team,
for their DejaVuLGCSansMono fontface, see DejaVu Font License.txt for their license terms. for their DejaVuLGCSansMono fontface, see DejaVuFontLicense.txt for their license terms.

View file

@ -3,13 +3,21 @@
Bug #1662: Qt4 and Windows binaries crash if there's a non-ASCII character in a file path/config path Bug #1662: Qt4 and Windows binaries crash if there's a non-ASCII character in a file path/config path
Bug #1952: Incorrect particle lighting Bug #1952: Incorrect particle lighting
Bug #2069: Fireflies in Fireflies invade Morrowind look wrong
Bug #2311: Targeted scripts are not properly supported on non-unique RefIDs Bug #2311: Targeted scripts are not properly supported on non-unique RefIDs
Bug #2473: Unable to overstock merchants
Bug #2798: Mutable ESM records
Bug #3676: NiParticleColorModifier isn't applied properly Bug #3676: NiParticleColorModifier isn't applied properly
Bug #3714: Savegame fails to load due to conflict between SpellState and MagicEffects Bug #3714: Savegame fails to load due to conflict between SpellState and MagicEffects
Bug #3862: Random container contents behave differently than vanilla
Bug #3929: Leveled list merchant containers respawn on barter
Bug #4021: Attributes and skills are not stored as floats Bug #4021: Attributes and skills are not stored as floats
Bug #4055: Local scripts don't inherit variables from their base record
Bug #4623: Corprus implementation is incorrect Bug #4623: Corprus implementation is incorrect
Bug #4631: Setting MSAA level too high doesn't fall back to highest supported level
Bug #4764: Data race in osg ParticleSystem Bug #4764: Data race in osg ParticleSystem
Bug #4774: Guards are ignorant of an invisible player that tries to attack them Bug #4774: Guards are ignorant of an invisible player that tries to attack them
Bug #5101: Hostile followers travel with the player
Bug #5108: Savegame bloating due to inefficient fog textures format Bug #5108: Savegame bloating due to inefficient fog textures format
Bug #5165: Active spells should use real time intead of timestamps Bug #5165: Active spells should use real time intead of timestamps
Bug #5358: ForceGreeting always resets the dialogue window completely Bug #5358: ForceGreeting always resets the dialogue window completely
@ -41,16 +49,37 @@
Bug #5502: Dead zone for analogue stick movement is too small Bug #5502: Dead zone for analogue stick movement is too small
Bug #5507: Sound volume is not clamped on ingame settings update Bug #5507: Sound volume is not clamped on ingame settings update
Bug #5531: Actors flee using current rotation by axis x Bug #5531: Actors flee using current rotation by axis x
Bug #5539: Window resize breaks when going from a lower resolution to full screen resolution
Bug #5548: Certain exhausted topics can be highlighted again even though there's no new dialogue
Bug #5557: Diagonal movement is noticeably slower with analogue stick
Bug #5588: Randomly clicking on the journal's right-side page when it's empty shows random topics
Bug #5603: Setting constant effect cast style doesn't correct effects view
Bug #5611: Usable items with "0 Uses" should be used only once
Bug #5622: Can't properly interact with the console when in pause menu
Bug #5639: Tooltips cover Messageboxes
Bug #5644: Summon effects running on the player during game initialization cause crashes
Feature #390: 3rd person look "over the shoulder" Feature #390: 3rd person look "over the shoulder"
Feature #2386: Distant Statics in the form of Object Paging Feature #2386: Distant Statics in the form of Object Paging
Feature #2404: Levelled List can not be placed into a container
Feature #4894: Consider actors as obstacles for pathfinding
Feature #5043: Head Bobbing
Feature #5297: Add a search function to the "Datafiles" tab of the OpenMW launcher Feature #5297: Add a search function to the "Datafiles" tab of the OpenMW launcher
Feature #5362: Show the soul gems' trapped soul in count dialog Feature #5362: Show the soul gems' trapped soul in count dialog
Feature #5445: Handle NiLines Feature #5445: Handle NiLines
Feature #5457: Realistic diagonal movement Feature #5457: Realistic diagonal movement
Feature #5486: Fixes trainers to choose their training skills based on their base skill points Feature #5486: Fixes trainers to choose their training skills based on their base skill points
Feature #5519: Code Patch tab in launcher
Feature #5524: Resume failed script execution after reload Feature #5524: Resume failed script execution after reload
Feature #5525: Search fields tweaks (utf-8) Feature #5525: Search fields tweaks (utf-8)
Feature #5545: Option to allow stealing from an unconscious NPC during combat
Feature #5563: Run physics update in background thread
Feature #5579: MCP SetAngle enhancement
Feature #5580: Service refusal filtering
Feature #5610: Actors movement should be smoother
Feature #5642: Ability to attach arrows to actor skeleton instead of bow mesh
Feature #5649: Skyrim SE compressed BSA format support
Task #5480: Drop Qt4 support Task #5480: Drop Qt4 support
Task #5520: Improve cell name autocompleter implementation
0.46.0 0.46.0
------ ------

View file

@ -1,6 +1,16 @@
#!/bin/bash #!/bin/bash
set -euo pipefail oldSettings=$-
set -eu
function restoreOldSettings {
if [[ $oldSettings != *e* ]]; then
set +e
fi
if [[ $oldSettings != *u* ]]; then
set +u
fi
}
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
echo "Error: Script not sourced." echo "Error: Script not sourced."
@ -8,6 +18,7 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
echo "source ./activate_msvc.sh" echo "source ./activate_msvc.sh"
echo "or" echo "or"
echo ". ./activate_msvc.sh" echo ". ./activate_msvc.sh"
restoreOldSettings
exit 1 exit 1
fi fi
@ -78,7 +89,10 @@ command -v mt >/dev/null 2>&1 || { echo "Error: mt (MS Windows Manifest Tool) mi
if [ $MISSINGTOOLS -ne 0 ]; then if [ $MISSINGTOOLS -ne 0 ]; then
echo "Some build tools were unavailable after activating MSVC in the shell. It's likely that your Visual Studio $MSVC_DISPLAY_YEAR installation needs repairing." echo "Some build tools were unavailable after activating MSVC in the shell. It's likely that your Visual Studio $MSVC_DISPLAY_YEAR installation needs repairing."
restoreOldSettings
return 1 return 1
fi fi
IFS="$originalIFS" IFS="$originalIFS"
restoreOldSettings

4
CI/before_install.android.sh Executable file
View file

@ -0,0 +1,4 @@
#!/bin/sh -ex
curl -fSL -R -J https://gitlab.com/OpenMW/openmw-deps/-/raw/main/android/openmw-android-deps-20201018.zip -o ~/openmw-android-deps.zip
unzip -o ~/openmw-android-deps -d /usr/lib/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr > /dev/null

View file

@ -1,6 +1,12 @@
#!/bin/sh -e #!/bin/sh -e
brew install ccache # Some of these tools can come from places other than brew, so check before installing
command -v ccache >/dev/null 2>&1 || brew install ccache
command -v cmake >/dev/null 2>&1 || brew install cmake
command -v qmake >/dev/null 2>&1 || brew install qt
brew link --overwrite lz4 # overwrite system lz4; use brew
brew reinstall lz4
curl -fSL -R -J https://downloads.openmw.org/osx/dependencies/openmw-deps-ef2462c.zip -o ~/openmw-deps.zip curl -fSL -R -J https://downloads.openmw.org/osx/dependencies/openmw-deps-ef2462c.zip -o ~/openmw-deps.zip
unzip -o ~/openmw-deps.zip -d /private/tmp/openmw-deps > /dev/null unzip -o ~/openmw-deps.zip -d /private/tmp/openmw-deps > /dev/null

25
CI/before_script.android.sh Executable file
View file

@ -0,0 +1,25 @@
#!/bin/sh -ex
# hack to work around: FFmpeg version is too old, 3.2 is required
sed -i s/"NOT FFVER_OK"/"FALSE"/ CMakeLists.txt
mkdir build
cd build
cmake \
-DCMAKE_TOOLCHAIN_FILE=/usr/lib/android-sdk/ndk-bundle/build/cmake/android.toolchain.cmake \
-DANDROID_ABI=arm64-v8a \
-DANDROID_PLATFORM=android-21 \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_INSTALL_PREFIX=install \
-DBUILD_BSATOOL=0 \
-DBUILD_NIFTEST=0 \
-DBUILD_ESMTOOL=0 \
-DBUILD_LAUNCHER=0 \
-DBUILD_MWINIIMPORTER=0 \
-DBUILD_ESSIMPORTER=0 \
-DBUILD_OPENCS=0 \
-DBUILD_WIZARD=0 \
-DMyGUI_LIBRARY="/usr/lib/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/libMyGUIEngineStatic.a" \
..

View file

@ -2,22 +2,43 @@
free -m free -m
env GENERATOR='Unix Makefiles' CONFIGURATION=Release CI/build_googletest.sh if [[ "${BUILD_TESTS_ONLY}" ]]; then
GOOGLETEST_DIR="$(pwd)/googletest/build" export GOOGLETEST_DIR="$(pwd)/googletest/build/install"
env GENERATOR='Unix Makefiles' CONFIGURATION=Release CI/build_googletest.sh
fi
mkdir build mkdir build
cd build cd build
${ANALYZE} cmake \ if [[ "${BUILD_TESTS_ONLY}" ]]; then
-DCMAKE_C_COMPILER="${CC}" \ ${ANALYZE} cmake \
-DCMAKE_CXX_COMPILER="${CXX}" \ -D CMAKE_C_COMPILER="${CC}" \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ -D CMAKE_CXX_COMPILER="${CXX}" \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -D CMAKE_C_COMPILER_LAUNCHER=ccache \
-DBUILD_UNITTESTS=TRUE \ -D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DUSE_SYSTEM_TINYXML=TRUE \ -D CMAKE_INSTALL_PREFIX=install \
-DCMAKE_INSTALL_PREFIX="/usr" \ -D CMAKE_BUILD_TYPE=RelWithDebInfo \
-DBINDIR="/usr/games" \ -D USE_SYSTEM_TINYXML=TRUE \
-DCMAKE_BUILD_TYPE="DEBUG" \ -D BUILD_OPENMW=OFF \
-DGTEST_ROOT="${GOOGLETEST_DIR}" \ -D BUILD_BSATOOL=OFF \
-DGMOCK_ROOT="${GOOGLETEST_DIR}" \ -D BUILD_ESMTOOL=OFF \
.. -D BUILD_LAUNCHER=OFF \
-D BUILD_MWINIIMPORTER=OFF \
-D BUILD_ESSIMPORTER=OFF \
-D BUILD_OPENCS=OFF \
-D BUILD_WIZARD=OFF \
-D BUILD_UNITTESTS=ON \
-D GTEST_ROOT="${GOOGLETEST_DIR}" \
-D GMOCK_ROOT="${GOOGLETEST_DIR}" \
..
else
${ANALYZE} cmake \
-D CMAKE_C_COMPILER="${CC}" \
-D CMAKE_CXX_COMPILER="${CXX}" \
-D CMAKE_C_COMPILER_LAUNCHER=ccache \
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
-D USE_SYSTEM_TINYXML=TRUE \
-D CMAKE_INSTALL_PREFIX=install \
-D CMAKE_BUILD_TYPE=Debug \
..
fi

View file

@ -69,7 +69,7 @@ NMAKE=""
NINJA="" NINJA=""
PDBS="" PDBS=""
PLATFORM="" PLATFORM=""
CONFIGURATION="" CONFIGURATIONS=()
TEST_FRAMEWORK="" TEST_FRAMEWORK=""
GOOGLE_INSTALL_ROOT="" GOOGLE_INSTALL_ROOT=""
INSTALL_PREFIX="." INSTALL_PREFIX="."
@ -133,7 +133,7 @@ while [ $# -gt 0 ]; do
PDBS=true ;; PDBS=true ;;
c ) c )
CONFIGURATION=$1 CONFIGURATIONS+=( $1 )
shift ;; shift ;;
t ) t )
@ -147,8 +147,10 @@ while [ $# -gt 0 ]; do
cat <<EOF cat <<EOF
Usage: $0 [-cdehkpuvVi] Usage: $0 [-cdehkpuvVi]
Options: Options:
-c <Release/Debug> -c <Release/Debug/RelWithDebInfo>
Set the configuration, can also be set with environment variable CONFIGURATION. Set the configuration, can also be set with environment variable CONFIGURATION.
For mutli-config generators, this is ignored, and all configurations are set up.
For single-config generators, several configurations can be set up at once by specifying -c multiple times.
-d -d
Skip checking the downloads. Skip checking the downloads.
-D -D
@ -168,7 +170,7 @@ Options:
-v <2017/2019> -v <2017/2019>
Choose the Visual Studio version to use. Choose the Visual Studio version to use.
-n -n
Produce NMake makefiles instead of a Visual Studio solution. Cannout be used with -N. Produce NMake makefiles instead of a Visual Studio solution. Cannot be used with -N.
-N -N
Produce Ninja (multi-config if CMake is new enough to support it) files instead of a Visual Studio solution. Cannot be used with -n.. Produce Ninja (multi-config if CMake is new enough to support it) files instead of a Visual Studio solution. Cannot be used with -n..
-P -P
@ -191,7 +193,7 @@ done
if [ -n "$NMAKE" ] || [ -n "$NINJA" ]; then if [ -n "$NMAKE" ] || [ -n "$NINJA" ]; then
if [ -n "$NMAKE" ] && [ -n "$NINJA" ]; then if [ -n "$NMAKE" ] && [ -n "$NINJA" ]; then
echo "Cannout run in NMake and Ninja mode at the same time." echo "Cannot run in NMake and Ninja mode at the same time."
wrappedExit 1 wrappedExit 1
fi fi
ACTIVATE_MSVC=true ACTIVATE_MSVC=true
@ -262,10 +264,10 @@ download() {
if [ -z $VERBOSE ]; then if [ -z $VERBOSE ]; then
RET=0 RET=0
curl --silent --retry 10 -kLy 5 -o $FILE $URL || RET=$? curl --silent --retry 10 -Ly 5 -o $FILE $URL || RET=$?
else else
RET=0 RET=0
curl --retry 10 -kLy 5 -o $FILE $URL || RET=$? curl --retry 10 -Ly 5 -o $FILE $URL || RET=$?
fi fi
if [ $RET -ne 0 ]; then if [ $RET -ne 0 ]; then
@ -297,29 +299,40 @@ add_cmake_opts() {
CMAKE_OPTS="$CMAKE_OPTS $@" CMAKE_OPTS="$CMAKE_OPTS $@"
} }
RUNTIME_DLLS="" declare -A RUNTIME_DLLS
RUNTIME_DLLS["Release"]=""
RUNTIME_DLLS["Debug"]=""
RUNTIME_DLLS["RelWithDebInfo"]=""
add_runtime_dlls() { add_runtime_dlls() {
RUNTIME_DLLS="$RUNTIME_DLLS $@" local CONFIG=$1
shift
RUNTIME_DLLS[$CONFIG]="${RUNTIME_DLLS[$CONFIG]} $@"
} }
OSG_PLUGINS="" declare -A OSG_PLUGINS
OSG_PLUGINS["Release"]=""
OSG_PLUGINS["Debug"]=""
OSG_PLUGINS["RelWithDebInfo"]=""
add_osg_dlls() { add_osg_dlls() {
OSG_PLUGINS="$OSG_PLUGINS $@" local CONFIG=$1
shift
OSG_PLUGINS[$CONFIG]="${OSG_PLUGINS[$CONFIG]} $@"
} }
QT_PLATFORMS="" declare -A QT_PLATFORMS
QT_PLATFORMS["Release"]=""
QT_PLATFORMS["Debug"]=""
QT_PLATFORMS["RelWithDebInfo"]=""
add_qt_platform_dlls() { add_qt_platform_dlls() {
QT_PLATFORMS="$QT_PLATFORMS $@" local CONFIG=$1
shift
QT_PLATFORMS[$CONFIG]="${QT_PLATFORMS[$CONFIG]} $@"
} }
if [ -z $PLATFORM ]; then if [ -z $PLATFORM ]; then
PLATFORM="$(uname -m)" PLATFORM="$(uname -m)"
fi fi
if [ -z $CONFIGURATION ]; then
CONFIGURATION="Debug"
fi
if [ -z $VS_VERSION ]; then if [ -z $VS_VERSION ]; then
VS_VERSION="2017" VS_VERSION="2017"
fi fi
@ -381,23 +394,6 @@ case $PLATFORM in
;; ;;
esac esac
case $CONFIGURATION in
debug|Debug|DEBUG )
CONFIGURATION=Debug
BUILD_CONFIG=Debug
;;
release|Release|RELEASE )
CONFIGURATION=Release
BUILD_CONFIG=Release
;;
relwithdebinfo|RelWithDebInfo|RELWITHDEBINFO )
CONFIGURATION=Release
BUILD_CONFIG=RelWithDebInfo
;;
esac
if [ $BITS -eq 64 ] && [ $MSVC_REAL_VER -lt 16 ]; then if [ $BITS -eq 64 ] && [ $MSVC_REAL_VER -lt 16 ]; then
GENERATOR="${GENERATOR} Win64" GENERATOR="${GENERATOR} Win64"
fi fi
@ -415,6 +411,79 @@ if [ -n "$NINJA" ]; then
fi fi
fi fi
if [ -n "$SINGLE_CONFIG" ]; then
if [ ${#CONFIGURATIONS[@]} -eq 0 ]; then
if [ -n "${CONFIGURATION:-}" ]; then
CONFIGURATIONS=("$CONFIGURATION")
else
CONFIGURATIONS=("Debug")
fi
elif [ ${#CONFIGURATIONS[@]} -ne 1 ]; then
# It's simplest just to recursively call the script a few times.
RECURSIVE_OPTIONS=()
if [ -n "$VERBOSE" ]; then
RECURSIVE_OPTIONS+=("-V")
fi
if [ -n "$SKIP_DOWNLOAD" ]; then
RECURSIVE_OPTIONS+=("-d")
fi
if [ -n "$BULLET_DOUBLE" ]; then
RECURSIVE_OPTIONS+=("-D")
fi
if [ -n "$SKIP_EXTRACT" ]; then
RECURSIVE_OPTIONS+=("-e")
fi
if [ -n "$KEEP" ]; then
RECURSIVE_OPTIONS+=("-k")
fi
if [ -n "$UNITY_BUILD" ]; then
RECURSIVE_OPTIONS+=("-u")
fi
if [ -n "$NMAKE" ]; then
RECURSIVE_OPTIONS+=("-n")
fi
if [ -n "$NINJA" ]; then
RECURSIVE_OPTIONS+=("-N")
fi
if [ -n "$PDBS" ]; then
RECURSIVE_OPTIONS+=("-P")
fi
if [ -n "$TEST_FRAMEWORK" ]; then
RECURSIVE_OPTIONS+=("-t")
fi
RECURSIVE_OPTIONS+=("-v $VS_VERSION")
RECURSIVE_OPTIONS+=("-p $PLATFORM")
RECURSIVE_OPTIONS+=("-i '$INSTALL_PREFIX'")
for config in ${CONFIGURATIONS[@]}; do
$0 ${RECURSIVE_OPTIONS[@]} -c $config
done
wrappedExit 1
fi
else
if [ ${#CONFIGURATIONS[@]} -ne 0 ]; then
echo "Ignoring configurations argument - generator is multi-config"
fi
CONFIGURATIONS=("Release" "Debug" "RelWithDebInfo")
fi
for i in ${!CONFIGURATIONS[@]}; do
case ${CONFIGURATIONS[$i]} in
debug|Debug|DEBUG )
CONFIGURATIONS[$i]=Debug
;;
release|Release|RELEASE )
CONFIGURATIONS[$i]=Release
;;
relwithdebinfo|RelWithDebInfo|RELWITHDEBINFO )
CONFIGURATIONS[$i]=RelWithDebInfo
;;
esac
done
if [ $MSVC_REAL_VER -ge 16 ] && [ -z "$NMAKE" ] && [ -z "$NINJA" ]; then if [ $MSVC_REAL_VER -ge 16 ] && [ -z "$NMAKE" ] && [ -z "$NINJA" ]; then
if [ $BITS -eq 64 ]; then if [ $BITS -eq 64 ]; then
add_cmake_opts "-G\"$GENERATOR\" -A x64" add_cmake_opts "-G\"$GENERATOR\" -A x64"
@ -426,7 +495,7 @@ else
fi fi
if [ -n "$SINGLE_CONFIG" ]; then if [ -n "$SINGLE_CONFIG" ]; then
add_cmake_opts "-DCMAKE_BUILD_TYPE=${BUILD_CONFIG}" add_cmake_opts "-DCMAKE_BUILD_TYPE=${CONFIGURATIONS[0]}"
fi fi
if ! [ -z $UNITY_BUILD ]; then if ! [ -z $UNITY_BUILD ]; then
@ -458,54 +527,59 @@ if [ -z $SKIP_DOWNLOAD ]; then
# Boost # Boost
if [ -z $APPVEYOR ]; then if [ -z $APPVEYOR ]; then
download "Boost ${BOOST_VER}" \ download "Boost ${BOOST_VER}" \
"https://sourceforge.net/projects/boost/files/boost-binaries/${BOOST_VER}/boost_${BOOST_VER_URL}-msvc-${MSVC_VER}-${BITS}.exe" \ "https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/boost_${BOOST_VER_URL}-msvc-${MSVC_VER}-${BITS}.exe" \
"boost-${BOOST_VER}-msvc${MSVC_VER}-win${BITS}.exe" "boost-${BOOST_VER}-msvc${MSVC_VER}-win${BITS}.exe"
fi fi
# Bullet # Bullet
download "Bullet 2.89 (${BULLET_DBL_DISPLAY})" \ download "Bullet 2.89 (${BULLET_DBL_DISPLAY})" \
"https://rgw.ctrl-c.liu.se/openmw/Deps/Bullet-2.89-msvc${MSVC_YEAR}-win${BITS}${BULLET_DBL}.7z" \ "https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/Bullet-2.89-msvc${MSVC_YEAR}-win${BITS}${BULLET_DBL}.7z" \
"Bullet-2.89-msvc${MSVC_YEAR}-win${BITS}${BULLET_DBL}.7z" "Bullet-2.89-msvc${MSVC_YEAR}-win${BITS}${BULLET_DBL}.7z"
# FFmpeg # FFmpeg
download "FFmpeg 4.2.2" \ download "FFmpeg 4.2.2" \
"https://ffmpeg.zeranoe.com/builds/win${BITS}/shared/ffmpeg-4.2.2-win${BITS}-shared.zip" \ "https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/ffmpeg-4.2.2-win${BITS}.zip" \
"ffmpeg-4.2.2-win${BITS}.zip" \ "ffmpeg-4.2.2-win${BITS}.zip" \
"https://ffmpeg.zeranoe.com/builds/win${BITS}/dev/ffmpeg-4.2.2-win${BITS}-dev.zip" \ "https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/ffmpeg-4.2.2-dev-win${BITS}.zip" \
"ffmpeg-4.2.2-dev-win${BITS}.zip" "ffmpeg-4.2.2-dev-win${BITS}.zip"
# MyGUI # MyGUI
download "MyGUI 3.4.0" \ download "MyGUI 3.4.0" \
"https://rgw.ctrl-c.liu.se/openmw/Deps/MyGUI-3.4.0-msvc${MSVC_REAL_YEAR}-win${BITS}.7z" \ "https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/MyGUI-3.4.0-msvc${MSVC_REAL_YEAR}-win${BITS}.7z" \
"MyGUI-3.4.0-msvc${MSVC_REAL_YEAR}-win${BITS}.7z" "MyGUI-3.4.0-msvc${MSVC_REAL_YEAR}-win${BITS}.7z"
if [ -n "$PDBS" ]; then if [ -n "$PDBS" ]; then
download "MyGUI symbols" \ download "MyGUI symbols" \
"https://rgw.ctrl-c.liu.se/openmw/Deps/MyGUI-3.4.0-msvc${MSVC_REAL_YEAR}-win${BITS}-sym.7z" \ "https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/MyGUI-3.4.0-msvc${MSVC_REAL_YEAR}-win${BITS}-sym.7z" \
"MyGUI-3.4.0-msvc${MSVC_REAL_YEAR}-win${BITS}-sym.7z" "MyGUI-3.4.0-msvc${MSVC_REAL_YEAR}-win${BITS}-sym.7z"
fi fi
# OpenAL # OpenAL
download "OpenAL-Soft 1.20.1" \ download "OpenAL-Soft 1.20.1" \
"http://openal-soft.org/openal-binaries/openal-soft-1.20.1-bin.zip" \ "https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/OpenAL-Soft-1.20.1.zip" \
"OpenAL-Soft-1.20.1.zip" "OpenAL-Soft-1.20.1.zip"
# OSG # OSG
download "OpenSceneGraph 3.6.5" \ download "OpenSceneGraph 3.6.5" \
"https://rgw.ctrl-c.liu.se/openmw/Deps/OSG-3.6.5-msvc${MSVC_REAL_YEAR}-win${BITS}.7z" \ "https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/OSG-3.6.5-msvc${MSVC_REAL_YEAR}-win${BITS}.7z" \
"OSG-3.6.5-msvc${MSVC_REAL_YEAR}-win${BITS}.7z" "OSG-3.6.5-msvc${MSVC_REAL_YEAR}-win${BITS}.7z"
if [ -n "$PDBS" ]; then if [ -n "$PDBS" ]; then
download "OpenSceneGraph symbols" \ download "OpenSceneGraph symbols" \
"https://rgw.ctrl-c.liu.se/openmw/Deps/OSG-3.6.5-msvc${MSVC_REAL_YEAR}-win${BITS}-sym.7z" \ "https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/OSG-3.6.5-msvc${MSVC_REAL_YEAR}-win${BITS}-sym.7z" \
"OSG-3.6.5-msvc${MSVC_REAL_YEAR}-win${BITS}-sym.7z" "OSG-3.6.5-msvc${MSVC_REAL_YEAR}-win${BITS}-sym.7z"
fi fi
# SDL2 # SDL2
download "SDL 2.0.12" \ download "SDL 2.0.12" \
"https://www.libsdl.org/release/SDL2-devel-2.0.12-VC.zip" \ "https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/SDL2-2.0.12.zip" \
"SDL2-2.0.12.zip" "SDL2-2.0.12.zip"
# LZ4
download "LZ4 1.9.2" \
"https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/lz4_win${BITS}_v1_9_2.7z" \
"lz4_win${BITS}_v1_9_2.7z"
# Google test and mock # Google test and mock
if [ ! -z $TEST_FRAMEWORK ]; then if [ ! -z $TEST_FRAMEWORK ]; then
echo "Google test 1.10.0..." echo "Google test 1.10.0..."
@ -529,7 +603,7 @@ elif [ -n "$NINJA" ]; then
fi fi
if [ -n "$SINGLE_CONFIG" ]; then if [ -n "$SINGLE_CONFIG" ]; then
BUILD_DIR="${BUILD_DIR}_${BUILD_CONFIG}" BUILD_DIR="${BUILD_DIR}_${CONFIGURATIONS[0]}"
fi fi
if [ -z $KEEP ]; then if [ -z $KEEP ]; then
@ -630,7 +704,9 @@ printf "FFmpeg 4.2.2... "
rm -rf "ffmpeg-4.2.2-win${BITS}-dev" rm -rf "ffmpeg-4.2.2-win${BITS}-dev"
fi fi
export FFMPEG_HOME="$(real_pwd)/FFmpeg" export FFMPEG_HOME="$(real_pwd)/FFmpeg"
add_runtime_dlls "$(pwd)/FFmpeg/bin/"{avcodec-58,avformat-58,avutil-56,swresample-3,swscale-5}.dll for config in ${CONFIGURATIONS[@]}; do
add_runtime_dlls $config "$(pwd)/FFmpeg/bin/"{avcodec-58,avformat-58,avutil-56,swresample-3,swscale-5}.dll
done
if [ $BITS -eq 32 ]; then if [ $BITS -eq 32 ]; then
add_cmake_opts "-DCMAKE_EXE_LINKER_FLAGS=\"/machine:X86 /safeseh:no\"" add_cmake_opts "-DCMAKE_EXE_LINKER_FLAGS=\"/machine:X86 /safeseh:no\""
fi fi
@ -655,14 +731,16 @@ printf "MyGUI 3.4.0... "
mv "MyGUI-3.4.0-msvc${MSVC_REAL_YEAR}-win${BITS}" MyGUI mv "MyGUI-3.4.0-msvc${MSVC_REAL_YEAR}-win${BITS}" MyGUI
fi fi
export MYGUI_HOME="$(real_pwd)/MyGUI" export MYGUI_HOME="$(real_pwd)/MyGUI"
if [ $CONFIGURATION == "Debug" ]; then for CONFIGURATION in ${CONFIGURATIONS[@]}; do
SUFFIX="_d" if [ $CONFIGURATION == "Debug" ]; then
MYGUI_CONFIGURATION="Debug" SUFFIX="_d"
else MYGUI_CONFIGURATION="Debug"
SUFFIX="" else
MYGUI_CONFIGURATION="RelWithDebInfo" SUFFIX=""
fi MYGUI_CONFIGURATION="RelWithDebInfo"
add_runtime_dlls "$(pwd)/MyGUI/bin/${MYGUI_CONFIGURATION}/MyGUIEngine${SUFFIX}.dll" fi
add_runtime_dlls $CONFIGURATION "$(pwd)/MyGUI/bin/${MYGUI_CONFIGURATION}/MyGUIEngine${SUFFIX}.dll"
done
echo Done. echo Done.
} }
cd $DEPS cd $DEPS
@ -679,7 +757,9 @@ printf "OpenAL-Soft 1.20.1... "
OPENAL_SDK="$(real_pwd)/openal-soft-1.20.1-bin" OPENAL_SDK="$(real_pwd)/openal-soft-1.20.1-bin"
add_cmake_opts -DOPENAL_INCLUDE_DIR="${OPENAL_SDK}/include/AL" \ add_cmake_opts -DOPENAL_INCLUDE_DIR="${OPENAL_SDK}/include/AL" \
-DOPENAL_LIBRARY="${OPENAL_SDK}/libs/Win${BITS}/OpenAL32.lib" -DOPENAL_LIBRARY="${OPENAL_SDK}/libs/Win${BITS}/OpenAL32.lib"
add_runtime_dlls "$(pwd)/openal-soft-1.20.1-bin/bin/WIN${BITS}/soft_oal.dll:OpenAL32.dll" for config in ${CONFIGURATIONS[@]}; do
add_runtime_dlls $config "$(pwd)/openal-soft-1.20.1-bin/bin/WIN${BITS}/soft_oal.dll:OpenAL32.dll"
done
echo Done. echo Done.
} }
cd $DEPS cd $DEPS
@ -702,15 +782,17 @@ printf "OSG 3.6.5... "
fi fi
OSG_SDK="$(real_pwd)/OSG" OSG_SDK="$(real_pwd)/OSG"
add_cmake_opts -DOSG_DIR="$OSG_SDK" add_cmake_opts -DOSG_DIR="$OSG_SDK"
if [ $CONFIGURATION == "Debug" ]; then for CONFIGURATION in ${CONFIGURATIONS[@]}; do
SUFFIX="d" if [ $CONFIGURATION == "Debug" ]; then
else SUFFIX="d"
SUFFIX="" else
fi SUFFIX=""
add_runtime_dlls "$(pwd)/OSG/bin/"{OpenThreads,zlib,libpng}${SUFFIX}.dll \ fi
"$(pwd)/OSG/bin/osg"{,Animation,DB,FX,GA,Particle,Text,Util,Viewer,Shadow}${SUFFIX}.dll add_runtime_dlls $CONFIGURATION "$(pwd)/OSG/bin/"{OpenThreads,zlib,libpng}${SUFFIX}.dll \
add_osg_dlls "$(pwd)/OSG/bin/osgPlugins-3.6.5/osgdb_"{bmp,dds,freetype,jpeg,osg,png,tga}${SUFFIX}.dll "$(pwd)/OSG/bin/osg"{,Animation,DB,FX,GA,Particle,Text,Util,Viewer,Shadow}${SUFFIX}.dll
add_osg_dlls "$(pwd)/OSG/bin/osgPlugins-3.6.5/osgdb_serializers_osg"{,animation,fx,ga,particle,text,util,viewer,shadow}${SUFFIX}.dll add_osg_dlls $CONFIGURATION "$(pwd)/OSG/bin/osgPlugins-3.6.5/osgdb_"{bmp,dds,freetype,jpeg,osg,png,tga}${SUFFIX}.dll
add_osg_dlls $CONFIGURATION "$(pwd)/OSG/bin/osgPlugins-3.6.5/osgdb_serializers_osg"{,animation,fx,ga,particle,text,util,viewer,shadow}${SUFFIX}.dll
done
echo Done. echo Done.
} }
cd $DEPS cd $DEPS
@ -782,26 +864,30 @@ fi
cd $QT_SDK cd $QT_SDK
add_cmake_opts -DQT_QMAKE_EXECUTABLE="${QT_SDK}/bin/qmake.exe" \ add_cmake_opts -DQT_QMAKE_EXECUTABLE="${QT_SDK}/bin/qmake.exe" \
-DCMAKE_PREFIX_PATH="$QT_SDK" -DCMAKE_PREFIX_PATH="$QT_SDK"
if [ $CONFIGURATION == "Debug" ]; then for CONFIGURATION in ${CONFIGURATIONS[@]}; do
SUFFIX="d" if [ $CONFIGURATION == "Debug" ]; then
else DLLSUFFIX="d"
SUFFIX="" else
fi DLLSUFFIX=""
add_runtime_dlls "$(pwd)/bin/Qt5"{Core,Gui,Network,OpenGL,Widgets}${SUFFIX}.dll fi
add_qt_platform_dlls "$(pwd)/plugins/platforms/qwindows${SUFFIX}.dll" add_runtime_dlls $CONFIGURATION "$(pwd)/bin/Qt5"{Core,Gui,Network,OpenGL,Widgets}${DLLSUFFIX}.dll
add_qt_platform_dlls $CONFIGURATION "$(pwd)/plugins/platforms/qwindows${DLLSUFFIX}.dll"
done
echo Done. echo Done.
else else
QT_SDK="C:/Qt/5.13/msvc2017${SUFFIX}" QT_SDK="C:/Qt/5.13/msvc2017${SUFFIX}"
add_cmake_opts -DQT_QMAKE_EXECUTABLE="${QT_SDK}/bin/qmake.exe" \ add_cmake_opts -DQT_QMAKE_EXECUTABLE="${QT_SDK}/bin/qmake.exe" \
-DCMAKE_PREFIX_PATH="$QT_SDK" -DCMAKE_PREFIX_PATH="$QT_SDK"
if [ $CONFIGURATION == "Debug" ]; then for CONFIGURATION in ${CONFIGURATIONS[@]}; do
SUFFIX="d" if [ $CONFIGURATION == "Debug" ]; then
else DLLSUFFIX="d"
SUFFIX="" else
fi DLLSUFFIX=""
DIR=$(windowsPathAsUnix "${QT_SDK}") fi
add_runtime_dlls "${DIR}/bin/Qt5"{Core,Gui,Network,OpenGL,Widgets}${SUFFIX}.dll DIR=$(windowsPathAsUnix "${QT_SDK}")
add_qt_platform_dlls "${DIR}/plugins/platforms/qwindows${SUFFIX}.dll" add_runtime_dlls $CONFIGURATION "${DIR}/bin/Qt5"{Core,Gui,Network,OpenGL,Widgets}${DLLSUFFIX}.dll
add_qt_platform_dlls $CONFIGURATION "${DIR}/plugins/platforms/qwindows${DLLSUFFIX}.dll"
done
echo Done. echo Done.
fi fi
} }
@ -817,7 +903,34 @@ printf "SDL 2.0.12... "
eval 7z x -y SDL2-2.0.12.zip $STRIP eval 7z x -y SDL2-2.0.12.zip $STRIP
fi fi
export SDL2DIR="$(real_pwd)/SDL2-2.0.12" export SDL2DIR="$(real_pwd)/SDL2-2.0.12"
add_runtime_dlls "$(pwd)/SDL2-2.0.12/lib/x${ARCHSUFFIX}/SDL2.dll" for config in ${CONFIGURATIONS[@]}; do
add_runtime_dlls $config "$(pwd)/SDL2-2.0.12/lib/x${ARCHSUFFIX}/SDL2.dll"
done
echo Done.
}
cd $DEPS
echo
# LZ4
printf "LZ4 1.9.2... "
{
if [ -d LZ4_1.9.2 ]; then
printf "Exists. "
elif [ -z $SKIP_EXTRACT ]; then
rm -rf LZ4_1.9.2
eval 7z x -y lz4_win${BITS}_v1_9_2.7z -o./LZ4_1.9.2 $STRIP
fi
export LZ4DIR="$(real_pwd)/LZ4_1.9.2"
add_cmake_opts -DLZ4_INCLUDE_DIR="${LZ4DIR}/include" \
-DLZ4_LIBRARY="${LZ4DIR}/lib/liblz4.lib"
for CONFIGURATION in ${CONFIGURATIONS[@]}; do
if [ $CONFIGURATION == "Debug" ]; then
LZ4_CONFIGURATION="Debug"
else
SUFFIX=""
LZ4_CONFIGURATION="Release"
fi
add_runtime_dlls $CONFIGURATION "$(pwd)/LZ4_1.9.2/bin/${LZ4_CONFIGURATION}/liblz4.dll"
done
echo Done. echo Done.
} }
cd $DEPS cd $DEPS
@ -828,41 +941,51 @@ if [ ! -z $TEST_FRAMEWORK ]; then
printf "Google test 1.10.0 ..." printf "Google test 1.10.0 ..."
cd googletest cd googletest
if [ ! -d build ]; then mkdir -p build${MSVC_REAL_YEAR}
mkdir build
fi
cd build cd build${MSVC_REAL_YEAR}
GOOGLE_INSTALL_ROOT="${DEPS_INSTALL}/GoogleTest" GOOGLE_INSTALL_ROOT="${DEPS_INSTALL}/GoogleTest"
if [ $CONFIGURATION == "Debug" ]; then
for CONFIGURATION in ${CONFIGURATIONS[@]}; do
# FindGMock.cmake mentions Release explicitly, but not RelWithDebInfo. Only one optimised library config can be used, so go for the safer one.
GTEST_CONFIG=$([ $CONFIGURATION == "RelWithDebInfo" ] && echo "Release" || echo "$CONFIGURATION" )
if [ $GTEST_CONFIG == "Debug" ]; then
DEBUG_SUFFIX="d" DEBUG_SUFFIX="d"
else else
DEBUG_SUFFIX="" DEBUG_SUFFIX=""
fi fi
if [ ! -d $GOOGLE_INSTALL_ROOT ]; then if [ ! -f "$GOOGLE_INSTALL_ROOT/lib/gtest${DEBUG_SUFFIX}.lib" ]; then
# Always use MSBuild solution files as they don't need the environment activating
cmake .. -DCMAKE_USE_WIN32_THREADS_INIT=1 -G "Visual Studio $MSVC_REAL_VER $MSVC_REAL_YEAR$([ $BITS -eq 64 ] && [ $MSVC_REAL_VER -lt 16 ] && echo " Win64")" $([ $MSVC_REAL_VER -ge 16 ] && echo "-A $([ $BITS -eq 64 ] && echo "x64" || echo "Win32")") -DBUILD_SHARED_LIBS=1
cmake --build . --config "${GTEST_CONFIG}"
cmake --install . --config "${GTEST_CONFIG}" --prefix "${GOOGLE_INSTALL_ROOT}"
fi
cmake .. -DCMAKE_BUILD_TYPE="${CONFIGURATION}" -DCMAKE_INSTALL_PREFIX="${GOOGLE_INSTALL_ROOT}" -DCMAKE_USE_WIN32_THREADS_INIT=1 -G "${GENERATOR}" -DBUILD_SHARED_LIBS=1 add_runtime_dlls $CONFIGURATION "${GOOGLE_INSTALL_ROOT}\bin\gtest_main${DEBUG_SUFFIX}.dll"
cmake --build . --config "${CONFIGURATION}" add_runtime_dlls $CONFIGURATION "${GOOGLE_INSTALL_ROOT}\bin\gtest${DEBUG_SUFFIX}.dll"
cmake --build . --target install --config "${CONFIGURATION}" add_runtime_dlls $CONFIGURATION "${GOOGLE_INSTALL_ROOT}\bin\gmock_main${DEBUG_SUFFIX}.dll"
add_runtime_dlls $CONFIGURATION "${GOOGLE_INSTALL_ROOT}\bin\gmock${DEBUG_SUFFIX}.dll"
add_runtime_dlls "${GOOGLE_INSTALL_ROOT}\bin\gtest_main${DEBUG_SUFFIX}.dll" done
add_runtime_dlls "${GOOGLE_INSTALL_ROOT}\bin\gtest${DEBUG_SUFFIX}.dll"
add_runtime_dlls "${GOOGLE_INSTALL_ROOT}\bin\gmock_main${DEBUG_SUFFIX}.dll"
add_runtime_dlls "${GOOGLE_INSTALL_ROOT}\bin\gmock${DEBUG_SUFFIX}.dll"
fi
add_cmake_opts -DBUILD_UNITTESTS=yes add_cmake_opts -DBUILD_UNITTESTS=yes
# FindGTest and FindGMock do not work perfectly on Windows # FindGTest and FindGMock do not work perfectly on Windows
# but we can help them by telling them everything we know about installation # but we can help them by telling them everything we know about installation
add_cmake_opts -DGMOCK_ROOT="$GOOGLE_INSTALL_ROOT" add_cmake_opts -DGMOCK_ROOT="$GOOGLE_INSTALL_ROOT"
add_cmake_opts -DGTEST_ROOT="$GOOGLE_INSTALL_ROOT" add_cmake_opts -DGTEST_ROOT="$GOOGLE_INSTALL_ROOT"
add_cmake_opts -DGTEST_LIBRARY="$GOOGLE_INSTALL_ROOT/lib/gtest${DEBUG_SUFFIX}.lib" add_cmake_opts -DGTEST_LIBRARY="$GOOGLE_INSTALL_ROOT/lib/gtest.lib"
add_cmake_opts -DGTEST_MAIN_LIBRARY="$GOOGLE_INSTALL_ROOT/lib/gtest_main${DEBUG_SUFFIX}.lib" add_cmake_opts -DGTEST_MAIN_LIBRARY="$GOOGLE_INSTALL_ROOT/lib/gtest_main.lib"
add_cmake_opts -DGMOCK_LIBRARY="$GOOGLE_INSTALL_ROOT/lib/gmock${DEBUG_SUFFIX}.lib" add_cmake_opts -DGMOCK_LIBRARY="$GOOGLE_INSTALL_ROOT/lib/gmock.lib"
add_cmake_opts -DGMOCK_MAIN_LIBRARY="$GOOGLE_INSTALL_ROOT/lib/gmock_main${DEBUG_SUFFIX}.lib" add_cmake_opts -DGMOCK_MAIN_LIBRARY="$GOOGLE_INSTALL_ROOT/lib/gmock_main.lib"
add_cmake_opts -DGTEST_LIBRARY_DEBUG="$GOOGLE_INSTALL_ROOT/lib/gtestd.lib"
add_cmake_opts -DGTEST_MAIN_LIBRARY_DEBUG="$GOOGLE_INSTALL_ROOT/lib/gtest_maind.lib"
add_cmake_opts -DGMOCK_LIBRARY_DEBUG="$GOOGLE_INSTALL_ROOT/lib/gmockd.lib"
add_cmake_opts -DGMOCK_MAIN_LIBRARY_DEBUG="$GOOGLE_INSTALL_ROOT/lib/gmock_maind.lib"
add_cmake_opts -DGTEST_LINKED_AS_SHARED_LIBRARY=True add_cmake_opts -DGTEST_LINKED_AS_SHARED_LIBRARY=True
add_cmake_opts -DGTEST_LIBRARY_TYPE=SHARED
add_cmake_opts -DGTEST_MAIN_LIBRARY_TYPE=SHARED
echo Done. echo Done.
fi fi
@ -926,45 +1049,47 @@ if [ ! -z $CI ]; then
fi fi
# NOTE: Disable this when/if we want to run test cases # NOTE: Disable this when/if we want to run test cases
#if [ -z $CI ]; then #if [ -z $CI ]; then
echo "- Copying Runtime DLLs..." for CONFIGURATION in ${CONFIGURATIONS[@]}; do
DLL_PREFIX="" echo "- Copying Runtime DLLs for $CONFIGURATION..."
if [ -z $SINGLE_CONFIG ]; then DLL_PREFIX=""
mkdir -p $BUILD_CONFIG if [ -z $SINGLE_CONFIG ]; then
DLL_PREFIX="$BUILD_CONFIG/" mkdir -p $CONFIGURATION
fi DLL_PREFIX="$CONFIGURATION/"
for DLL in $RUNTIME_DLLS; do
TARGET="$(basename "$DLL")"
if [[ "$DLL" == *":"* ]]; then
originalIFS="$IFS"
IFS=':'; SPLIT=( ${DLL} ); IFS=$originalIFS
DLL=${SPLIT[0]}
TARGET=${SPLIT[1]}
fi fi
echo " ${TARGET}." for DLL in ${RUNTIME_DLLS[$CONFIGURATION]}; do
cp "$DLL" "${DLL_PREFIX}$TARGET" TARGET="$(basename "$DLL")"
if [[ "$DLL" == *":"* ]]; then
originalIFS="$IFS"
IFS=':'; SPLIT=( ${DLL} ); IFS=$originalIFS
DLL=${SPLIT[0]}
TARGET=${SPLIT[1]}
fi
echo " ${TARGET}."
cp "$DLL" "${DLL_PREFIX}$TARGET"
done
echo
echo "- OSG Plugin DLLs..."
mkdir -p ${DLL_PREFIX}osgPlugins-3.6.5
for DLL in ${OSG_PLUGINS[$CONFIGURATION]}; do
echo " $(basename $DLL)."
cp "$DLL" ${DLL_PREFIX}osgPlugins-3.6.5
done
echo
echo "- Qt Platform DLLs..."
mkdir -p ${DLL_PREFIX}platforms
for DLL in ${QT_PLATFORMS[$CONFIGURATION]}; do
echo " $(basename $DLL)"
cp "$DLL" "${DLL_PREFIX}platforms"
done
echo
done done
echo
echo "- OSG Plugin DLLs..."
mkdir -p ${DLL_PREFIX}osgPlugins-3.6.5
for DLL in $OSG_PLUGINS; do
echo " $(basename $DLL)."
cp "$DLL" ${DLL_PREFIX}osgPlugins-3.6.5
done
echo
echo "- Qt Platform DLLs..."
mkdir -p ${DLL_PREFIX}platforms
for DLL in $QT_PLATFORMS; do
echo " $(basename $DLL)"
cp "$DLL" "${DLL_PREFIX}platforms"
done
echo
#fi #fi
if [ -n "$ACTIVATE_MSVC" ]; then if [ -n "$ACTIVATE_MSVC" ]; then
echo -n "- Activating MSVC in the current shell... " echo -n "- Activating MSVC in the current shell... "
command -v vswhere >/dev/null 2>&1 || { echo "Error: vswhere is not on the path."; wrappedExit 1; } command -v vswhere >/dev/null 2>&1 || { echo "Error: vswhere is not on the path."; wrappedExit 1; }
MSVC_INSTALLATION_PATH=$(vswhere -legacy -products '*' -version "[$MSVC_VER,$(awk "BEGIN { print $MSVC_REAL_VER + 1; exit }"))" -property installationPath) MSVC_INSTALLATION_PATH=$(vswhere -products '*' -version "[$MSVC_REAL_VER,$(awk "BEGIN { print $MSVC_REAL_VER + 1; exit }"))" -property installationPath)
if [ -z "$MSVC_INSTALLATION_PATH" ]; then if [ -z "$MSVC_INSTALLATION_PATH" ]; then
echo "vswhere was unable to find MSVC $MSVC_DISPLAY_YEAR" echo "vswhere was unable to find MSVC $MSVC_DISPLAY_YEAR"
wrappedExit 1 wrappedExit 1

View file

@ -13,14 +13,14 @@ cmake \
-D CMAKE_PREFIX_PATH="$DEPENDENCIES_ROOT;$QT_PATH" \ -D CMAKE_PREFIX_PATH="$DEPENDENCIES_ROOT;$QT_PATH" \
-D CMAKE_C_COMPILER_LAUNCHER="$CCACHE_EXECUTABLE" \ -D CMAKE_C_COMPILER_LAUNCHER="$CCACHE_EXECUTABLE" \
-D CMAKE_CXX_COMPILER_LAUNCHER="$CCACHE_EXECUTABLE" \ -D CMAKE_CXX_COMPILER_LAUNCHER="$CCACHE_EXECUTABLE" \
-D CMAKE_CXX_FLAGS="-std=c++11 -stdlib=libc++" \ -D CMAKE_CXX_FLAGS="-stdlib=libc++" \
-D CMAKE_C_FLAGS_RELEASE="-g -O0" \ -D CMAKE_C_FLAGS_RELEASE="-g -O0" \
-D CMAKE_CXX_FLAGS_RELEASE="-g -O0" \ -D CMAKE_CXX_FLAGS_RELEASE="-g -O0" \
-D CMAKE_OSX_DEPLOYMENT_TARGET="10.9" \ -D CMAKE_OSX_DEPLOYMENT_TARGET="10.12" \
-D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_BUILD_TYPE=RELEASE \
-D OPENMW_OSX_DEPLOYMENT=TRUE \ -D OPENMW_OSX_DEPLOYMENT=TRUE \
-D BUILD_OPENMW=TRUE \ -D BUILD_OPENMW=TRUE \
-D BUILD_OPENCS=FALSE \ -D BUILD_OPENCS=TRUE \
-D BUILD_ESMTOOL=TRUE \ -D BUILD_ESMTOOL=TRUE \
-D BUILD_BSATOOL=TRUE \ -D BUILD_BSATOOL=TRUE \
-D BUILD_ESSIMPORTER=TRUE \ -D BUILD_ESSIMPORTER=TRUE \

View file

@ -1,13 +1,17 @@
#!/bin/sh -e #!/bin/sh -ex
git clone -b release-1.10.0 https://github.com/google/googletest.git git clone -b release-1.10.0 https://github.com/google/googletest.git
cd googletest cd googletest
mkdir build mkdir build
cd build cd build
cmake \ cmake \
-D CMAKE_C_COMPILER="${CC}" \
-D CMAKE_CXX_COMPILER="${CXX}" \
-D CMAKE_C_COMPILER_LAUNCHER=ccache \
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
-D CMAKE_BUILD_TYPE="${CONFIGURATION}" \ -D CMAKE_BUILD_TYPE="${CONFIGURATION}" \
-D CMAKE_INSTALL_PREFIX=. \ -D CMAKE_INSTALL_PREFIX="${GOOGLETEST_DIR}" \
-G "${GENERATOR}" \ -G "${GENERATOR}" \
.. ..
cmake --build . --config "${CONFIGURATION}" cmake --build . --config "${CONFIGURATION}" -- -j $(nproc)
cmake --build . --target install --config "${CONFIGURATION}" cmake --install . --config "${CONFIGURATION}"

View file

@ -1,3 +1,11 @@
project(OpenMW)
cmake_minimum_required(VERSION 3.1.0)
# for link time optimization, remove if cmake version is >= 3.9
if(POLICY CMP0069)
cmake_policy(SET CMP0069 NEW)
endif()
# Apps and tools # Apps and tools
option(BUILD_OPENMW "Build OpenMW" ON) option(BUILD_OPENMW "Build OpenMW" ON)
option(BUILD_LAUNCHER "Build Launcher" ON) option(BUILD_LAUNCHER "Build Launcher" ON)
@ -14,17 +22,14 @@ option(BUILD_WITH_CODE_COVERAGE "Enable code coverage with gconv" OFF)
option(BUILD_UNITTESTS "Enable Unittests with Google C++ Unittest" OFF) option(BUILD_UNITTESTS "Enable Unittests with Google C++ Unittest" OFF)
option(BULLET_USE_DOUBLES "Use double precision for Bullet" OFF) option(BULLET_USE_DOUBLES "Use double precision for Bullet" OFF)
set(OpenGL_GL_PREFERENCE LEGACY) # Use LEGACY as we use GL2; GLNVD is for GL3 and up.
if (NOT BUILD_LAUNCHER AND NOT BUILD_OPENCS AND NOT BUILD_WIZARD) if (NOT BUILD_LAUNCHER AND NOT BUILD_OPENCS AND NOT BUILD_WIZARD)
set(USE_QT FALSE) set(USE_QT FALSE)
else() else()
set(USE_QT TRUE) set(USE_QT TRUE)
endif() endif()
# set the minimum required version across the board
cmake_minimum_required(VERSION 3.1.0)
project(OpenMW)
# If the user doesn't supply a CMAKE_BUILD_TYPE via command line, choose one for them. # If the user doesn't supply a CMAKE_BUILD_TYPE via command line, choose one for them.
IF(NOT CMAKE_BUILD_TYPE) IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
@ -59,7 +64,7 @@ set(OPENMW_VERSION_COMMITDATE "")
set(OPENMW_VERSION "${OPENMW_VERSION_MAJOR}.${OPENMW_VERSION_MINOR}.${OPENMW_VERSION_RELEASE}") set(OPENMW_VERSION "${OPENMW_VERSION_MAJOR}.${OPENMW_VERSION_MINOR}.${OPENMW_VERSION_RELEASE}")
set(OPENMW_DOC_BASEURL "https://openmw.readthedocs.io/en/master/") set(OPENMW_DOC_BASEURL "https://openmw.readthedocs.io/en/stable/")
set(GIT_CHECKOUT FALSE) set(GIT_CHECKOUT FALSE)
if(EXISTS ${PROJECT_SOURCE_DIR}/.git) if(EXISTS ${PROJECT_SOURCE_DIR}/.git)
@ -98,6 +103,7 @@ option(OSG_STATIC "Link static build of OpenSceneGraph into the binaries" FALSE)
option(QT_STATIC "Link static build of QT into the binaries" FALSE) option(QT_STATIC "Link static build of QT into the binaries" FALSE)
option(OPENMW_UNITY_BUILD "Use fewer compilation units to speed up compile time" FALSE) option(OPENMW_UNITY_BUILD "Use fewer compilation units to speed up compile time" FALSE)
option(OPENMW_LTO_BUILD "Build OpenMW with Link-Time Optimization (Needs ~2GB of RAM)" OFF)
# what is necessary to build documentation # what is necessary to build documentation
IF( BUILD_DOCS ) IF( BUILD_DOCS )
@ -111,7 +117,6 @@ option(OPENMW_OSX_DEPLOYMENT OFF)
if (MSVC) if (MSVC)
option(OPENMW_MP_BUILD "Build OpenMW with /MP flag" OFF) option(OPENMW_MP_BUILD "Build OpenMW with /MP flag" OFF)
option(OPENMW_LTO_BUILD "Build OpenMW with Link-Time Optimization (Needs ~2GB of RAM)" OFF)
endif() endif()
# Set up common paths # Set up common paths
@ -148,6 +153,8 @@ endif()
# Dependencies # Dependencies
find_package(OpenGL REQUIRED) find_package(OpenGL REQUIRED)
find_package(LZ4 REQUIRED)
if (USE_QT) if (USE_QT)
find_package(Qt5Core 5.12 REQUIRED) find_package(Qt5Core 5.12 REQUIRED)
find_package(Qt5Widgets REQUIRED) find_package(Qt5Widgets REQUIRED)
@ -388,9 +395,29 @@ if (NOT WIN32 AND NOT APPLE)
endif() endif()
# CXX Compiler settings # CXX Compiler settings
set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD 17)
if(OPENMW_LTO_BUILD)
if(NOT CMAKE_VERSION VERSION_LESS 3.9)
include(CheckIPOSupported)
check_ipo_supported(RESULT HAVE_IPO OUTPUT HAVE_IPO_OUTPUT)
if(HAVE_IPO)
message(STATUS "LTO enabled for Release configuration.")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE)
else()
message(WARNING "Requested option OPENMW_LTO_BUILD not supported by this compiler: ${HAVE_IPO_OUTPUT}")
if(MSVC)
message(STATUS "Note: Flags used to be set manually for this setting with MSVC. We now rely on CMake for this. Upgrade CMake to at least 3.13 to re-enable this setting.")
endif()
endif()
else()
message(WARNING "Requested option OPENMW_LTO_BUILD not supported by this cmake version: ${CMAKE_VERSION}. Upgrade CMake to at least 3.9 to enable support for certain compilers. Newer CMake versions support more compilers.")
endif()
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang) if (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wundef -Wno-unused-parameter -std=c++14 -pedantic -Wno-long-long") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wundef -Wno-unused-parameter -pedantic -Wno-long-long")
add_definitions( -DBOOST_NO_CXX11_SCOPED_ENUMS=ON ) add_definitions( -DBOOST_NO_CXX11_SCOPED_ENUMS=ON )
if (APPLE) if (APPLE)
@ -407,166 +434,14 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
if (CMAKE_CXX_COMPILER_ID STREQUAL GNU AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.6 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.6) if (CMAKE_CXX_COMPILER_ID STREQUAL GNU AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.6 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.6)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-but-set-parameter") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-but-set-parameter")
endif() endif()
elseif (MSVC)
# Enable link-time code generation globally for all linking
if (OPENMW_LTO_BUILD)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GL")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG")
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /LTCG")
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} /LTCG")
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL GNU AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 5.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 5.0)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsuggest-override")
endif()
elseif (MSVC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /FORCE:MULTIPLE") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /FORCE:MULTIPLE")
endif (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang) endif (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
IF(NOT WIN32 AND NOT APPLE)
# Linux installation
# Install binaries
IF(BUILD_OPENMW)
INSTALL(PROGRAMS "${OpenMW_BINARY_DIR}/openmw" DESTINATION "${BINDIR}" )
ENDIF(BUILD_OPENMW)
IF(BUILD_LAUNCHER)
INSTALL(PROGRAMS "${OpenMW_BINARY_DIR}/openmw-launcher" DESTINATION "${BINDIR}" )
ENDIF(BUILD_LAUNCHER)
IF(BUILD_BSATOOL)
INSTALL(PROGRAMS "${OpenMW_BINARY_DIR}/bsatool" DESTINATION "${BINDIR}" )
ENDIF(BUILD_BSATOOL)
IF(BUILD_ESMTOOL)
INSTALL(PROGRAMS "${OpenMW_BINARY_DIR}/esmtool" DESTINATION "${BINDIR}" )
ENDIF(BUILD_ESMTOOL)
IF(BUILD_NIFTEST)
INSTALL(PROGRAMS "${OpenMW_BINARY_DIR}/niftest" DESTINATION "${BINDIR}" )
ENDIF(BUILD_NIFTEST)
IF(BUILD_MWINIIMPORTER)
INSTALL(PROGRAMS "${OpenMW_BINARY_DIR}/openmw-iniimporter" DESTINATION "${BINDIR}" )
ENDIF(BUILD_MWINIIMPORTER)
IF(BUILD_ESSIMPORTER)
INSTALL(PROGRAMS "${OpenMW_BINARY_DIR}/openmw-essimporter" DESTINATION "${BINDIR}" )
ENDIF(BUILD_ESSIMPORTER)
IF(BUILD_OPENCS)
INSTALL(PROGRAMS "${OpenMW_BINARY_DIR}/openmw-cs" DESTINATION "${BINDIR}" )
ENDIF(BUILD_OPENCS)
IF(BUILD_WIZARD)
INSTALL(PROGRAMS "${OpenMW_BINARY_DIR}/openmw-wizard" DESTINATION "${BINDIR}" )
ENDIF(BUILD_WIZARD)
# Install licenses
INSTALL(FILES "files/mygui/DejaVu Font License.txt" DESTINATION "${LICDIR}" )
# Install icon and desktop file
INSTALL(FILES "${OpenMW_BINARY_DIR}/org.openmw.launcher.desktop" DESTINATION "${DATAROOTDIR}/applications" COMPONENT "openmw")
INSTALL(FILES "${OpenMW_SOURCE_DIR}/files/launcher/images/openmw.png" DESTINATION "${ICONDIR}" COMPONENT "openmw")
INSTALL(FILES "${OpenMW_BINARY_DIR}/openmw.appdata.xml" DESTINATION "${DATAROOTDIR}/metainfo" COMPONENT "openmw")
IF(BUILD_OPENCS)
INSTALL(FILES "${OpenMW_BINARY_DIR}/org.openmw.cs.desktop" DESTINATION "${DATAROOTDIR}/applications" COMPONENT "opencs")
INSTALL(FILES "${OpenMW_SOURCE_DIR}/files/opencs/openmw-cs.png" DESTINATION "${ICONDIR}" COMPONENT "opencs")
ENDIF(BUILD_OPENCS)
# Install global configuration files
INSTALL(FILES "${OpenMW_BINARY_DIR}/settings-default.cfg" DESTINATION "${SYSCONFDIR}" COMPONENT "openmw")
INSTALL(FILES "${OpenMW_BINARY_DIR}/openmw.cfg.install" DESTINATION "${SYSCONFDIR}" RENAME "openmw.cfg" COMPONENT "openmw")
INSTALL(FILES "${OpenMW_BINARY_DIR}/resources/version" DESTINATION "${SYSCONFDIR}" COMPONENT "openmw")
INSTALL(FILES "${OpenMW_BINARY_DIR}/gamecontrollerdb.txt" DESTINATION "${SYSCONFDIR}" COMPONENT "openmw")
IF(BUILD_OPENCS)
INSTALL(FILES "${OpenMW_BINARY_DIR}/openmw-cs.cfg" DESTINATION "${SYSCONFDIR}" COMPONENT "opencs")
ENDIF(BUILD_OPENCS)
# Install resources
INSTALL(DIRECTORY "${OpenMW_BINARY_DIR}/resources" DESTINATION "${DATADIR}" COMPONENT "Resources")
INSTALL(DIRECTORY DESTINATION "${DATADIR}/data" COMPONENT "Resources")
ENDIF(NOT WIN32 AND NOT APPLE)
if(WIN32)
FILE(GLOB dll_files_debug "${OpenMW_BINARY_DIR}/Debug/*.dll")
FILE(GLOB dll_files_release "${OpenMW_BINARY_DIR}/Release/*.dll")
INSTALL(FILES ${dll_files_debug} DESTINATION "." CONFIGURATIONS Debug)
INSTALL(FILES ${dll_files_release} DESTINATION "." CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel)
INSTALL(FILES "${OpenMW_BINARY_DIR}/Debug/openmw.cfg.install" DESTINATION "." RENAME "openmw.cfg" CONFIGURATIONS Debug)
INSTALL(FILES "${OpenMW_BINARY_DIR}/Release/openmw.cfg.install" DESTINATION "." RENAME "openmw.cfg" CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel)
INSTALL(FILES "${OpenMW_SOURCE_DIR}/CHANGELOG.md" DESTINATION "." RENAME "CHANGELOG.txt")
INSTALL(FILES "${OpenMW_SOURCE_DIR}/README.md" DESTINATION "." RENAME "README.txt")
INSTALL(FILES "${OpenMW_SOURCE_DIR}/LICENSE" DESTINATION "." RENAME "LICENSE.txt")
INSTALL(FILES
"${OpenMW_SOURCE_DIR}/files/mygui/DejaVu Font License.txt"
DESTINATION ".")
INSTALL(FILES "${OpenMW_BINARY_DIR}/Debug/settings-default.cfg" DESTINATION "." CONFIGURATIONS Debug)
INSTALL(FILES "${OpenMW_BINARY_DIR}/Release/settings-default.cfg" DESTINATION "." CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel)
INSTALL(FILES "${OpenMW_BINARY_DIR}/Debug/gamecontrollerdb.txt" DESTINATION "." CONFIGURATIONS Debug)
INSTALL(FILES "${OpenMW_BINARY_DIR}/Release/gamecontrollerdb.txt" DESTINATION "." CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel)
INSTALL(DIRECTORY "${OpenMW_BINARY_DIR}/Debug/platforms" DESTINATION "." CONFIGURATIONS Debug)
INSTALL(DIRECTORY "${OpenMW_BINARY_DIR}/Release/platforms" DESTINATION "." CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel)
INSTALL(DIRECTORY "${OpenMW_BINARY_DIR}/Debug/resources" DESTINATION "." CONFIGURATIONS Debug)
INSTALL(DIRECTORY "${OpenMW_BINARY_DIR}/Release/resources" DESTINATION "." CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel)
FILE(GLOB plugin_dir_debug "${OpenMW_BINARY_DIR}/Debug/osgPlugins-*")
FILE(GLOB plugin_dir_release "${OpenMW_BINARY_DIR}/Release/osgPlugins-*")
INSTALL(DIRECTORY ${plugin_dir_debug} DESTINATION "." CONFIGURATIONS Debug)
INSTALL(DIRECTORY ${plugin_dir_release} DESTINATION "." CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel)
SET(CPACK_GENERATOR "NSIS")
SET(CPACK_PACKAGE_NAME "OpenMW")
SET(CPACK_PACKAGE_VENDOR "OpenMW.org")
SET(CPACK_PACKAGE_VERSION ${OPENMW_VERSION})
SET(CPACK_PACKAGE_VERSION_MAJOR ${OPENMW_VERSION_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${OPENMW_VERSION_MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${OPENMW_VERSION_RELEASE})
SET(CPACK_PACKAGE_EXECUTABLES "openmw;OpenMW")
IF(BUILD_LAUNCHER)
SET(CPACK_PACKAGE_EXECUTABLES "${CPACK_PACKAGE_EXECUTABLES};openmw-launcher;OpenMW Launcher")
ENDIF(BUILD_LAUNCHER)
IF(BUILD_OPENCS)
SET(CPACK_PACKAGE_EXECUTABLES "${CPACK_PACKAGE_EXECUTABLES};openmw-cs;OpenMW Construction Set")
ENDIF(BUILD_OPENCS)
IF(BUILD_WIZARD)
SET(CPACK_PACKAGE_EXECUTABLES "${CPACK_PACKAGE_EXECUTABLES};openmw-wizard;OpenMW Wizard")
ENDIF(BUILD_WIZARD)
SET(CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut '\$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Readme.lnk' '\$INSTDIR\\\\README.txt'")
SET(CPACK_NSIS_DELETE_ICONS_EXTRA "
!insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\Readme.lnk\\\"
")
SET(CPACK_RESOURCE_FILE_README "${OpenMW_SOURCE_DIR}/README.md")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${OpenMW_SOURCE_DIR}/README.md")
SET(CPACK_NSIS_EXECUTABLES_DIRECTORY ".")
SET(CPACK_NSIS_DISPLAY_NAME "OpenMW ${OPENMW_VERSION}")
SET(CPACK_NSIS_HELP_LINK "https:\\\\\\\\www.openmw.org")
SET(CPACK_NSIS_URL_INFO_ABOUT "https:\\\\\\\\www.openmw.org")
SET(CPACK_NSIS_INSTALLED_ICON_NAME "openmw-launcher.exe")
SET(CPACK_NSIS_MUI_FINISHPAGE_RUN "openmw-launcher.exe")
SET(CPACK_NSIS_MUI_ICON "${OpenMW_SOURCE_DIR}/files/windows/openmw.ico")
SET(CPACK_NSIS_MUI_UNIICON "${OpenMW_SOURCE_DIR}/files/windows/openmw.ico")
SET(CPACK_PACKAGE_ICON "${OpenMW_SOURCE_DIR}\\\\files\\\\openmw.bmp")
SET(VCREDIST32 "${OpenMW_BINARY_DIR}/vcredist_x86.exe")
if(EXISTS ${VCREDIST32})
INSTALL(FILES ${VCREDIST32} DESTINATION "redist")
SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait '\\\"$INSTDIR\\\\redist\\\\vcredist_x86.exe\\\" /q'" )
endif(EXISTS ${VCREDIST32})
SET(VCREDIST64 "${OpenMW_BINARY_DIR}/vcredist_x64.exe")
if(EXISTS ${VCREDIST64})
INSTALL(FILES ${VCREDIST64} DESTINATION "redist")
SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait '\\\"$INSTDIR\\\\redist\\\\vcredist_x64.exe\\\" /q'" )
endif(EXISTS ${VCREDIST64})
SET(OALREDIST "${OpenMW_BINARY_DIR}/oalinst.exe")
if(EXISTS ${OALREDIST})
INSTALL(FILES ${OALREDIST} DESTINATION "redist")
SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}
ExecWait '\\\"$INSTDIR\\\\redist\\\\oalinst.exe\\\" /s'" )
endif(EXISTS ${OALREDIST})
if(CMAKE_CL_64)
SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
endif()
include(CPack)
endif(WIN32)
# Extern # Extern
set(RECASTNAVIGATION_STATIC ON CACHE BOOL "Build recastnavigation static libraries") set(RECASTNAVIGATION_STATIC ON CACHE BOOL "Build recastnavigation static libraries")
@ -735,6 +610,10 @@ if (WIN32)
set_target_properties(components PROPERTIES COMPILE_FLAGS "${WARNINGS} ${MT_BUILD}") set_target_properties(components PROPERTIES COMPILE_FLAGS "${WARNINGS} ${MT_BUILD}")
set_target_properties(osg-ffmpeg-videoplayer PROPERTIES COMPILE_FLAGS "${WARNINGS} ${MT_BUILD}") set_target_properties(osg-ffmpeg-videoplayer PROPERTIES COMPILE_FLAGS "${WARNINGS} ${MT_BUILD}")
if (MSVC_VERSION GREATER_EQUAL 1915 AND MSVC_VERSION LESS 1920)
target_compile_definitions(components INTERFACE _ENABLE_EXTENDED_ALIGNED_STORAGE)
endif()
if (BUILD_BSATOOL) if (BUILD_BSATOOL)
set_target_properties(bsatool PROPERTIES COMPILE_FLAGS "${WARNINGS} ${MT_BUILD}") set_target_properties(bsatool PROPERTIES COMPILE_FLAGS "${WARNINGS} ${MT_BUILD}")
@ -886,7 +765,164 @@ if (OPENMW_OSX_DEPLOYMENT AND APPLE)
fixup_bundle(\"${INSTALLED_OPENCS_APP}\" \"${OPENCS_PLUGINS}\" \"\") fixup_bundle(\"${INSTALLED_OPENCS_APP}\" \"${OPENCS_PLUGINS}\" \"\")
" COMPONENT Runtime) " COMPONENT Runtime)
include(CPack) include(CPack)
endif () elseif(NOT APPLE)
get_generator_is_multi_config(multi_config)
if (multi_config)
SET(INSTALL_SOURCE "${OpenMW_BINARY_DIR}/$<CONFIG>")
else ()
SET(INSTALL_SOURCE "${OpenMW_BINARY_DIR}")
endif ()
if(WIN32)
INSTALL(DIRECTORY "${INSTALL_SOURCE}/" DESTINATION "." FILES_MATCHING PATTERN "*.dll"
PATTERN "deps" EXCLUDE
PATTERN "apps" EXCLUDE
PATTERN "CMakeFiles" EXCLUDE
PATTERN "components" EXCLUDE
PATTERN "docs" EXCLUDE
PATTERN "extern" EXCLUDE
PATTERN "files" EXCLUDE
PATTERN "Testing" EXCLUDE)
INSTALL(DIRECTORY "${INSTALL_SOURCE}/" DESTINATION "." CONFIGURATIONS Debug;RelWithDebInfo FILES_MATCHING PATTERN "*.pdb"
PATTERN "deps" EXCLUDE
PATTERN "apps" EXCLUDE
PATTERN "CMakeFiles" EXCLUDE
PATTERN "components" EXCLUDE
PATTERN "docs" EXCLUDE
PATTERN "extern" EXCLUDE
PATTERN "files" EXCLUDE
PATTERN "Testing" EXCLUDE)
INSTALL(FILES "${INSTALL_SOURCE}/openmw.cfg.install" DESTINATION "." RENAME "openmw.cfg")
INSTALL(FILES "${OpenMW_SOURCE_DIR}/CHANGELOG.md" DESTINATION "." RENAME "CHANGELOG.txt")
INSTALL(FILES "${OpenMW_SOURCE_DIR}/README.md" DESTINATION "." RENAME "README.txt")
INSTALL(FILES "${OpenMW_SOURCE_DIR}/LICENSE" DESTINATION "." RENAME "LICENSE.txt")
INSTALL(FILES "${OpenMW_SOURCE_DIR}/files/mygui/DejaVuFontLicense.txt" DESTINATION ".")
INSTALL(FILES "${INSTALL_SOURCE}/settings-default.cfg" DESTINATION ".")
INSTALL(FILES "${INSTALL_SOURCE}/gamecontrollerdb.txt" DESTINATION ".")
INSTALL(DIRECTORY "${INSTALL_SOURCE}/resources" DESTINATION ".")
SET(CPACK_GENERATOR "NSIS")
SET(CPACK_PACKAGE_NAME "OpenMW")
SET(CPACK_PACKAGE_VENDOR "OpenMW.org")
SET(CPACK_PACKAGE_VERSION ${OPENMW_VERSION})
SET(CPACK_PACKAGE_VERSION_MAJOR ${OPENMW_VERSION_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${OPENMW_VERSION_MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${OPENMW_VERSION_RELEASE})
SET(CPACK_PACKAGE_EXECUTABLES "openmw;OpenMW")
IF(BUILD_LAUNCHER)
SET(CPACK_PACKAGE_EXECUTABLES "${CPACK_PACKAGE_EXECUTABLES};openmw-launcher;OpenMW Launcher")
ENDIF(BUILD_LAUNCHER)
IF(BUILD_OPENCS)
SET(CPACK_PACKAGE_EXECUTABLES "${CPACK_PACKAGE_EXECUTABLES};openmw-cs;OpenMW Construction Set")
ENDIF(BUILD_OPENCS)
IF(BUILD_WIZARD)
SET(CPACK_PACKAGE_EXECUTABLES "${CPACK_PACKAGE_EXECUTABLES};openmw-wizard;OpenMW Wizard")
ENDIF(BUILD_WIZARD)
SET(CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut '\$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Readme.lnk' '\$INSTDIR\\\\README.txt'")
SET(CPACK_NSIS_DELETE_ICONS_EXTRA "
!insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\Readme.lnk\\\"
")
SET(CPACK_RESOURCE_FILE_README "${OpenMW_SOURCE_DIR}/README.md")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${OpenMW_SOURCE_DIR}/README.md")
SET(CPACK_NSIS_EXECUTABLES_DIRECTORY ".")
SET(CPACK_NSIS_DISPLAY_NAME "OpenMW ${OPENMW_VERSION}")
SET(CPACK_NSIS_HELP_LINK "https:\\\\\\\\www.openmw.org")
SET(CPACK_NSIS_URL_INFO_ABOUT "https:\\\\\\\\www.openmw.org")
SET(CPACK_NSIS_INSTALLED_ICON_NAME "openmw-launcher.exe")
SET(CPACK_NSIS_MUI_FINISHPAGE_RUN "openmw-launcher.exe")
SET(CPACK_NSIS_MUI_ICON "${OpenMW_SOURCE_DIR}/files/windows/openmw.ico")
SET(CPACK_NSIS_MUI_UNIICON "${OpenMW_SOURCE_DIR}/files/windows/openmw.ico")
SET(CPACK_PACKAGE_ICON "${OpenMW_SOURCE_DIR}\\\\files\\\\openmw.bmp")
SET(VCREDIST32 "${OpenMW_BINARY_DIR}/vcredist_x86.exe")
if(EXISTS ${VCREDIST32})
INSTALL(FILES ${VCREDIST32} DESTINATION "redist")
SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait '\\\"$INSTDIR\\\\redist\\\\vcredist_x86.exe\\\" /q'" )
endif(EXISTS ${VCREDIST32})
SET(VCREDIST64 "${OpenMW_BINARY_DIR}/vcredist_x64.exe")
if(EXISTS ${VCREDIST64})
INSTALL(FILES ${VCREDIST64} DESTINATION "redist")
SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait '\\\"$INSTDIR\\\\redist\\\\vcredist_x64.exe\\\" /q'" )
endif(EXISTS ${VCREDIST64})
SET(OALREDIST "${OpenMW_BINARY_DIR}/oalinst.exe")
if(EXISTS ${OALREDIST})
INSTALL(FILES ${OALREDIST} DESTINATION "redist")
SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}
ExecWait '\\\"$INSTDIR\\\\redist\\\\oalinst.exe\\\" /s'" )
endif(EXISTS ${OALREDIST})
if(CMAKE_CL_64)
SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
endif()
include(CPack)
else(WIN32)
# Linux installation
# Install binaries
IF(BUILD_OPENMW)
IF(ANDROID)
INSTALL(PROGRAMS "${INSTALL_SOURCE}/libopenmw.so" DESTINATION "${BINDIR}" )
ELSE(ANDROID)
INSTALL(PROGRAMS "${INSTALL_SOURCE}/openmw" DESTINATION "${BINDIR}" )
ENDIF(ANDROID)
ENDIF(BUILD_OPENMW)
IF(BUILD_LAUNCHER)
INSTALL(PROGRAMS "${INSTALL_SOURCE}/openmw-launcher" DESTINATION "${BINDIR}" )
ENDIF(BUILD_LAUNCHER)
IF(BUILD_BSATOOL)
INSTALL(PROGRAMS "${INSTALL_SOURCE}/bsatool" DESTINATION "${BINDIR}" )
ENDIF(BUILD_BSATOOL)
IF(BUILD_ESMTOOL)
INSTALL(PROGRAMS "${INSTALL_SOURCE}/esmtool" DESTINATION "${BINDIR}" )
ENDIF(BUILD_ESMTOOL)
IF(BUILD_NIFTEST)
INSTALL(PROGRAMS "${INSTALL_SOURCE}/niftest" DESTINATION "${BINDIR}" )
ENDIF(BUILD_NIFTEST)
IF(BUILD_MWINIIMPORTER)
INSTALL(PROGRAMS "${INSTALL_SOURCE}/openmw-iniimporter" DESTINATION "${BINDIR}" )
ENDIF(BUILD_MWINIIMPORTER)
IF(BUILD_ESSIMPORTER)
INSTALL(PROGRAMS "${INSTALL_SOURCE}/openmw-essimporter" DESTINATION "${BINDIR}" )
ENDIF(BUILD_ESSIMPORTER)
IF(BUILD_OPENCS)
INSTALL(PROGRAMS "${INSTALL_SOURCE}/openmw-cs" DESTINATION "${BINDIR}" )
ENDIF(BUILD_OPENCS)
IF(BUILD_WIZARD)
INSTALL(PROGRAMS "${INSTALL_SOURCE}/openmw-wizard" DESTINATION "${BINDIR}" )
ENDIF(BUILD_WIZARD)
# Install licenses
INSTALL(FILES "files/mygui/DejaVuFontLicense.txt" DESTINATION "${LICDIR}" )
# Install icon and desktop file
INSTALL(FILES "${OpenMW_BINARY_DIR}/org.openmw.launcher.desktop" DESTINATION "${DATAROOTDIR}/applications" COMPONENT "openmw")
INSTALL(FILES "${OpenMW_SOURCE_DIR}/files/launcher/images/openmw.png" DESTINATION "${ICONDIR}" COMPONENT "openmw")
INSTALL(FILES "${OpenMW_BINARY_DIR}/openmw.appdata.xml" DESTINATION "${DATAROOTDIR}/metainfo" COMPONENT "openmw")
IF(BUILD_OPENCS)
INSTALL(FILES "${OpenMW_BINARY_DIR}/org.openmw.cs.desktop" DESTINATION "${DATAROOTDIR}/applications" COMPONENT "opencs")
INSTALL(FILES "${OpenMW_SOURCE_DIR}/files/opencs/openmw-cs.png" DESTINATION "${ICONDIR}" COMPONENT "opencs")
ENDIF(BUILD_OPENCS)
# Install global configuration files
INSTALL(FILES "${INSTALL_SOURCE}/settings-default.cfg" DESTINATION "${SYSCONFDIR}" COMPONENT "openmw")
INSTALL(FILES "${INSTALL_SOURCE}/openmw.cfg.install" DESTINATION "${SYSCONFDIR}" RENAME "openmw.cfg" COMPONENT "openmw")
INSTALL(FILES "${INSTALL_SOURCE}/resources/version" DESTINATION "${SYSCONFDIR}" COMPONENT "openmw")
INSTALL(FILES "${INSTALL_SOURCE}/gamecontrollerdb.txt" DESTINATION "${SYSCONFDIR}" COMPONENT "openmw")
IF(BUILD_OPENCS)
INSTALL(FILES "${INSTALL_SOURCE}/openmw-cs.cfg" DESTINATION "${SYSCONFDIR}" COMPONENT "opencs")
ENDIF(BUILD_OPENCS)
# Install resources
INSTALL(DIRECTORY "${INSTALL_SOURCE}/resources" DESTINATION "${DATADIR}" COMPONENT "Resources")
INSTALL(DIRECTORY DESTINATION "${DATADIR}/data" COMPONENT "Resources")
endif(WIN32)
endif(OPENMW_OSX_DEPLOYMENT AND APPLE)
# Doxygen Target -- simply run 'make doc' or 'make doc_pages' # Doxygen Target -- simply run 'make doc' or 'make doc_pages'
# output directory for 'make doc' is "${OpenMW_BINARY_DIR}/docs/Doxygen" # output directory for 'make doc' is "${OpenMW_BINARY_DIR}/docs/Doxygen"

View file

@ -13,7 +13,7 @@ OpenMW also comes with OpenMW-CS, a replacement for Bethesda's Construction Set.
* IRC: #openmw on irc.freenode.net * IRC: #openmw on irc.freenode.net
Font Licenses: Font Licenses:
* DejaVuLGCSansMono.ttf: custom (see [files/mygui/DejaVu Font License.txt](https://github.com/OpenMW/openmw/blob/master/files/mygui/DejaVu%20Font%20License.txt) for more information) * DejaVuLGCSansMono.ttf: custom (see [files/mygui/DejaVuFontLicense.txt](https://github.com/OpenMW/openmw/blob/master/files/mygui/DejaVuFontLicense.txt) for more information)
Current Status Current Status
-------------- --------------

View file

@ -4,9 +4,12 @@
#include <components/config/launchersettings.hpp> #include <components/config/launchersettings.hpp>
#include <QFileDialog> #include <QFileDialog>
#include <QCompleter> #include <QCompleter>
#include <QProxyStyle>
#include <components/contentselector/view/contentselector.hpp> #include <components/contentselector/view/contentselector.hpp>
#include <components/contentselector/model/esmfile.hpp> #include <components/contentselector/model/esmfile.hpp>
#include <cmath>
Launcher::AdvancedPage::AdvancedPage(Files::ConfigurationManager &cfg, Launcher::AdvancedPage::AdvancedPage(Files::ConfigurationManager &cfg,
Config::GameSettings &gameSettings, Config::GameSettings &gameSettings,
Settings::Manager &engineSettings, QWidget *parent) Settings::Manager &engineSettings, QWidget *parent)
@ -19,15 +22,15 @@ Launcher::AdvancedPage::AdvancedPage(Files::ConfigurationManager &cfg,
setupUi(this); setupUi(this);
loadSettings(); loadSettings();
mCellNameCompleter.setModel(&mCellNameCompleterModel);
startDefaultCharacterAtField->setCompleter(&mCellNameCompleter);
} }
void Launcher::AdvancedPage::loadCellsForAutocomplete(QStringList cellNames) { void Launcher::AdvancedPage::loadCellsForAutocomplete(QStringList cellNames) {
// Set up an auto-completer for the "Start default character at" field // Update the list of suggestions for the "Start default character at" field
auto *completer = new QCompleter(cellNames); mCellNameCompleterModel.setStringList(cellNames);
completer->setCompletionMode(QCompleter::PopupCompletion); mCellNameCompleter.setCompletionMode(QCompleter::PopupCompletion);
completer->setCaseSensitivity(Qt::CaseSensitivity::CaseInsensitive); mCellNameCompleter.setCaseSensitivity(Qt::CaseSensitivity::CaseInsensitive);
startDefaultCharacterAtField->setCompleter(completer);
} }
void Launcher::AdvancedPage::on_skipMenuCheckBox_stateChanged(int state) { void Launcher::AdvancedPage::on_skipMenuCheckBox_stateChanged(int state) {
@ -55,142 +58,276 @@ void Launcher::AdvancedPage::on_runScriptAfterStartupBrowseButton_clicked()
runScriptAfterStartupField->setText(path); runScriptAfterStartupField->setText(path);
} }
namespace
{
constexpr double CellSizeInUnits = 8192;
double convertToCells(double unitRadius)
{
return std::round((unitRadius / 0.93 + 1024) / CellSizeInUnits);
}
double convertToUnits(double CellGridRadius)
{
return (CellSizeInUnits * CellGridRadius - 1024) * 0.93;
}
}
bool Launcher::AdvancedPage::loadSettings() bool Launcher::AdvancedPage::loadSettings()
{ {
// Testing // Game mechanics
bool skipMenu = mGameSettings.value("skip-menu").toInt() == 1;
if (skipMenu) {
skipMenuCheckBox->setCheckState(Qt::Checked);
}
startDefaultCharacterAtLabel->setEnabled(skipMenu);
startDefaultCharacterAtField->setEnabled(skipMenu);
startDefaultCharacterAtField->setText(mGameSettings.value("start"));
runScriptAfterStartupField->setText(mGameSettings.value("script-run"));
// Game Settings
loadSettingBool(canLootDuringDeathAnimationCheckBox, "can loot during death animation", "Game");
loadSettingBool(followersAttackOnSightCheckBox, "followers attack on sight", "Game");
loadSettingBool(preventMerchantEquippingCheckBox, "prevent merchant equipping", "Game");
loadSettingBool(classicReflectedAbsorbSpellsCheckBox, "classic reflected absorb spells behavior", "Game");
loadSettingBool(rebalanceSoulGemValuesCheckBox, "rebalance soul gem values", "Game");
loadSettingBool(enchantedWeaponsMagicalCheckBox, "enchanted weapons are magical", "Game");
loadSettingBool(permanentBarterDispositionChangeCheckBox, "barter disposition change is permanent", "Game");
int unarmedFactorsStrengthIndex = mEngineSettings.getInt("strength influences hand to hand", "Game");
if (unarmedFactorsStrengthIndex >= 0 && unarmedFactorsStrengthIndex <= 2)
unarmedFactorsStrengthComboBox->setCurrentIndex(unarmedFactorsStrengthIndex);
loadSettingBool(requireAppropriateAmmunitionCheckBox, "only appropriate ammunition bypasses resistance", "Game");
loadSettingBool(magicItemAnimationsCheckBox, "use magic item animations", "Game");
loadSettingBool(normaliseRaceSpeedCheckBox, "normalise race speed", "Game");
connect(animSourcesCheckBox, SIGNAL(toggled(bool)), this, SLOT(slotAnimSourcesToggled(bool)));
loadSettingBool(animSourcesCheckBox, "use additional anim sources", "Game");
if (animSourcesCheckBox->checkState())
{ {
loadSettingBool(weaponSheathingCheckBox, "weapon sheathing", "Game"); loadSettingBool(toggleSneakCheckBox, "toggle sneak", "Input");
loadSettingBool(shieldSheathingCheckBox, "shield sheathing", "Game"); loadSettingBool(canLootDuringDeathAnimationCheckBox, "can loot during death animation", "Game");
loadSettingBool(followersAttackOnSightCheckBox, "followers attack on sight", "Game");
loadSettingBool(rebalanceSoulGemValuesCheckBox, "rebalance soul gem values", "Game");
loadSettingBool(enchantedWeaponsMagicalCheckBox, "enchanted weapons are magical", "Game");
loadSettingBool(permanentBarterDispositionChangeCheckBox, "barter disposition change is permanent", "Game");
loadSettingBool(classicReflectedAbsorbSpellsCheckBox, "classic reflected absorb spells behavior", "Game");
loadSettingBool(requireAppropriateAmmunitionCheckBox, "only appropriate ammunition bypasses resistance", "Game");
loadSettingBool(uncappedDamageFatigueCheckBox, "uncapped damage fatigue", "Game");
loadSettingBool(normaliseRaceSpeedCheckBox, "normalise race speed", "Game");
loadSettingBool(swimUpwardCorrectionCheckBox, "swim upward correction", "Game");
loadSettingBool(avoidCollisionsCheckBox, "NPCs avoid collisions", "Game");
int unarmedFactorsStrengthIndex = mEngineSettings.getInt("strength influences hand to hand", "Game");
if (unarmedFactorsStrengthIndex >= 0 && unarmedFactorsStrengthIndex <= 2)
unarmedFactorsStrengthComboBox->setCurrentIndex(unarmedFactorsStrengthIndex);
loadSettingBool(stealingFromKnockedOutCheckBox, "always allow stealing from knocked out actors", "Game");
loadSettingBool(enableNavigatorCheckBox, "enable", "Navigator");
int numPhysicsThreads = mEngineSettings.getInt("async num threads", "Physics");
if (numPhysicsThreads >= 0)
physicsThreadsSpinBox->setValue(numPhysicsThreads);
} }
loadSettingBool(uncappedDamageFatigueCheckBox, "uncapped damage fatigue", "Game");
loadSettingBool(trainersTrainingSkillsBasedOnBaseSkillCheckBox, "trainers training skills based on base skill", "Game");
// Input Settings // Visuals
loadSettingBool(grabCursorCheckBox, "grab cursor", "Input"); {
loadSettingBool(toggleSneakCheckBox, "toggle sneak", "Input"); loadSettingBool(autoUseObjectNormalMapsCheckBox, "auto use object normal maps", "Shaders");
loadSettingBool(autoUseObjectSpecularMapsCheckBox, "auto use object specular maps", "Shaders");
loadSettingBool(autoUseTerrainNormalMapsCheckBox, "auto use terrain normal maps", "Shaders");
loadSettingBool(autoUseTerrainSpecularMapsCheckBox, "auto use terrain specular maps", "Shaders");
loadSettingBool(bumpMapLocalLightingCheckBox, "apply lighting to environment maps", "Shaders");
loadSettingBool(radialFogCheckBox, "radial fog", "Shaders");
loadSettingBool(magicItemAnimationsCheckBox, "use magic item animations", "Game");
connect(animSourcesCheckBox, SIGNAL(toggled(bool)), this, SLOT(slotAnimSourcesToggled(bool)));
loadSettingBool(animSourcesCheckBox, "use additional anim sources", "Game");
if (animSourcesCheckBox->checkState())
{
loadSettingBool(weaponSheathingCheckBox, "weapon sheathing", "Game");
loadSettingBool(shieldSheathingCheckBox, "shield sheathing", "Game");
}
loadSettingBool(turnToMovementDirectionCheckBox, "turn to movement direction", "Game");
loadSettingBool(smoothMovementCheckBox, "smooth movement", "Game");
// Saves Settings const bool distantTerrain = mEngineSettings.getBool("distant terrain", "Terrain");
loadSettingBool(timePlayedCheckbox, "timeplayed", "Saves"); const bool objectPaging = mEngineSettings.getBool("object paging", "Terrain");
maximumQuicksavesComboBox->setValue(mEngineSettings.getInt("max quicksaves", "Saves")); if (distantTerrain && objectPaging) {
distantLandCheckBox->setCheckState(Qt::Checked);
}
// User Interface Settings loadSettingBool(activeGridObjectPagingCheckBox, "object paging active grid", "Terrain");
loadSettingBool(showEffectDurationCheckBox, "show effect duration", "Game"); viewingDistanceComboBox->setValue(convertToCells(mEngineSettings.getInt("viewing distance", "Camera")));
loadSettingBool(showEnchantChanceCheckBox, "show enchant chance", "Game"); }
loadSettingBool(showMeleeInfoCheckBox, "show melee info", "Game");
loadSettingBool(showProjectileDamageCheckBox, "show projectile damage", "Game");
loadSettingBool(changeDialogTopicsCheckBox, "color topic enable", "GUI");
int showOwnedIndex = mEngineSettings.getInt("show owned", "Game");
// Match the index with the option (only 0, 1, 2, or 3 are valid). Will default to 0 if invalid.
if (showOwnedIndex >= 0 && showOwnedIndex <= 3)
showOwnedComboBox->setCurrentIndex(showOwnedIndex);
// Other Settings // Camera
QString screenshotFormatString = QString::fromStdString(mEngineSettings.getString("screenshot format", "General")).toUpper(); {
if (screenshotFormatComboBox->findText(screenshotFormatString) == -1) loadSettingBool(viewOverShoulderCheckBox, "view over shoulder", "Camera");
screenshotFormatComboBox->addItem(screenshotFormatString); connect(viewOverShoulderCheckBox, SIGNAL(toggled(bool)), this, SLOT(slotViewOverShoulderToggled(bool)));
screenshotFormatComboBox->setCurrentIndex(screenshotFormatComboBox->findText(screenshotFormatString)); viewOverShoulderVerticalLayout->setEnabled(viewOverShoulderCheckBox->checkState());
loadSettingBool(autoSwitchShoulderCheckBox, "auto switch shoulder", "Camera");
loadSettingBool(previewIfStandStillCheckBox, "preview if stand still", "Camera");
loadSettingBool(deferredPreviewRotationCheckBox, "deferred preview rotation", "Camera");
loadSettingBool(headBobbingCheckBox, "head bobbing", "Camera");
defaultShoulderComboBox->setCurrentIndex(
mEngineSettings.getVector2("view over shoulder offset", "Camera").x() >= 0 ? 0 : 1);
}
// Interface Changes
{
loadSettingBool(showEffectDurationCheckBox, "show effect duration", "Game");
loadSettingBool(showEnchantChanceCheckBox, "show enchant chance", "Game");
loadSettingBool(showMeleeInfoCheckBox, "show melee info", "Game");
loadSettingBool(showProjectileDamageCheckBox, "show projectile damage", "Game");
loadSettingBool(changeDialogTopicsCheckBox, "color topic enable", "GUI");
int showOwnedIndex = mEngineSettings.getInt("show owned", "Game");
// Match the index with the option (only 0, 1, 2, or 3 are valid). Will default to 0 if invalid.
if (showOwnedIndex >= 0 && showOwnedIndex <= 3)
showOwnedComboBox->setCurrentIndex(showOwnedIndex);
}
// Bug fixes
{
loadSettingBool(preventMerchantEquippingCheckBox, "prevent merchant equipping", "Game");
loadSettingBool(trainersTrainingSkillsBasedOnBaseSkillCheckBox, "trainers training skills based on base skill", "Game");
}
// Miscellaneous
{
// Saves
loadSettingBool(timePlayedCheckbox, "timeplayed", "Saves");
maximumQuicksavesComboBox->setValue(mEngineSettings.getInt("max quicksaves", "Saves"));
// Other Settings
QString screenshotFormatString = QString::fromStdString(mEngineSettings.getString("screenshot format", "General")).toUpper();
if (screenshotFormatComboBox->findText(screenshotFormatString) == -1)
screenshotFormatComboBox->addItem(screenshotFormatString);
screenshotFormatComboBox->setCurrentIndex(screenshotFormatComboBox->findText(screenshotFormatString));
}
// Testing
{
loadSettingBool(grabCursorCheckBox, "grab cursor", "Input");
bool skipMenu = mGameSettings.value("skip-menu").toInt() == 1;
if (skipMenu)
{
skipMenuCheckBox->setCheckState(Qt::Checked);
}
startDefaultCharacterAtLabel->setEnabled(skipMenu);
startDefaultCharacterAtField->setEnabled(skipMenu);
startDefaultCharacterAtField->setText(mGameSettings.value("start"));
runScriptAfterStartupField->setText(mGameSettings.value("script-run"));
}
return true; return true;
} }
void Launcher::AdvancedPage::saveSettings() void Launcher::AdvancedPage::saveSettings()
{ {
// Ensure we only set the new settings if they changed. This is to avoid cluttering the // Game mechanics
// user settings file (which by definition should only contain settings the user has touched) {
saveSettingBool(toggleSneakCheckBox, "toggle sneak", "Input");
saveSettingBool(canLootDuringDeathAnimationCheckBox, "can loot during death animation", "Game");
saveSettingBool(followersAttackOnSightCheckBox, "followers attack on sight", "Game");
saveSettingBool(rebalanceSoulGemValuesCheckBox, "rebalance soul gem values", "Game");
saveSettingBool(enchantedWeaponsMagicalCheckBox, "enchanted weapons are magical", "Game");
saveSettingBool(permanentBarterDispositionChangeCheckBox, "barter disposition change is permanent", "Game");
saveSettingBool(classicReflectedAbsorbSpellsCheckBox, "classic reflected absorb spells behavior", "Game");
saveSettingBool(requireAppropriateAmmunitionCheckBox, "only appropriate ammunition bypasses resistance", "Game");
saveSettingBool(uncappedDamageFatigueCheckBox, "uncapped damage fatigue", "Game");
saveSettingBool(normaliseRaceSpeedCheckBox, "normalise race speed", "Game");
saveSettingBool(swimUpwardCorrectionCheckBox, "swim upward correction", "Game");
saveSettingBool(avoidCollisionsCheckBox, "NPCs avoid collisions", "Game");
int unarmedFactorsStrengthIndex = unarmedFactorsStrengthComboBox->currentIndex();
if (unarmedFactorsStrengthIndex != mEngineSettings.getInt("strength influences hand to hand", "Game"))
mEngineSettings.setInt("strength influences hand to hand", "Game", unarmedFactorsStrengthIndex);
saveSettingBool(stealingFromKnockedOutCheckBox, "always allow stealing from knocked out actors", "Game");
saveSettingBool(enableNavigatorCheckBox, "enable", "Navigator");
int numPhysicsThreads = physicsThreadsSpinBox->value();
if (numPhysicsThreads != mEngineSettings.getInt("async num threads", "Physics"))
mEngineSettings.setInt("async num threads", "Physics", numPhysicsThreads);
}
// Visuals
{
saveSettingBool(autoUseObjectNormalMapsCheckBox, "auto use object normal maps", "Shaders");
saveSettingBool(autoUseObjectSpecularMapsCheckBox, "auto use object specular maps", "Shaders");
saveSettingBool(autoUseTerrainNormalMapsCheckBox, "auto use terrain normal maps", "Shaders");
saveSettingBool(autoUseTerrainSpecularMapsCheckBox, "auto use terrain specular maps", "Shaders");
saveSettingBool(bumpMapLocalLightingCheckBox, "apply lighting to environment maps", "Shaders");
saveSettingBool(radialFogCheckBox, "radial fog", "Shaders");
saveSettingBool(magicItemAnimationsCheckBox, "use magic item animations", "Game");
saveSettingBool(animSourcesCheckBox, "use additional anim sources", "Game");
saveSettingBool(weaponSheathingCheckBox, "weapon sheathing", "Game");
saveSettingBool(shieldSheathingCheckBox, "shield sheathing", "Game");
saveSettingBool(turnToMovementDirectionCheckBox, "turn to movement direction", "Game");
saveSettingBool(smoothMovementCheckBox, "smooth movement", "Game");
const bool distantTerrain = mEngineSettings.getBool("distant terrain", "Terrain");
const bool objectPaging = mEngineSettings.getBool("object paging", "Terrain");
const bool wantDistantLand = distantLandCheckBox->checkState();
if (wantDistantLand != (distantTerrain && objectPaging)) {
mEngineSettings.setBool("distant terrain", "Terrain", wantDistantLand);
mEngineSettings.setBool("object paging", "Terrain", wantDistantLand);
}
saveSettingBool(activeGridObjectPagingCheckBox, "object paging active grid", "Terrain");
double viewingDistance = viewingDistanceComboBox->value();
if (viewingDistance != convertToCells(mEngineSettings.getInt("viewing distance", "Camera")))
{
mEngineSettings.setInt("viewing distance", "Camera", convertToUnits(viewingDistance));
}
}
// Camera
{
saveSettingBool(viewOverShoulderCheckBox, "view over shoulder", "Camera");
saveSettingBool(autoSwitchShoulderCheckBox, "auto switch shoulder", "Camera");
saveSettingBool(previewIfStandStillCheckBox, "preview if stand still", "Camera");
saveSettingBool(deferredPreviewRotationCheckBox, "deferred preview rotation", "Camera");
saveSettingBool(headBobbingCheckBox, "head bobbing", "Camera");
osg::Vec2f shoulderOffset = mEngineSettings.getVector2("view over shoulder offset", "Camera");
if (defaultShoulderComboBox->currentIndex() != (shoulderOffset.x() >= 0 ? 0 : 1))
{
if (defaultShoulderComboBox->currentIndex() == 0)
shoulderOffset.x() = std::abs(shoulderOffset.x());
else
shoulderOffset.x() = -std::abs(shoulderOffset.x());
mEngineSettings.setVector2("view over shoulder offset", "Camera", shoulderOffset);
}
}
// Interface Changes
{
saveSettingBool(showEffectDurationCheckBox, "show effect duration", "Game");
saveSettingBool(showEnchantChanceCheckBox, "show enchant chance", "Game");
saveSettingBool(showMeleeInfoCheckBox, "show melee info", "Game");
saveSettingBool(showProjectileDamageCheckBox, "show projectile damage", "Game");
saveSettingBool(changeDialogTopicsCheckBox, "color topic enable", "GUI");
int showOwnedCurrentIndex = showOwnedComboBox->currentIndex();
if (showOwnedCurrentIndex != mEngineSettings.getInt("show owned", "Game"))
mEngineSettings.setInt("show owned", "Game", showOwnedCurrentIndex);
}
// Bug fixes
{
saveSettingBool(preventMerchantEquippingCheckBox, "prevent merchant equipping", "Game");
saveSettingBool(trainersTrainingSkillsBasedOnBaseSkillCheckBox, "trainers training skills based on base skill", "Game");
}
// Miscellaneous
{
// Saves Settings
saveSettingBool(timePlayedCheckbox, "timeplayed", "Saves");
int maximumQuicksaves = maximumQuicksavesComboBox->value();
if (maximumQuicksaves != mEngineSettings.getInt("max quicksaves", "Saves"))
{
mEngineSettings.setInt("max quicksaves", "Saves", maximumQuicksaves);
}
// Other Settings
std::string screenshotFormatString = screenshotFormatComboBox->currentText().toLower().toStdString();
if (screenshotFormatString != mEngineSettings.getString("screenshot format", "General"))
mEngineSettings.setString("screenshot format", "General", screenshotFormatString);
}
// Testing // Testing
int skipMenu = skipMenuCheckBox->checkState() == Qt::Checked; {
if (skipMenu != mGameSettings.value("skip-menu").toInt()) saveSettingBool(grabCursorCheckBox, "grab cursor", "Input");
mGameSettings.setValue("skip-menu", QString::number(skipMenu));
QString startCell = startDefaultCharacterAtField->text(); int skipMenu = skipMenuCheckBox->checkState() == Qt::Checked;
if (startCell != mGameSettings.value("start")) { if (skipMenu != mGameSettings.value("skip-menu").toInt())
mGameSettings.setValue("start", startCell); mGameSettings.setValue("skip-menu", QString::number(skipMenu));
QString startCell = startDefaultCharacterAtField->text();
if (startCell != mGameSettings.value("start"))
{
mGameSettings.setValue("start", startCell);
}
QString scriptRun = runScriptAfterStartupField->text();
if (scriptRun != mGameSettings.value("script-run"))
mGameSettings.setValue("script-run", scriptRun);
} }
QString scriptRun = runScriptAfterStartupField->text();
if (scriptRun != mGameSettings.value("script-run"))
mGameSettings.setValue("script-run", scriptRun);
// Game Settings
saveSettingBool(canLootDuringDeathAnimationCheckBox, "can loot during death animation", "Game");
saveSettingBool(followersAttackOnSightCheckBox, "followers attack on sight", "Game");
saveSettingBool(preventMerchantEquippingCheckBox, "prevent merchant equipping", "Game");
saveSettingBool(rebalanceSoulGemValuesCheckBox, "rebalance soul gem values", "Game");
saveSettingBool(classicReflectedAbsorbSpellsCheckBox, "classic reflected absorb spells behavior", "Game");
saveSettingBool(enchantedWeaponsMagicalCheckBox, "enchanted weapons are magical", "Game");
saveSettingBool(permanentBarterDispositionChangeCheckBox, "barter disposition change is permanent", "Game");
int unarmedFactorsStrengthIndex = unarmedFactorsStrengthComboBox->currentIndex();
if (unarmedFactorsStrengthIndex != mEngineSettings.getInt("strength influences hand to hand", "Game"))
mEngineSettings.setInt("strength influences hand to hand", "Game", unarmedFactorsStrengthIndex);
saveSettingBool(requireAppropriateAmmunitionCheckBox, "only appropriate ammunition bypasses resistance", "Game");
saveSettingBool(magicItemAnimationsCheckBox, "use magic item animations", "Game");
saveSettingBool(normaliseRaceSpeedCheckBox, "normalise race speed", "Game");
saveSettingBool(animSourcesCheckBox, "use additional anim sources", "Game");
saveSettingBool(weaponSheathingCheckBox, "weapon sheathing", "Game");
saveSettingBool(shieldSheathingCheckBox, "shield sheathing", "Game");
saveSettingBool(uncappedDamageFatigueCheckBox, "uncapped damage fatigue", "Game");
saveSettingBool(trainersTrainingSkillsBasedOnBaseSkillCheckBox, "trainers training skills based on base skill", "Game");
// Input Settings
saveSettingBool(grabCursorCheckBox, "grab cursor", "Input");
saveSettingBool(toggleSneakCheckBox, "toggle sneak", "Input");
// Saves Settings
saveSettingBool(timePlayedCheckbox, "timeplayed", "Saves");
int maximumQuicksaves = maximumQuicksavesComboBox->value();
if (maximumQuicksaves != mEngineSettings.getInt("max quicksaves", "Saves")) {
mEngineSettings.setInt("max quicksaves", "Saves", maximumQuicksaves);
}
// User Interface Settings
saveSettingBool(showEffectDurationCheckBox, "show effect duration", "Game");
saveSettingBool(showEnchantChanceCheckBox, "show enchant chance", "Game");
saveSettingBool(showMeleeInfoCheckBox, "show melee info", "Game");
saveSettingBool(showProjectileDamageCheckBox, "show projectile damage", "Game");
saveSettingBool(changeDialogTopicsCheckBox, "color topic enable", "GUI");
int showOwnedCurrentIndex = showOwnedComboBox->currentIndex();
if (showOwnedCurrentIndex != mEngineSettings.getInt("show owned", "Game"))
mEngineSettings.setInt("show owned", "Game", showOwnedCurrentIndex);
// Other Settings
std::string screenshotFormatString = screenshotFormatComboBox->currentText().toLower().toStdString();
if (screenshotFormatString != mEngineSettings.getString("screenshot format", "General"))
mEngineSettings.setString("screenshot format", "General", screenshotFormatString);
} }
void Launcher::AdvancedPage::loadSettingBool(QCheckBox *checkbox, const std::string &setting, const std::string &group) { void Launcher::AdvancedPage::loadSettingBool(QCheckBox *checkbox, const std::string &setting, const std::string &group)
{
if (mEngineSettings.getBool(setting, group)) if (mEngineSettings.getBool(setting, group))
checkbox->setCheckState(Qt::Checked); checkbox->setCheckState(Qt::Checked);
} }
void Launcher::AdvancedPage::saveSettingBool(QCheckBox *checkbox, const std::string &setting, const std::string &group) { void Launcher::AdvancedPage::saveSettingBool(QCheckBox *checkbox, const std::string &setting, const std::string &group)
{
bool cValue = checkbox->checkState(); bool cValue = checkbox->checkState();
if (cValue != mEngineSettings.getBool(setting, group)) if (cValue != mEngineSettings.getBool(setting, group))
mEngineSettings.setBool(setting, group, cValue); mEngineSettings.setBool(setting, group, cValue);
@ -211,3 +348,8 @@ void Launcher::AdvancedPage::slotAnimSourcesToggled(bool checked)
shieldSheathingCheckBox->setCheckState(Qt::Unchecked); shieldSheathingCheckBox->setCheckState(Qt::Unchecked);
} }
} }
void Launcher::AdvancedPage::slotViewOverShoulderToggled(bool checked)
{
viewOverShoulderVerticalLayout->setEnabled(viewOverShoulderCheckBox->checkState());
}

View file

@ -2,6 +2,8 @@
#define ADVANCEDPAGE_H #define ADVANCEDPAGE_H
#include <QWidget> #include <QWidget>
#include <QCompleter>
#include <QStringListModel>
#include "ui_advancedpage.h" #include "ui_advancedpage.h"
@ -30,11 +32,14 @@ namespace Launcher
void on_skipMenuCheckBox_stateChanged(int state); void on_skipMenuCheckBox_stateChanged(int state);
void on_runScriptAfterStartupBrowseButton_clicked(); void on_runScriptAfterStartupBrowseButton_clicked();
void slotAnimSourcesToggled(bool checked); void slotAnimSourcesToggled(bool checked);
void slotViewOverShoulderToggled(bool checked);
private: private:
Files::ConfigurationManager &mCfgMgr; Files::ConfigurationManager &mCfgMgr;
Config::GameSettings &mGameSettings; Config::GameSettings &mGameSettings;
Settings::Manager &mEngineSettings; Settings::Manager &mEngineSettings;
QCompleter mCellNameCompleter;
QStringListModel mCellNameCompleterModel;
/** /**
* Load the cells associated with the given content files for use in autocomplete * Load the cells associated with the given content files for use in autocomplete

View file

@ -13,12 +13,13 @@
#include <SDL_video.h> #include <SDL_video.h>
#include <numeric>
#include <components/files/configurationmanager.hpp> #include <components/files/configurationmanager.hpp>
#include <components/misc/gcd.hpp>
QString getAspect(int x, int y) QString getAspect(int x, int y)
{ {
int gcd = Misc::gcd (x, y); int gcd = std::gcd (x, y);
int xaspect = x / gcd; int xaspect = x / gcd;
int yaspect = y / gcd; int yaspect = y / gcd;
// special case: 8 : 5 is usually referred to as 16:10 // special case: 8 : 5 is usually referred to as 16:10
@ -65,16 +66,19 @@ bool Launcher::GraphicsPage::setupSDL()
msgBox.setWindowTitle(tr("Error receiving number of screens")); msgBox.setWindowTitle(tr("Error receiving number of screens"));
msgBox.setIcon(QMessageBox::Critical); msgBox.setIcon(QMessageBox::Critical);
msgBox.setStandardButtons(QMessageBox::Ok); msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.setText(tr("<br><b>SDL_GetNumDisplayModes failed:</b><br><br>") + QString::fromUtf8(SDL_GetError()) + "<br>"); msgBox.setText(tr("<br><b>SDL_GetNumVideoDisplays failed:</b><br><br>") + QString::fromUtf8(SDL_GetError()) + "<br>");
msgBox.exec(); msgBox.exec();
return false; return false;
} }
screenComboBox->clear(); screenComboBox->clear();
mResolutionsPerScreen.clear();
for (int i = 0; i < displays; i++) for (int i = 0; i < displays; i++)
{ {
mResolutionsPerScreen.append(getAvailableResolutions(i));
screenComboBox->addItem(QString(tr("Screen ")) + QString::number(i + 1)); screenComboBox->addItem(QString(tr("Screen ")) + QString::number(i + 1));
} }
screenChanged(0);
// Disconnect from SDL processes // Disconnect from SDL processes
quitSDL(); quitSDL();
@ -331,7 +335,7 @@ void Launcher::GraphicsPage::screenChanged(int screen)
{ {
if (screen >= 0) { if (screen >= 0) {
resolutionComboBox->clear(); resolutionComboBox->clear();
resolutionComboBox->addItems(getAvailableResolutions(screen)); resolutionComboBox->addItems(mResolutionsPerScreen[screen]);
} }
} }

View file

@ -38,6 +38,8 @@ namespace Launcher
Files::ConfigurationManager &mCfgMgr; Files::ConfigurationManager &mCfgMgr;
Settings::Manager &mEngineSettings; Settings::Manager &mEngineSettings;
QVector<QStringList> mResolutionsPerScreen;
static QStringList getAvailableResolutions(int screen); static QStringList getAvailableResolutions(int screen);
static QRect getMaximumResolution(); static QRect getMaximumResolution();

View file

@ -84,7 +84,7 @@ namespace Launcher
inline bool startProgram(const QString &name, bool detached = false) { return startProgram(name, QStringList(), detached); } inline bool startProgram(const QString &name, bool detached = false) { return startProgram(name, QStringList(), detached); }
bool startProgram(const QString &name, const QStringList &arguments, bool detached = false); bool startProgram(const QString &name, const QStringList &arguments, bool detached = false);
void closeEvent(QCloseEvent *event); void closeEvent(QCloseEvent *event) override;
PlayPage *mPlayPage; PlayPage *mPlayPage;
GraphicsPage *mGraphicsPage; GraphicsPage *mGraphicsPage;

View file

@ -27,7 +27,7 @@ public:
LineEdit(QWidget *parent = 0); LineEdit(QWidget *parent = 0);
protected: protected:
void resizeEvent(QResizeEvent *); void resizeEvent(QResizeEvent *) override;
private slots: private slots:
void updateClearButton(const QString &text); void updateClearButton(const QString &text);

View file

@ -21,7 +21,7 @@ namespace Launcher
inline LineEdit *lineEdit() { return mLineEdit; } inline LineEdit *lineEdit() { return mLineEdit; }
void setOkButtonEnabled(bool enabled); void setOkButtonEnabled(bool enabled);
int exec(); int exec() override;
private: private:

View file

@ -233,8 +233,15 @@ target_link_libraries(openmw-cs Qt5::Widgets Qt5::Core Qt5::Network Qt5::OpenGL)
if (WIN32) if (WIN32)
target_link_libraries(openmw-cs ${Boost_LOCALE_LIBRARY}) target_link_libraries(openmw-cs ${Boost_LOCALE_LIBRARY})
INSTALL(TARGETS openmw-cs RUNTIME DESTINATION ".") INSTALL(TARGETS openmw-cs RUNTIME DESTINATION ".")
INSTALL(FILES "${OpenMW_BINARY_DIR}/Debug/openmw-cs.cfg" DESTINATION "." CONFIGURATIONS Debug)
INSTALL(FILES "${OpenMW_BINARY_DIR}/Release/openmw-cs.cfg" DESTINATION "." CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel) get_generator_is_multi_config(multi_config)
if (multi_config)
SET(INSTALL_SOURCE "${OpenMW_BINARY_DIR}/$<CONFIG>")
else ()
SET(INSTALL_SOURCE "${OpenMW_BINARY_DIR}")
endif ()
INSTALL(FILES "${INSTALL_SOURCE}/openmw-cs.cfg" DESTINATION ".")
endif() endif()
if (MSVC) if (MSVC)

View file

@ -22,7 +22,7 @@ class Application : public QApplication
{ {
private: private:
bool notify (QObject *receiver, QEvent *event) bool notify (QObject *receiver, QEvent *event) override
{ {
try try
{ {

View file

@ -37,10 +37,10 @@ namespace CSMDoc
OpenSaveStage (Document& document, SavingState& state, bool projectFile); OpenSaveStage (Document& document, SavingState& state, bool projectFile);
///< \param projectFile Saving the project file instead of the content file. ///< \param projectFile Saving the project file instead of the content file.
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, Messages& messages); void perform (int stage, Messages& messages) override;
///< Messages resulting from this stage will be appended to \a messages. ///< Messages resulting from this stage will be appended to \a messages.
}; };
@ -55,10 +55,10 @@ namespace CSMDoc
WriteHeaderStage (Document& document, SavingState& state, bool simple); WriteHeaderStage (Document& document, SavingState& state, bool simple);
///< \param simple Simplified header (used for project files). ///< \param simple Simplified header (used for project files).
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, Messages& messages); void perform (int stage, Messages& messages) override;
///< Messages resulting from this stage will be appended to \a messages. ///< Messages resulting from this stage will be appended to \a messages.
}; };
@ -75,10 +75,10 @@ namespace CSMDoc
WriteCollectionStage (const CollectionT& collection, SavingState& state, WriteCollectionStage (const CollectionT& collection, SavingState& state,
CSMWorld::Scope scope = CSMWorld::Scope_Content); CSMWorld::Scope scope = CSMWorld::Scope_Content);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, Messages& messages); void perform (int stage, Messages& messages) override;
///< Messages resulting from this stage will be appended to \a messages. ///< Messages resulting from this stage will be appended to \a messages.
}; };
@ -125,10 +125,10 @@ namespace CSMDoc
WriteDialogueCollectionStage (Document& document, SavingState& state, bool journal); WriteDialogueCollectionStage (Document& document, SavingState& state, bool journal);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, Messages& messages); void perform (int stage, Messages& messages) override;
///< Messages resulting from this stage will be appended to \a messages. ///< Messages resulting from this stage will be appended to \a messages.
}; };
@ -142,10 +142,10 @@ namespace CSMDoc
WriteRefIdCollectionStage (Document& document, SavingState& state); WriteRefIdCollectionStage (Document& document, SavingState& state);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, Messages& messages); void perform (int stage, Messages& messages) override;
///< Messages resulting from this stage will be appended to \a messages. ///< Messages resulting from this stage will be appended to \a messages.
}; };
@ -159,10 +159,10 @@ namespace CSMDoc
CollectionReferencesStage (Document& document, SavingState& state); CollectionReferencesStage (Document& document, SavingState& state);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, Messages& messages); void perform (int stage, Messages& messages) override;
///< Messages resulting from this stage will be appended to \a messages. ///< Messages resulting from this stage will be appended to \a messages.
}; };
@ -175,10 +175,10 @@ namespace CSMDoc
WriteCellCollectionStage (Document& document, SavingState& state); WriteCellCollectionStage (Document& document, SavingState& state);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, Messages& messages); void perform (int stage, Messages& messages) override;
///< Messages resulting from this stage will be appended to \a messages. ///< Messages resulting from this stage will be appended to \a messages.
}; };
@ -192,10 +192,10 @@ namespace CSMDoc
WritePathgridCollectionStage (Document& document, SavingState& state); WritePathgridCollectionStage (Document& document, SavingState& state);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, Messages& messages); void perform (int stage, Messages& messages) override;
///< Messages resulting from this stage will be appended to \a messages. ///< Messages resulting from this stage will be appended to \a messages.
}; };
@ -209,10 +209,10 @@ namespace CSMDoc
WriteLandCollectionStage (Document& document, SavingState& state); WriteLandCollectionStage (Document& document, SavingState& state);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, Messages& messages); void perform (int stage, Messages& messages) override;
///< Messages resulting from this stage will be appended to \a messages. ///< Messages resulting from this stage will be appended to \a messages.
}; };
@ -226,10 +226,10 @@ namespace CSMDoc
WriteLandTextureCollectionStage (Document& document, SavingState& state); WriteLandTextureCollectionStage (Document& document, SavingState& state);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, Messages& messages); void perform (int stage, Messages& messages) override;
///< Messages resulting from this stage will be appended to \a messages. ///< Messages resulting from this stage will be appended to \a messages.
}; };
@ -241,10 +241,10 @@ namespace CSMDoc
CloseSaveStage (SavingState& state); CloseSaveStage (SavingState& state);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, Messages& messages); void perform (int stage, Messages& messages) override;
///< Messages resulting from this stage will be appended to \a messages. ///< Messages resulting from this stage will be appended to \a messages.
}; };
@ -257,10 +257,10 @@ namespace CSMDoc
FinalSavingStage (Document& document, SavingState& state); FinalSavingStage (Document& document, SavingState& state);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, Messages& messages); void perform (int stage, Messages& messages) override;
///< Messages resulting from this stage will be appended to \a messages. ///< Messages resulting from this stage will be appended to \a messages.
}; };
} }

View file

@ -11,8 +11,8 @@ namespace CSMFilter
AndNode (const std::vector<std::shared_ptr<Node> >& nodes); AndNode (const std::vector<std::shared_ptr<Node> >& nodes);
virtual bool test (const CSMWorld::IdTableBase& table, int row, bool test (const CSMWorld::IdTableBase& table, int row,
const std::map<int, int>& columns) const; const std::map<int, int>& columns) const override;
///< \return Can the specified table row pass through to filter? ///< \return Can the specified table row pass through to filter?
/// \param columns column ID to column index mapping /// \param columns column ID to column index mapping
}; };

View file

@ -13,12 +13,12 @@ namespace CSMFilter
BooleanNode (bool true_); BooleanNode (bool true_);
virtual bool test (const CSMWorld::IdTableBase& table, int row, bool test (const CSMWorld::IdTableBase& table, int row,
const std::map<int, int>& columns) const; const std::map<int, int>& columns) const override;
///< \return Can the specified table row pass through to filter? ///< \return Can the specified table row pass through to filter?
/// \param columns column ID to column index mapping /// \param columns column ID to column index mapping
virtual std::string toString (bool numericColumns) const; std::string toString (bool numericColumns) const override;
///< Return a string that represents this node. ///< Return a string that represents this node.
/// ///
/// \param numericColumns Use numeric IDs instead of string to represent columns. /// \param numericColumns Use numeric IDs instead of string to represent columns.

View file

@ -11,7 +11,7 @@ namespace CSMFilter
{ {
public: public:
virtual std::vector<int> getReferencedColumns() const; std::vector<int> getReferencedColumns() const override;
///< Return a list of the IDs of the columns referenced by this node. The column mapping ///< Return a list of the IDs of the columns referenced by this node. The column mapping
/// passed into test as columns must contain all columns listed here. /// passed into test as columns must contain all columns listed here.
}; };

View file

@ -21,11 +21,11 @@ namespace CSMFilter
const Node& operator[] (int index) const; const Node& operator[] (int index) const;
virtual std::vector<int> getReferencedColumns() const; std::vector<int> getReferencedColumns() const override;
///< Return a list of the IDs of the columns referenced by this node. The column mapping ///< Return a list of the IDs of the columns referenced by this node. The column mapping
/// passed into test as columns must contain all columns listed here. /// passed into test as columns must contain all columns listed here.
virtual std::string toString (bool numericColumns) const; std::string toString (bool numericColumns) const override;
///< Return a string that represents this node. ///< Return a string that represents this node.
/// ///
/// \param numericColumns Use numeric IDs instead of string to represent columns. /// \param numericColumns Use numeric IDs instead of string to represent columns.

View file

@ -11,8 +11,8 @@ namespace CSMFilter
NotNode (std::shared_ptr<Node> child); NotNode (std::shared_ptr<Node> child);
virtual bool test (const CSMWorld::IdTableBase& table, int row, bool test (const CSMWorld::IdTableBase& table, int row,
const std::map<int, int>& columns) const; const std::map<int, int>& columns) const override;
///< \return Can the specified table row pass through to filter? ///< \return Can the specified table row pass through to filter?
/// \param columns column ID to column index mapping /// \param columns column ID to column index mapping
}; };

View file

@ -11,8 +11,8 @@ namespace CSMFilter
OrNode (const std::vector<std::shared_ptr<Node> >& nodes); OrNode (const std::vector<std::shared_ptr<Node> >& nodes);
virtual bool test (const CSMWorld::IdTableBase& table, int row, bool test (const CSMWorld::IdTableBase& table, int row,
const std::map<int, int>& columns) const; const std::map<int, int>& columns) const override;
///< \return Can the specified table row pass through to filter? ///< \return Can the specified table row pass through to filter?
/// \param columns column ID to column index mapping /// \param columns column ID to column index mapping
}; };

View file

@ -14,16 +14,16 @@ namespace CSMFilter
TextNode (int columnId, const std::string& text); TextNode (int columnId, const std::string& text);
virtual bool test (const CSMWorld::IdTableBase& table, int row, bool test (const CSMWorld::IdTableBase& table, int row,
const std::map<int, int>& columns) const; const std::map<int, int>& columns) const override;
///< \return Can the specified table row pass through to filter? ///< \return Can the specified table row pass through to filter?
/// \param columns column ID to column index mapping /// \param columns column ID to column index mapping
virtual std::vector<int> getReferencedColumns() const; std::vector<int> getReferencedColumns() const override;
///< Return a list of the IDs of the columns referenced by this node. The column mapping ///< Return a list of the IDs of the columns referenced by this node. The column mapping
/// passed into test as columns must contain all columns listed here. /// passed into test as columns must contain all columns listed here.
virtual std::string toString (bool numericColumns) const; std::string toString (bool numericColumns) const override;
///< Return a string that represents this node. ///< Return a string that represents this node.
/// ///
/// \param numericColumns Use numeric IDs instead of string to represent columns. /// \param numericColumns Use numeric IDs instead of string to represent columns.

View file

@ -18,11 +18,11 @@ namespace CSMFilter
Node& getChild(); Node& getChild();
virtual std::vector<int> getReferencedColumns() const; std::vector<int> getReferencedColumns() const override;
///< Return a list of the IDs of the columns referenced by this node. The column mapping ///< Return a list of the IDs of the columns referenced by this node. The column mapping
/// passed into test as columns must contain all columns listed here. /// passed into test as columns must contain all columns listed here.
virtual std::string toString (bool numericColumns) const; std::string toString (bool numericColumns) const override;
///< Return a string that represents this node. ///< Return a string that represents this node.
/// ///
/// \param numericColumns Use numeric IDs instead of string to represent columns. /// \param numericColumns Use numeric IDs instead of string to represent columns.

View file

@ -27,16 +27,16 @@ namespace CSMFilter
ValueNode (int columnId, Type lowerType, Type upperType, double lower, double upper); ValueNode (int columnId, Type lowerType, Type upperType, double lower, double upper);
virtual bool test (const CSMWorld::IdTableBase& table, int row, bool test (const CSMWorld::IdTableBase& table, int row,
const std::map<int, int>& columns) const; const std::map<int, int>& columns) const override;
///< \return Can the specified table row pass through to filter? ///< \return Can the specified table row pass through to filter?
/// \param columns column ID to column index mapping /// \param columns column ID to column index mapping
virtual std::vector<int> getReferencedColumns() const; std::vector<int> getReferencedColumns() const override;
///< Return a list of the IDs of the columns referenced by this node. The column mapping ///< Return a list of the IDs of the columns referenced by this node. The column mapping
/// passed into test as columns must contain all columns listed here. /// passed into test as columns must contain all columns listed here.
virtual std::string toString (bool numericColumns) const; std::string toString (bool numericColumns) const override;
///< Return a string that represents this node. ///< Return a string that represents this node.
/// ///
/// \param numericColumns Use numeric IDs instead of string to represent columns. /// \param numericColumns Use numeric IDs instead of string to represent columns.

View file

@ -23,9 +23,9 @@ namespace CSMPrefs
BoolSetting& setTooltip (const std::string& tooltip); BoolSetting& setTooltip (const std::string& tooltip);
/// Return label, input widget. /// Return label, input widget.
virtual std::pair<QWidget *, QWidget *> makeWidgets (QWidget *parent); std::pair<QWidget *, QWidget *> makeWidgets (QWidget *parent) override;
virtual void updateWidget(); void updateWidget() override;
private slots: private slots:

View file

@ -29,9 +29,9 @@ namespace CSMPrefs
ColourSetting& setTooltip (const std::string& tooltip); ColourSetting& setTooltip (const std::string& tooltip);
/// Return label, input widget. /// Return label, input widget.
virtual std::pair<QWidget *, QWidget *> makeWidgets (QWidget *parent); std::pair<QWidget *, QWidget *> makeWidgets (QWidget *parent) override;
virtual void updateWidget(); void updateWidget() override;
private slots: private slots:

View file

@ -36,9 +36,9 @@ namespace CSMPrefs
DoubleSetting& setTooltip (const std::string& tooltip); DoubleSetting& setTooltip (const std::string& tooltip);
/// Return label, input widget. /// Return label, input widget.
virtual std::pair<QWidget *, QWidget *> makeWidgets (QWidget *parent); std::pair<QWidget *, QWidget *> makeWidgets (QWidget *parent) override;
virtual void updateWidget(); void updateWidget() override;
private slots: private slots:

View file

@ -54,9 +54,9 @@ namespace CSMPrefs
EnumSetting& addValue (const std::string& value, const std::string& tooltip); EnumSetting& addValue (const std::string& value, const std::string& tooltip);
/// Return label, input widget. /// Return label, input widget.
virtual std::pair<QWidget *, QWidget *> makeWidgets (QWidget *parent); std::pair<QWidget *, QWidget *> makeWidgets (QWidget *parent) override;
virtual void updateWidget(); void updateWidget() override;
private slots: private slots:

View file

@ -32,9 +32,9 @@ namespace CSMPrefs
IntSetting& setTooltip (const std::string& tooltip); IntSetting& setTooltip (const std::string& tooltip);
/// Return label, input widget. /// Return label, input widget.
virtual std::pair<QWidget *, QWidget *> makeWidgets (QWidget *parent); std::pair<QWidget *, QWidget *> makeWidgets (QWidget *parent) override;
virtual void updateWidget(); void updateWidget() override;
private slots: private slots:

View file

@ -19,13 +19,13 @@ namespace CSMPrefs
ModifierSetting(Category* parent, Settings::Manager* values, QMutex* mutex, const std::string& key, ModifierSetting(Category* parent, Settings::Manager* values, QMutex* mutex, const std::string& key,
const std::string& label); const std::string& label);
virtual std::pair<QWidget*, QWidget*> makeWidgets(QWidget* parent); std::pair<QWidget*, QWidget*> makeWidgets(QWidget* parent) override;
virtual void updateWidget(); void updateWidget() override;
protected: protected:
bool eventFilter(QObject* target, QEvent* event); bool eventFilter(QObject* target, QEvent* event) override;
private: private:

View file

@ -27,7 +27,7 @@ namespace CSMPrefs
protected: protected:
bool eventFilter(QObject* watched, QEvent* event); bool eventFilter(QObject* watched, QEvent* event) override;
private: private:

View file

@ -19,13 +19,13 @@ namespace CSMPrefs
ShortcutSetting(Category* parent, Settings::Manager* values, QMutex* mutex, const std::string& key, ShortcutSetting(Category* parent, Settings::Manager* values, QMutex* mutex, const std::string& key,
const std::string& label); const std::string& label);
virtual std::pair<QWidget*, QWidget*> makeWidgets(QWidget* parent); std::pair<QWidget*, QWidget*> makeWidgets(QWidget* parent) override;
virtual void updateWidget(); void updateWidget() override;
protected: protected:
bool eventFilter(QObject* target, QEvent* event); bool eventFilter(QObject* target, QEvent* event) override;
private: private:

View file

@ -22,10 +22,10 @@ namespace CSMTools
BirthsignCheckStage (const CSMWorld::IdCollection<ESM::BirthSign> &birthsigns, BirthsignCheckStage (const CSMWorld::IdCollection<ESM::BirthSign> &birthsigns,
const CSMWorld::Resources &textures); const CSMWorld::Resources &textures);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, CSMDoc::Messages& messages); void perform (int stage, CSMDoc::Messages& messages) override;
///< Messages resulting from this tage will be appended to \a messages. ///< Messages resulting from this tage will be appended to \a messages.
}; };
} }

View file

@ -25,10 +25,10 @@ namespace CSMTools
const CSMWorld::Resources &meshes, const CSMWorld::Resources &meshes,
const CSMWorld::IdCollection<ESM::Race> &races ); const CSMWorld::IdCollection<ESM::Race> &races );
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform( int stage, CSMDoc::Messages &messages ); void perform(int stage, CSMDoc::Messages &messages) override;
///< Messages resulting from this tage will be appended to \a messages. ///< Messages resulting from this tage will be appended to \a messages.
}; };
} }

View file

@ -19,10 +19,10 @@ namespace CSMTools
ClassCheckStage (const CSMWorld::IdCollection<ESM::Class>& classes); ClassCheckStage (const CSMWorld::IdCollection<ESM::Class>& classes);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, CSMDoc::Messages& messages); void perform (int stage, CSMDoc::Messages& messages) override;
///< Messages resulting from this tage will be appended to \a messages. ///< Messages resulting from this tage will be appended to \a messages.
}; };
} }

View file

@ -19,10 +19,10 @@ namespace CSMTools
EnchantmentCheckStage (const CSMWorld::IdCollection<ESM::Enchantment>& enchantments); EnchantmentCheckStage (const CSMWorld::IdCollection<ESM::Enchantment>& enchantments);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, CSMDoc::Messages& messages); void perform (int stage, CSMDoc::Messages& messages) override;
///< Messages resulting from this tage will be appended to \a messages. ///< Messages resulting from this tage will be appended to \a messages.
}; };

View file

@ -19,10 +19,10 @@ namespace CSMTools
FactionCheckStage (const CSMWorld::IdCollection<ESM::Faction>& factions); FactionCheckStage (const CSMWorld::IdCollection<ESM::Faction>& factions);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, CSMDoc::Messages& messages); void perform (int stage, CSMDoc::Messages& messages) override;
///< Messages resulting from this tage will be appended to \a messages. ///< Messages resulting from this tage will be appended to \a messages.
}; };
} }

View file

@ -16,10 +16,10 @@ namespace CSMTools
GmstCheckStage(const CSMWorld::IdCollection<ESM::GameSetting>& gameSettings); GmstCheckStage(const CSMWorld::IdCollection<ESM::GameSetting>& gameSettings);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform(int stage, CSMDoc::Messages& messages); void perform(int stage, CSMDoc::Messages& messages) override;
///< Messages resulting from this stage will be appended to \a messages ///< Messages resulting from this stage will be appended to \a messages
private: private:

View file

@ -18,10 +18,10 @@ namespace CSMTools
JournalCheckStage(const CSMWorld::IdCollection<ESM::Dialogue>& journals, JournalCheckStage(const CSMWorld::IdCollection<ESM::Dialogue>& journals,
const CSMWorld::InfoCollection& journalInfos); const CSMWorld::InfoCollection& journalInfos);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform(int stage, CSMDoc::Messages& messages); void perform(int stage, CSMDoc::Messages& messages) override;
///< Messages resulting from this stage will be appended to \a messages ///< Messages resulting from this stage will be appended to \a messages
private: private:

View file

@ -32,9 +32,9 @@ namespace CSMTools
const CSMWorld::Resources &icons, const CSMWorld::Resources &icons,
const CSMWorld::Resources &textures); const CSMWorld::Resources &textures);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, CSMDoc::Messages &messages); void perform (int stage, CSMDoc::Messages &messages) override;
///< Messages resulting from this tage will be appended to \a messages. ///< Messages resulting from this tage will be appended to \a messages.
}; };
} }

View file

@ -27,10 +27,10 @@ namespace CSMTools
MandatoryIdStage (const CSMWorld::CollectionBase& idCollection, const CSMWorld::UniversalId& collectionId, MandatoryIdStage (const CSMWorld::CollectionBase& idCollection, const CSMWorld::UniversalId& collectionId,
const std::vector<std::string>& ids); const std::vector<std::string>& ids);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, CSMDoc::Messages& messages); void perform (int stage, CSMDoc::Messages& messages) override;
///< Messages resulting from this tage will be appended to \a messages. ///< Messages resulting from this tage will be appended to \a messages.
}; };
} }

View file

@ -31,7 +31,7 @@ namespace CSMTools
protected slots: protected slots:
virtual void operationDone(); void operationDone() override;
signals: signals:

View file

@ -22,10 +22,10 @@ namespace CSMTools
StartMergeStage (MergeState& state); StartMergeStage (MergeState& state);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, CSMDoc::Messages& messages); void perform (int stage, CSMDoc::Messages& messages) override;
///< Messages resulting from this stage will be appended to \a messages. ///< Messages resulting from this stage will be appended to \a messages.
}; };
@ -38,10 +38,10 @@ namespace CSMTools
FinishMergedDocumentStage (MergeState& state, ToUTF8::FromType encoding); FinishMergedDocumentStage (MergeState& state, ToUTF8::FromType encoding);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, CSMDoc::Messages& messages); void perform (int stage, CSMDoc::Messages& messages) override;
///< Messages resulting from this stage will be appended to \a messages. ///< Messages resulting from this stage will be appended to \a messages.
}; };
@ -55,10 +55,10 @@ namespace CSMTools
MergeIdCollectionStage (MergeState& state, Collection& (CSMWorld::Data::*accessor)()); MergeIdCollectionStage (MergeState& state, Collection& (CSMWorld::Data::*accessor)());
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, CSMDoc::Messages& messages); void perform (int stage, CSMDoc::Messages& messages) override;
///< Messages resulting from this stage will be appended to \a messages. ///< Messages resulting from this stage will be appended to \a messages.
}; };
@ -93,10 +93,10 @@ namespace CSMTools
MergeRefIdsStage (MergeState& state); MergeRefIdsStage (MergeState& state);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, CSMDoc::Messages& messages); void perform (int stage, CSMDoc::Messages& messages) override;
///< Messages resulting from this stage will be appended to \a messages. ///< Messages resulting from this stage will be appended to \a messages.
}; };
@ -109,10 +109,10 @@ namespace CSMTools
MergeReferencesStage (MergeState& state); MergeReferencesStage (MergeState& state);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, CSMDoc::Messages& messages); void perform (int stage, CSMDoc::Messages& messages) override;
///< Messages resulting from this stage will be appended to \a messages. ///< Messages resulting from this stage will be appended to \a messages.
}; };
@ -125,10 +125,10 @@ namespace CSMTools
PopulateLandTexturesMergeStage (MergeState& state); PopulateLandTexturesMergeStage (MergeState& state);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, CSMDoc::Messages& messages); void perform (int stage, CSMDoc::Messages& messages) override;
///< Messages resulting from this stage will be appended to \a messages. ///< Messages resulting from this stage will be appended to \a messages.
}; };
@ -140,10 +140,10 @@ namespace CSMTools
MergeLandStage (MergeState& state); MergeLandStage (MergeState& state);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, CSMDoc::Messages& messages); void perform (int stage, CSMDoc::Messages& messages) override;
///< Messages resulting from this stage will be appended to \a messages. ///< Messages resulting from this stage will be appended to \a messages.
}; };
@ -157,10 +157,10 @@ namespace CSMTools
FixLandsAndLandTexturesMergeStage (MergeState& state); FixLandsAndLandTexturesMergeStage (MergeState& state);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, CSMDoc::Messages& messages); void perform (int stage, CSMDoc::Messages& messages) override;
///< Messages resulting from this stage will be appended to \a messages. ///< Messages resulting from this stage will be appended to \a messages.
}; };
@ -174,10 +174,10 @@ namespace CSMTools
CleanupLandTexturesMergeStage (MergeState& state); CleanupLandTexturesMergeStage (MergeState& state);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, CSMDoc::Messages& messages); void perform (int stage, CSMDoc::Messages& messages) override;
///< Messages resulting from this stage will be appended to \a messages. ///< Messages resulting from this stage will be appended to \a messages.
}; };
} }

View file

@ -32,9 +32,9 @@ namespace CSMTools
PathgridCheckStage (const CSMWorld::SubCellCollection<CSMWorld::Pathgrid, PathgridCheckStage (const CSMWorld::SubCellCollection<CSMWorld::Pathgrid,
CSMWorld::IdAccessor<CSMWorld::Pathgrid> >& pathgrids); CSMWorld::IdAccessor<CSMWorld::Pathgrid> >& pathgrids);
virtual int setup(); int setup() override;
virtual void perform (int stage, CSMDoc::Messages& messages); void perform (int stage, CSMDoc::Messages& messages) override;
}; };
} }

View file

@ -24,10 +24,10 @@ namespace CSMTools
RaceCheckStage (const CSMWorld::IdCollection<ESM::Race>& races); RaceCheckStage (const CSMWorld::IdCollection<ESM::Race>& races);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, CSMDoc::Messages& messages); void perform (int stage, CSMDoc::Messages& messages) override;
///< Messages resulting from this tage will be appended to \a messages. ///< Messages resulting from this tage will be appended to \a messages.
}; };
} }

View file

@ -22,8 +22,8 @@ namespace CSMTools
const CSMWorld::Resources& icons, const CSMWorld::Resources& icons,
const CSMWorld::IdCollection<ESM::BodyPart>& bodyparts); const CSMWorld::IdCollection<ESM::BodyPart>& bodyparts);
virtual void perform(int stage, CSMDoc::Messages& messages); void perform(int stage, CSMDoc::Messages& messages) override;
virtual int setup(); int setup() override;
private: private:
//CONCRETE CHECKS //CONCRETE CHECKS

View file

@ -14,8 +14,8 @@ namespace CSMTools
const CSMWorld::IdCollection<CSMWorld::Cell>& cells, const CSMWorld::IdCollection<CSMWorld::Cell>& cells,
const CSMWorld::IdCollection<ESM::Faction>& factions); const CSMWorld::IdCollection<ESM::Faction>& factions);
virtual void perform(int stage, CSMDoc::Messages& messages); void perform(int stage, CSMDoc::Messages& messages) override;
virtual int setup(); int setup() override;
private: private:
const CSMWorld::RefCollection& mReferences; const CSMWorld::RefCollection& mReferences;

View file

@ -19,10 +19,10 @@ namespace CSMTools
RegionCheckStage (const CSMWorld::IdCollection<ESM::Region>& regions); RegionCheckStage (const CSMWorld::IdCollection<ESM::Region>& regions);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, CSMDoc::Messages& messages); void perform (int stage, CSMDoc::Messages& messages) override;
///< Messages resulting from this tage will be appended to \a messages. ///< Messages resulting from this tage will be appended to \a messages.
}; };
} }

View file

@ -33,15 +33,15 @@ namespace CSMTools
ReportModel (bool fieldColumn = false, bool severityColumn = true); ReportModel (bool fieldColumn = false, bool severityColumn = true);
virtual int rowCount (const QModelIndex & parent = QModelIndex()) const; int rowCount (const QModelIndex & parent = QModelIndex()) const override;
virtual int columnCount (const QModelIndex & parent = QModelIndex()) const; int columnCount (const QModelIndex & parent = QModelIndex()) const override;
virtual QVariant data (const QModelIndex & index, int role = Qt::DisplayRole) const; QVariant data (const QModelIndex & index, int role = Qt::DisplayRole) const override;
virtual QVariant headerData (int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; QVariant headerData (int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
virtual bool removeRows (int row, int count, const QModelIndex& parent = QModelIndex()); bool removeRows (int row, int count, const QModelIndex& parent = QModelIndex()) override;
void add (const CSMDoc::Message& message); void add (const CSMDoc::Message& message);

View file

@ -36,20 +36,20 @@ namespace CSMTools
CSMDoc::Message::Severity getSeverity (Type type); CSMDoc::Message::Severity getSeverity (Type type);
virtual void report (const std::string& message, const Compiler::TokenLoc& loc, Type type); void report (const std::string& message, const Compiler::TokenLoc& loc, Type type) override;
///< Report error to the user. ///< Report error to the user.
virtual void report (const std::string& message, Type type); void report (const std::string& message, Type type) override;
///< Report a file related error ///< Report a file related error
public: public:
ScriptCheckStage (const CSMDoc::Document& document); ScriptCheckStage (const CSMDoc::Document& document);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, CSMDoc::Messages& messages); void perform (int stage, CSMDoc::Messages& messages) override;
///< Messages resulting from this tage will be appended to \a messages. ///< Messages resulting from this tage will be appended to \a messages.
}; };
} }

View file

@ -24,10 +24,10 @@ namespace CSMTools
SearchStage (const CSMWorld::IdTableBase *model); SearchStage (const CSMWorld::IdTableBase *model);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, CSMDoc::Messages& messages); void perform (int stage, CSMDoc::Messages& messages) override;
///< Messages resulting from this stage will be appended to \a messages. ///< Messages resulting from this stage will be appended to \a messages.
void setOperation (const SearchOperation *operation); void setOperation (const SearchOperation *operation);

View file

@ -19,10 +19,10 @@ namespace CSMTools
SkillCheckStage (const CSMWorld::IdCollection<ESM::Skill>& skills); SkillCheckStage (const CSMWorld::IdCollection<ESM::Skill>& skills);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, CSMDoc::Messages& messages); void perform (int stage, CSMDoc::Messages& messages) override;
///< Messages resulting from this tage will be appended to \a messages. ///< Messages resulting from this tage will be appended to \a messages.
}; };
} }

View file

@ -22,10 +22,10 @@ namespace CSMTools
SoundCheckStage (const CSMWorld::IdCollection<ESM::Sound>& sounds, SoundCheckStage (const CSMWorld::IdCollection<ESM::Sound>& sounds,
const CSMWorld::Resources &soundfiles); const CSMWorld::Resources &soundfiles);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, CSMDoc::Messages& messages); void perform (int stage, CSMDoc::Messages& messages) override;
///< Messages resulting from this tage will be appended to \a messages. ///< Messages resulting from this tage will be appended to \a messages.
}; };
} }

View file

@ -20,10 +20,10 @@ namespace CSMTools
const CSMWorld::IdCollection<ESM::Sound> &sounds, const CSMWorld::IdCollection<ESM::Sound> &sounds,
const CSMWorld::RefIdCollection &objects); const CSMWorld::RefIdCollection &objects);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform(int stage, CSMDoc::Messages &messages); void perform(int stage, CSMDoc::Messages &messages) override;
///< Messages resulting from this stage will be appended to \a messages. ///< Messages resulting from this stage will be appended to \a messages.
}; };
} }

View file

@ -19,10 +19,10 @@ namespace CSMTools
SpellCheckStage (const CSMWorld::IdCollection<ESM::Spell>& spells); SpellCheckStage (const CSMWorld::IdCollection<ESM::Spell>& spells);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform (int stage, CSMDoc::Messages& messages); void perform (int stage, CSMDoc::Messages& messages) override;
///< Messages resulting from this tage will be appended to \a messages. ///< Messages resulting from this tage will be appended to \a messages.
}; };
} }

View file

@ -21,8 +21,8 @@ namespace CSMTools
StartScriptCheckStage (const CSMWorld::IdCollection<ESM::StartScript>& startScripts, StartScriptCheckStage (const CSMWorld::IdCollection<ESM::StartScript>& startScripts,
const CSMWorld::IdCollection<ESM::Script>& scripts); const CSMWorld::IdCollection<ESM::Script>& scripts);
virtual void perform(int stage, CSMDoc::Messages& messages); void perform(int stage, CSMDoc::Messages& messages) override;
virtual int setup(); int setup() override;
}; };
} }

View file

@ -40,10 +40,10 @@ namespace CSMTools
const CSMWorld::RefIdData& referencables, const CSMWorld::RefIdData& referencables,
const CSMWorld::Resources& soundFiles); const CSMWorld::Resources& soundFiles);
virtual int setup(); int setup() override;
///< \return number of steps ///< \return number of steps
virtual void perform(int step, CSMDoc::Messages& messages); void perform(int step, CSMDoc::Messages& messages) override;
///< Messages resulting from this stage will be appended to \a messages ///< Messages resulting from this stage will be appended to \a messages
private: private:

View file

@ -120,19 +120,19 @@ namespace CSMWorld
void add (const ESXRecordT& record); void add (const ESXRecordT& record);
///< Add a new record (modified) ///< Add a new record (modified)
virtual int getSize() const; int getSize() const override;
virtual std::string getId (int index) const; std::string getId (int index) const override;
virtual int getIndex (const std::string& id) const; int getIndex (const std::string& id) const override;
virtual int getColumns() const; int getColumns() const override;
virtual QVariant getData (int index, int column) const; QVariant getData (int index, int column) const override;
virtual void setData (int index, int column, const QVariant& data); void setData (int index, int column, const QVariant& data) override;
virtual const ColumnBase& getColumn (int column) const; const ColumnBase& getColumn (int column) const override;
virtual void merge(); virtual void merge();
///< Merge modified into base. ///< Merge modified into base.
@ -140,43 +140,43 @@ namespace CSMWorld
virtual void purge(); virtual void purge();
///< Remove records that are flagged as erased. ///< Remove records that are flagged as erased.
virtual void removeRows (int index, int count) ; void removeRows (int index, int count) override;
virtual void appendBlankRecord (const std::string& id, void appendBlankRecord (const std::string& id,
UniversalId::Type type = UniversalId::Type_None); UniversalId::Type type = UniversalId::Type_None) override;
///< \param type Will be ignored, unless the collection supports multiple record types ///< \param type Will be ignored, unless the collection supports multiple record types
virtual void cloneRecord(const std::string& origin, void cloneRecord(const std::string& origin,
const std::string& destination, const std::string& destination,
const UniversalId::Type type); const UniversalId::Type type) override;
virtual bool touchRecord(const std::string& id); bool touchRecord(const std::string& id) override;
///< Change the state of a record from base to modified, if it is not already. ///< Change the state of a record from base to modified, if it is not already.
/// \return True if the record was changed. /// \return True if the record was changed.
virtual int searchId (const std::string& id) const; int searchId (const std::string& id) const override;
////< Search record with \a id. ////< Search record with \a id.
/// \return index of record (if found) or -1 (not found) /// \return index of record (if found) or -1 (not found)
virtual void replace (int index, const RecordBase& record); void replace (int index, const RecordBase& record) override;
///< If the record type does not match, an exception is thrown. ///< If the record type does not match, an exception is thrown.
/// ///
/// \attention \a record must not change the ID. /// \attention \a record must not change the ID.
virtual void appendRecord (const RecordBase& record, void appendRecord (const RecordBase& record,
UniversalId::Type type = UniversalId::Type_None); UniversalId::Type type = UniversalId::Type_None) override;
///< If the record type does not match, an exception is thrown. ///< If the record type does not match, an exception is thrown.
///< \param type Will be ignored, unless the collection supports multiple record types ///< \param type Will be ignored, unless the collection supports multiple record types
virtual const Record<ESXRecordT>& getRecord (const std::string& id) const; const Record<ESXRecordT>& getRecord (const std::string& id) const override;
virtual const Record<ESXRecordT>& getRecord (int index) const; const Record<ESXRecordT>& getRecord (int index) const override;
virtual int getAppendIndex (const std::string& id, int getAppendIndex (const std::string& id,
UniversalId::Type type = UniversalId::Type_None) const; UniversalId::Type type = UniversalId::Type_None) const override;
///< \param type Will be ignored, unless the collection supports multiple record types ///< \param type Will be ignored, unless the collection supports multiple record types
virtual std::vector<std::string> getIds (bool listDeleted = true) const; std::vector<std::string> getIds (bool listDeleted = true) const override;
///< Return a sorted collection of all IDs ///< Return a sorted collection of all IDs
/// ///
/// \param listDeleted include deleted record in the list /// \param listDeleted include deleted record in the list
@ -190,7 +190,7 @@ namespace CSMWorld
/// If the index is invalid either generally (by being out of range) or for the particular /// If the index is invalid either generally (by being out of range) or for the particular
/// record, an exception is thrown. /// record, an exception is thrown.
virtual bool reorderRows (int baseIndex, const std::vector<int>& newOrder); bool reorderRows (int baseIndex, const std::vector<int>& newOrder) override;
///< Reorder the rows [baseIndex, baseIndex+newOrder.size()) according to the indices ///< Reorder the rows [baseIndex, baseIndex+newOrder.size()) according to the indices
/// given in \a newOrder (baseIndex+newOrder[0] specifies the new index of row baseIndex). /// given in \a newOrder (baseIndex+newOrder[0] specifies the new index of row baseIndex).
/// ///

View file

@ -211,13 +211,13 @@ namespace CSMWorld
: Column<ESXRecordT> (id, ColumnBase::Display_NestedHeader, flags), mFixedRows(fixedRows) : Column<ESXRecordT> (id, ColumnBase::Display_NestedHeader, flags), mFixedRows(fixedRows)
{} {}
virtual void set (Record<ESXRecordT>& record, const QVariant& data) void set (Record<ESXRecordT>& record, const QVariant& data) override
{ {
// There is nothing to do here. // There is nothing to do here.
// This prevents exceptions from parent's implementation // This prevents exceptions from parent's implementation
} }
virtual QVariant get (const Record<ESXRecordT>& record) const QVariant get (const Record<ESXRecordT>& record) const override
{ {
// by default editable; also see IdTree::hasChildren() // by default editable; also see IdTree::hasChildren()
if (mFixedRows) if (mFixedRows)
@ -226,7 +226,7 @@ namespace CSMWorld
return QVariant::fromValue(ColumnBase::TableEdit_Full); return QVariant::fromValue(ColumnBase::TableEdit_Full);
} }
virtual bool isEditable() const bool isEditable() const override
{ {
return true; return true;
} }
@ -240,7 +240,7 @@ namespace CSMWorld
NestedChildColumn (int id, NestedChildColumn (int id,
Display display, int flags = ColumnBase::Flag_Dialogue, bool isEditable = true); Display display, int flags = ColumnBase::Flag_Dialogue, bool isEditable = true);
virtual bool isEditable() const; bool isEditable() const override;
private: private:
bool mIsEditable; bool mIsEditable;

File diff suppressed because it is too large Load diff

View file

@ -142,9 +142,9 @@ namespace CSMWorld
ModifyCommand (QAbstractItemModel& model, const QModelIndex& index, const QVariant& new_, ModifyCommand (QAbstractItemModel& model, const QModelIndex& index, const QVariant& new_,
QUndoCommand *parent = 0); QUndoCommand *parent = 0);
virtual void redo(); void redo() override;
virtual void undo(); void undo() override;
}; };
class CreateCommand : public QUndoCommand class CreateCommand : public QUndoCommand
@ -175,9 +175,9 @@ namespace CSMWorld
void addNestedValue(int parentColumn, int nestedColumn, const QVariant &value); void addNestedValue(int parentColumn, int nestedColumn, const QVariant &value);
virtual void redo(); void redo() override;
virtual void undo(); void undo() override;
}; };
class CloneCommand : public CreateCommand class CloneCommand : public CreateCommand
@ -191,9 +191,9 @@ namespace CSMWorld
const UniversalId::Type type, const UniversalId::Type type,
QUndoCommand* parent = 0); QUndoCommand* parent = 0);
virtual void redo(); void redo() override;
virtual void undo(); void undo() override;
}; };
class RevertCommand : public QUndoCommand class RevertCommand : public QUndoCommand
@ -212,9 +212,9 @@ namespace CSMWorld
virtual ~RevertCommand(); virtual ~RevertCommand();
virtual void redo(); void redo() override;
virtual void undo(); void undo() override;
}; };
class DeleteCommand : public QUndoCommand class DeleteCommand : public QUndoCommand
@ -235,9 +235,9 @@ namespace CSMWorld
virtual ~DeleteCommand(); virtual ~DeleteCommand();
virtual void redo(); void redo() override;
virtual void undo(); void undo() override;
}; };
class ReorderRowsCommand : public QUndoCommand class ReorderRowsCommand : public QUndoCommand
@ -250,9 +250,9 @@ namespace CSMWorld
ReorderRowsCommand (IdTable& model, int baseIndex, const std::vector<int>& newOrder); ReorderRowsCommand (IdTable& model, int baseIndex, const std::vector<int>& newOrder);
virtual void redo(); void redo() override;
virtual void undo(); void undo() override;
}; };
class CreatePathgridCommand : public CreateCommand class CreatePathgridCommand : public CreateCommand
@ -261,7 +261,7 @@ namespace CSMWorld
CreatePathgridCommand(IdTable& model, const std::string& id, QUndoCommand *parent = 0); CreatePathgridCommand(IdTable& model, const std::string& id, QUndoCommand *parent = 0);
virtual void redo(); void redo() override;
}; };
/// \brief Update cell ID according to x/y-coordinates /// \brief Update cell ID according to x/y-coordinates
@ -281,9 +281,9 @@ namespace CSMWorld
UpdateCellCommand (IdTable& model, int row, QUndoCommand *parent = 0); UpdateCellCommand (IdTable& model, int row, QUndoCommand *parent = 0);
virtual void redo(); void redo() override;
virtual void undo(); void undo() override;
}; };
@ -318,9 +318,9 @@ namespace CSMWorld
DeleteNestedCommand (IdTree& model, const std::string& id, int nestedRow, int parentColumn, QUndoCommand* parent = 0); DeleteNestedCommand (IdTree& model, const std::string& id, int nestedRow, int parentColumn, QUndoCommand* parent = 0);
virtual void redo(); void redo() override;
virtual void undo(); void undo() override;
}; };
class AddNestedCommand : public QUndoCommand, private NestedTableStoring class AddNestedCommand : public QUndoCommand, private NestedTableStoring
@ -340,9 +340,9 @@ namespace CSMWorld
AddNestedCommand(IdTree& model, const std::string& id, int nestedRow, int parentColumn, QUndoCommand* parent = 0); AddNestedCommand(IdTree& model, const std::string& id, int nestedRow, int parentColumn, QUndoCommand* parent = 0);
virtual void redo(); void redo() override;
virtual void undo(); void undo() override;
}; };
} }

View file

@ -31,24 +31,23 @@ namespace CSMWorld
virtual ~IdTable(); virtual ~IdTable();
virtual int rowCount (const QModelIndex & parent = QModelIndex()) const; int rowCount (const QModelIndex & parent = QModelIndex()) const override;
virtual int columnCount (const QModelIndex & parent = QModelIndex()) const; int columnCount (const QModelIndex & parent = QModelIndex()) const override;
virtual QVariant data (const QModelIndex & index, int role = Qt::DisplayRole) const; QVariant data (const QModelIndex & index, int role = Qt::DisplayRole) const override;
virtual QVariant headerData (int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; QVariant headerData (int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
virtual bool setData ( const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); bool setData ( const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
virtual Qt::ItemFlags flags (const QModelIndex & index) const; Qt::ItemFlags flags (const QModelIndex & index) const override;
virtual bool removeRows (int row, int count, const QModelIndex& parent = QModelIndex()); bool removeRows (int row, int count, const QModelIndex& parent = QModelIndex()) override;
virtual QModelIndex index (int row, int column, const QModelIndex& parent = QModelIndex()) QModelIndex index (int row, int column, const QModelIndex& parent = QModelIndex()) const override;
const;
virtual QModelIndex parent (const QModelIndex& index) const; QModelIndex parent (const QModelIndex& index) const override;
void addRecord (const std::string& id, UniversalId::Type type = UniversalId::Type_None); void addRecord (const std::string& id, UniversalId::Type type = UniversalId::Type_None);
///< \param type Will be ignored, unless the collection supports multiple record types ///< \param type Will be ignored, unless the collection supports multiple record types
@ -66,7 +65,7 @@ namespace CSMWorld
std::string getId(int row) const; std::string getId(int row) const;
virtual QModelIndex getModelIndex (const std::string& id, int column) const; QModelIndex getModelIndex (const std::string& id, int column) const override;
void setRecord (const std::string& id, const RecordBase& record, void setRecord (const std::string& id, const RecordBase& record,
UniversalId::Type type = UniversalId::Type_None); UniversalId::Type type = UniversalId::Type_None);
@ -74,10 +73,10 @@ namespace CSMWorld
const RecordBase& getRecord (const std::string& id) const; const RecordBase& getRecord (const std::string& id) const;
virtual int searchColumnIndex (Columns::ColumnId id) const; int searchColumnIndex (Columns::ColumnId id) const override;
///< Return index of column with the given \a id. If no such column exists, -1 is returned. ///< Return index of column with the given \a id. If no such column exists, -1 is returned.
virtual int findColumnIndex (Columns::ColumnId id) const; int findColumnIndex (Columns::ColumnId id) const override;
///< Return index of column with the given \a id. If no such column exists, an exception is ///< Return index of column with the given \a id. If no such column exists, an exception is
/// thrown. /// thrown.
@ -85,14 +84,14 @@ namespace CSMWorld
///< Reorder the rows [baseIndex, baseIndex+newOrder.size()) according to the indices ///< Reorder the rows [baseIndex, baseIndex+newOrder.size()) according to the indices
/// given in \a newOrder (baseIndex+newOrder[0] specifies the new index of row baseIndex). /// given in \a newOrder (baseIndex+newOrder[0] specifies the new index of row baseIndex).
virtual std::pair<UniversalId, std::string> view (int row) const; std::pair<UniversalId, std::string> view (int row) const override;
///< Return the UniversalId and the hint for viewing \a row. If viewing is not ///< Return the UniversalId and the hint for viewing \a row. If viewing is not
/// supported by this table, return (UniversalId::Type_None, ""). /// supported by this table, return (UniversalId::Type_None, "").
/// Is \a id flagged as deleted? /// Is \a id flagged as deleted?
virtual bool isDeleted (const std::string& id) const; bool isDeleted (const std::string& id) const override;
virtual int getColumnId(int column) const; int getColumnId(int column) const override;
protected: protected:

View file

@ -39,7 +39,7 @@ namespace CSMWorld
virtual QModelIndex getModelIndex (const std::string& id, int column) const; virtual QModelIndex getModelIndex (const std::string& id, int column) const;
virtual void setSourceModel(QAbstractItemModel *model); void setSourceModel(QAbstractItemModel *model) override;
void setFilter (const std::shared_ptr<CSMFilter::Node>& filter); void setFilter (const std::shared_ptr<CSMFilter::Node>& filter);
@ -47,9 +47,9 @@ namespace CSMWorld
protected: protected:
virtual bool lessThan(const QModelIndex &left, const QModelIndex &right) const; bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;
virtual bool filterAcceptsRow (int sourceRow, const QModelIndex& sourceParent) const; bool filterAcceptsRow (int sourceRow, const QModelIndex& sourceParent) const override;
QString getRecordId(int sourceRow) const; QString getRecordId(int sourceRow) const;

View file

@ -44,22 +44,21 @@ namespace CSMWorld
virtual ~IdTree(); virtual ~IdTree();
virtual int rowCount (const QModelIndex & parent = QModelIndex()) const; int rowCount (const QModelIndex & parent = QModelIndex()) const override;
virtual int columnCount (const QModelIndex & parent = QModelIndex()) const; int columnCount (const QModelIndex & parent = QModelIndex()) const override;
virtual QVariant data (const QModelIndex & index, int role = Qt::DisplayRole) const; QVariant data (const QModelIndex & index, int role = Qt::DisplayRole) const override;
virtual bool setData ( const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); bool setData ( const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
virtual Qt::ItemFlags flags (const QModelIndex & index) const; Qt::ItemFlags flags (const QModelIndex & index) const override;
virtual bool removeRows (int row, int count, const QModelIndex& parent = QModelIndex()); bool removeRows (int row, int count, const QModelIndex& parent = QModelIndex()) override;
virtual QModelIndex index (int row, int column, const QModelIndex& parent = QModelIndex()) QModelIndex index (int row, int column, const QModelIndex& parent = QModelIndex()) const override;
const;
virtual QModelIndex parent (const QModelIndex& index) const; QModelIndex parent (const QModelIndex& index) const override;
QModelIndex getNestedModelIndex (const std::string& id, int column) const; QModelIndex getNestedModelIndex (const std::string& id, int column) const;
@ -71,7 +70,7 @@ namespace CSMWorld
void addNestedRow (const QModelIndex& parent, int position); void addNestedRow (const QModelIndex& parent, int position);
virtual bool hasChildren (const QModelIndex& index) const; bool hasChildren (const QModelIndex& index) const override;
virtual int searchNestedColumnIndex(int parentColumn, Columns::ColumnId id); virtual int searchNestedColumnIndex(int parentColumn, Columns::ColumnId id);
///< \return the column index or -1 if the requested column wasn't found. ///< \return the column index or -1 if the requested column wasn't found.

View file

@ -29,11 +29,11 @@ namespace CSMWorld
public: public:
virtual int getAppendIndex (const std::string& id, int getAppendIndex (const std::string& id,
UniversalId::Type type = UniversalId::Type_None) const; UniversalId::Type type = UniversalId::Type_None) const override;
///< \param type Will be ignored, unless the collection supports multiple record types ///< \param type Will be ignored, unless the collection supports multiple record types
virtual bool reorderRows (int baseIndex, const std::vector<int>& newOrder); bool reorderRows (int baseIndex, const std::vector<int>& newOrder) override;
///< Reorder the rows [baseIndex, baseIndex+newOrder.size()) according to the indices ///< Reorder the rows [baseIndex, baseIndex+newOrder.size()) according to the indices
/// given in \a newOrder (baseIndex+newOrder[0] specifies the new index of row baseIndex). /// given in \a newOrder (baseIndex+newOrder[0] specifies the new index of row baseIndex).
/// ///

View file

@ -30,15 +30,15 @@ namespace CSMWorld
public: public:
InfoTableProxyModel(UniversalId::Type type, QObject *parent = 0); InfoTableProxyModel(UniversalId::Type type, QObject *parent = 0);
virtual void setSourceModel(QAbstractItemModel *sourceModel); void setSourceModel(QAbstractItemModel *sourceModel) override;
protected: protected:
virtual bool lessThan(const QModelIndex &left, const QModelIndex &right) const; bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;
protected slots: protected slots:
virtual void sourceRowsInserted(const QModelIndex &parent, int start, int end); void sourceRowsInserted(const QModelIndex &parent, int start, int end) override;
virtual void sourceRowsRemoved(const QModelIndex &parent, int start, int end); void sourceRowsRemoved(const QModelIndex &parent, int start, int end) override;
virtual void sourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight); void sourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight) override;
}; };
} }

View file

@ -30,24 +30,24 @@ namespace CSMWorld
public: public:
PathgridPointListAdapter (); PathgridPointListAdapter ();
virtual void addRow(Record<Pathgrid>& record, int position) const; void addRow(Record<Pathgrid>& record, int position) const override;
virtual void removeRow(Record<Pathgrid>& record, int rowToRemove) const; void removeRow(Record<Pathgrid>& record, int rowToRemove) const override;
virtual void setTable(Record<Pathgrid>& record, void setTable(Record<Pathgrid>& record,
const NestedTableWrapperBase& nestedTable) const; const NestedTableWrapperBase& nestedTable) const override;
virtual NestedTableWrapperBase* table(const Record<Pathgrid>& record) const; NestedTableWrapperBase* table(const Record<Pathgrid>& record) const override;
virtual QVariant getData(const Record<Pathgrid>& record, QVariant getData(const Record<Pathgrid>& record,
int subRowIndex, int subColIndex) const; int subRowIndex, int subColIndex) const override;
virtual void setData(Record<Pathgrid>& record, void setData(Record<Pathgrid>& record,
const QVariant& value, int subRowIndex, int subColIndex) const; const QVariant& value, int subRowIndex, int subColIndex) const override;
virtual int getColumnsCount(const Record<Pathgrid>& record) const; int getColumnsCount(const Record<Pathgrid>& record) const override;
virtual int getRowsCount(const Record<Pathgrid>& record) const; int getRowsCount(const Record<Pathgrid>& record) const override;
}; };
class PathgridEdgeListAdapter : public NestedColumnAdapter<Pathgrid> class PathgridEdgeListAdapter : public NestedColumnAdapter<Pathgrid>
@ -55,24 +55,24 @@ namespace CSMWorld
public: public:
PathgridEdgeListAdapter (); PathgridEdgeListAdapter ();
virtual void addRow(Record<Pathgrid>& record, int position) const; void addRow(Record<Pathgrid>& record, int position) const override;
virtual void removeRow(Record<Pathgrid>& record, int rowToRemove) const; void removeRow(Record<Pathgrid>& record, int rowToRemove) const override;
virtual void setTable(Record<Pathgrid>& record, void setTable(Record<Pathgrid>& record,
const NestedTableWrapperBase& nestedTable) const; const NestedTableWrapperBase& nestedTable) const override;
virtual NestedTableWrapperBase* table(const Record<Pathgrid>& record) const; NestedTableWrapperBase* table(const Record<Pathgrid>& record) const override;
virtual QVariant getData(const Record<Pathgrid>& record, QVariant getData(const Record<Pathgrid>& record,
int subRowIndex, int subColIndex) const; int subRowIndex, int subColIndex) const override;
virtual void setData(Record<Pathgrid>& record, void setData(Record<Pathgrid>& record,
const QVariant& value, int subRowIndex, int subColIndex) const; const QVariant& value, int subRowIndex, int subColIndex) const override;
virtual int getColumnsCount(const Record<Pathgrid>& record) const; int getColumnsCount(const Record<Pathgrid>& record) const override;
virtual int getRowsCount(const Record<Pathgrid>& record) const; int getRowsCount(const Record<Pathgrid>& record) const override;
}; };
class FactionReactionsAdapter : public NestedColumnAdapter<ESM::Faction> class FactionReactionsAdapter : public NestedColumnAdapter<ESM::Faction>
@ -80,24 +80,24 @@ namespace CSMWorld
public: public:
FactionReactionsAdapter (); FactionReactionsAdapter ();
virtual void addRow(Record<ESM::Faction>& record, int position) const; void addRow(Record<ESM::Faction>& record, int position) const override;
virtual void removeRow(Record<ESM::Faction>& record, int rowToRemove) const; void removeRow(Record<ESM::Faction>& record, int rowToRemove) const override;
virtual void setTable(Record<ESM::Faction>& record, void setTable(Record<ESM::Faction>& record,
const NestedTableWrapperBase& nestedTable) const; const NestedTableWrapperBase& nestedTable) const override;
virtual NestedTableWrapperBase* table(const Record<ESM::Faction>& record) const; NestedTableWrapperBase* table(const Record<ESM::Faction>& record) const override;
virtual QVariant getData(const Record<ESM::Faction>& record, QVariant getData(const Record<ESM::Faction>& record,
int subRowIndex, int subColIndex) const; int subRowIndex, int subColIndex) const override;
virtual void setData(Record<ESM::Faction>& record, void setData(Record<ESM::Faction>& record,
const QVariant& value, int subRowIndex, int subColIndex) const; const QVariant& value, int subRowIndex, int subColIndex) const override;
virtual int getColumnsCount(const Record<ESM::Faction>& record) const; int getColumnsCount(const Record<ESM::Faction>& record) const override;
virtual int getRowsCount(const Record<ESM::Faction>& record) const; int getRowsCount(const Record<ESM::Faction>& record) const override;
}; };
class FactionRanksAdapter : public NestedColumnAdapter<ESM::Faction> class FactionRanksAdapter : public NestedColumnAdapter<ESM::Faction>
@ -105,24 +105,24 @@ namespace CSMWorld
public: public:
FactionRanksAdapter (); FactionRanksAdapter ();
virtual void addRow(Record<ESM::Faction>& record, int position) const; void addRow(Record<ESM::Faction>& record, int position) const override;
virtual void removeRow(Record<ESM::Faction>& record, int rowToRemove) const; void removeRow(Record<ESM::Faction>& record, int rowToRemove) const override;
virtual void setTable(Record<ESM::Faction>& record, void setTable(Record<ESM::Faction>& record,
const NestedTableWrapperBase& nestedTable) const; const NestedTableWrapperBase& nestedTable) const override;
virtual NestedTableWrapperBase* table(const Record<ESM::Faction>& record) const; NestedTableWrapperBase* table(const Record<ESM::Faction>& record) const override;
virtual QVariant getData(const Record<ESM::Faction>& record, QVariant getData(const Record<ESM::Faction>& record,
int subRowIndex, int subColIndex) const; int subRowIndex, int subColIndex) const override;
virtual void setData(Record<ESM::Faction>& record, void setData(Record<ESM::Faction>& record,
const QVariant& value, int subRowIndex, int subColIndex) const; const QVariant& value, int subRowIndex, int subColIndex) const override;
virtual int getColumnsCount(const Record<ESM::Faction>& record) const; int getColumnsCount(const Record<ESM::Faction>& record) const override;
virtual int getRowsCount(const Record<ESM::Faction>& record) const; int getRowsCount(const Record<ESM::Faction>& record) const override;
}; };
class RegionSoundListAdapter : public NestedColumnAdapter<ESM::Region> class RegionSoundListAdapter : public NestedColumnAdapter<ESM::Region>
@ -130,24 +130,24 @@ namespace CSMWorld
public: public:
RegionSoundListAdapter (); RegionSoundListAdapter ();
virtual void addRow(Record<ESM::Region>& record, int position) const; void addRow(Record<ESM::Region>& record, int position) const override;
virtual void removeRow(Record<ESM::Region>& record, int rowToRemove) const; void removeRow(Record<ESM::Region>& record, int rowToRemove) const override;
virtual void setTable(Record<ESM::Region>& record, void setTable(Record<ESM::Region>& record,
const NestedTableWrapperBase& nestedTable) const; const NestedTableWrapperBase& nestedTable) const override;
virtual NestedTableWrapperBase* table(const Record<ESM::Region>& record) const; NestedTableWrapperBase* table(const Record<ESM::Region>& record) const override;
virtual QVariant getData(const Record<ESM::Region>& record, QVariant getData(const Record<ESM::Region>& record,
int subRowIndex, int subColIndex) const; int subRowIndex, int subColIndex) const override;
virtual void setData(Record<ESM::Region>& record, void setData(Record<ESM::Region>& record,
const QVariant& value, int subRowIndex, int subColIndex) const; const QVariant& value, int subRowIndex, int subColIndex) const override;
virtual int getColumnsCount(const Record<ESM::Region>& record) const; int getColumnsCount(const Record<ESM::Region>& record) const override;
virtual int getRowsCount(const Record<ESM::Region>& record) const; int getRowsCount(const Record<ESM::Region>& record) const override;
}; };
template<typename ESXRecordT> template<typename ESXRecordT>
@ -156,7 +156,7 @@ namespace CSMWorld
public: public:
SpellListAdapter () {} SpellListAdapter () {}
virtual void addRow(Record<ESXRecordT>& record, int position) const void addRow(Record<ESXRecordT>& record, int position) const override
{ {
ESXRecordT raceOrBthSgn = record.get(); ESXRecordT raceOrBthSgn = record.get();
@ -170,7 +170,7 @@ namespace CSMWorld
record.setModified (raceOrBthSgn); record.setModified (raceOrBthSgn);
} }
virtual void removeRow(Record<ESXRecordT>& record, int rowToRemove) const void removeRow(Record<ESXRecordT>& record, int rowToRemove) const override
{ {
ESXRecordT raceOrBthSgn = record.get(); ESXRecordT raceOrBthSgn = record.get();
@ -184,7 +184,7 @@ namespace CSMWorld
record.setModified (raceOrBthSgn); record.setModified (raceOrBthSgn);
} }
virtual void setTable(Record<ESXRecordT>& record, const NestedTableWrapperBase& nestedTable) const void setTable(Record<ESXRecordT>& record, const NestedTableWrapperBase& nestedTable) const override
{ {
ESXRecordT raceOrBthSgn = record.get(); ESXRecordT raceOrBthSgn = record.get();
@ -194,13 +194,13 @@ namespace CSMWorld
record.setModified (raceOrBthSgn); record.setModified (raceOrBthSgn);
} }
virtual NestedTableWrapperBase* table(const Record<ESXRecordT>& record) const NestedTableWrapperBase* table(const Record<ESXRecordT>& record) const override
{ {
// deleted by dtor of NestedTableStoring // deleted by dtor of NestedTableStoring
return new NestedTableWrapper<std::vector<std::string> >(record.get().mPowers.mList); return new NestedTableWrapper<std::vector<std::string> >(record.get().mPowers.mList);
} }
virtual QVariant getData(const Record<ESXRecordT>& record, int subRowIndex, int subColIndex) const QVariant getData(const Record<ESXRecordT>& record, int subRowIndex, int subColIndex) const override
{ {
ESXRecordT raceOrBthSgn = record.get(); ESXRecordT raceOrBthSgn = record.get();
@ -217,8 +217,8 @@ namespace CSMWorld
} }
} }
virtual void setData(Record<ESXRecordT>& record, const QVariant& value, void setData(Record<ESXRecordT>& record, const QVariant& value,
int subRowIndex, int subColIndex) const int subRowIndex, int subColIndex) const override
{ {
ESXRecordT raceOrBthSgn = record.get(); ESXRecordT raceOrBthSgn = record.get();
@ -239,12 +239,12 @@ namespace CSMWorld
record.setModified (raceOrBthSgn); record.setModified (raceOrBthSgn);
} }
virtual int getColumnsCount(const Record<ESXRecordT>& record) const int getColumnsCount(const Record<ESXRecordT>& record) const override
{ {
return 1; return 1;
} }
virtual int getRowsCount(const Record<ESXRecordT>& record) const int getRowsCount(const Record<ESXRecordT>& record) const override
{ {
return static_cast<int>(record.get().mPowers.mList.size()); return static_cast<int>(record.get().mPowers.mList.size());
} }
@ -256,7 +256,7 @@ namespace CSMWorld
public: public:
EffectsListAdapter () {} EffectsListAdapter () {}
virtual void addRow(Record<ESXRecordT>& record, int position) const void addRow(Record<ESXRecordT>& record, int position) const override
{ {
ESXRecordT magic = record.get(); ESXRecordT magic = record.get();
@ -278,7 +278,7 @@ namespace CSMWorld
record.setModified (magic); record.setModified (magic);
} }
virtual void removeRow(Record<ESXRecordT>& record, int rowToRemove) const void removeRow(Record<ESXRecordT>& record, int rowToRemove) const override
{ {
ESXRecordT magic = record.get(); ESXRecordT magic = record.get();
@ -292,7 +292,7 @@ namespace CSMWorld
record.setModified (magic); record.setModified (magic);
} }
virtual void setTable(Record<ESXRecordT>& record, const NestedTableWrapperBase& nestedTable) const void setTable(Record<ESXRecordT>& record, const NestedTableWrapperBase& nestedTable) const override
{ {
ESXRecordT magic = record.get(); ESXRecordT magic = record.get();
@ -302,13 +302,13 @@ namespace CSMWorld
record.setModified (magic); record.setModified (magic);
} }
virtual NestedTableWrapperBase* table(const Record<ESXRecordT>& record) const NestedTableWrapperBase* table(const Record<ESXRecordT>& record) const override
{ {
// deleted by dtor of NestedTableStoring // deleted by dtor of NestedTableStoring
return new NestedTableWrapper<std::vector<ESM::ENAMstruct> >(record.get().mEffects.mList); return new NestedTableWrapper<std::vector<ESM::ENAMstruct> >(record.get().mEffects.mList);
} }
virtual QVariant getData(const Record<ESXRecordT>& record, int subRowIndex, int subColIndex) const QVariant getData(const Record<ESXRecordT>& record, int subRowIndex, int subColIndex) const override
{ {
ESXRecordT magic = record.get(); ESXRecordT magic = record.get();
@ -370,8 +370,8 @@ namespace CSMWorld
} }
} }
virtual void setData(Record<ESXRecordT>& record, const QVariant& value, void setData(Record<ESXRecordT>& record, const QVariant& value,
int subRowIndex, int subColIndex) const int subRowIndex, int subColIndex) const override
{ {
ESXRecordT magic = record.get(); ESXRecordT magic = record.get();
@ -415,12 +415,12 @@ namespace CSMWorld
record.setModified (magic); record.setModified (magic);
} }
virtual int getColumnsCount(const Record<ESXRecordT>& record) const int getColumnsCount(const Record<ESXRecordT>& record) const override
{ {
return 8; return 8;
} }
virtual int getRowsCount(const Record<ESXRecordT>& record) const int getRowsCount(const Record<ESXRecordT>& record) const override
{ {
return static_cast<int>(record.get().mEffects.mList.size()); return static_cast<int>(record.get().mEffects.mList.size());
} }
@ -431,24 +431,24 @@ namespace CSMWorld
public: public:
InfoListAdapter (); InfoListAdapter ();
virtual void addRow(Record<Info>& record, int position) const; void addRow(Record<Info>& record, int position) const override;
virtual void removeRow(Record<Info>& record, int rowToRemove) const; void removeRow(Record<Info>& record, int rowToRemove) const override;
virtual void setTable(Record<Info>& record, void setTable(Record<Info>& record,
const NestedTableWrapperBase& nestedTable) const; const NestedTableWrapperBase& nestedTable) const override;
virtual NestedTableWrapperBase* table(const Record<Info>& record) const; NestedTableWrapperBase* table(const Record<Info>& record) const override;
virtual QVariant getData(const Record<Info>& record, QVariant getData(const Record<Info>& record,
int subRowIndex, int subColIndex) const; int subRowIndex, int subColIndex) const override;
virtual void setData(Record<Info>& record, void setData(Record<Info>& record,
const QVariant& value, int subRowIndex, int subColIndex) const; const QVariant& value, int subRowIndex, int subColIndex) const override;
virtual int getColumnsCount(const Record<Info>& record) const; int getColumnsCount(const Record<Info>& record) const override;
virtual int getRowsCount(const Record<Info>& record) const; int getRowsCount(const Record<Info>& record) const override;
}; };
class InfoConditionAdapter : public NestedColumnAdapter<Info> class InfoConditionAdapter : public NestedColumnAdapter<Info>
@ -456,24 +456,24 @@ namespace CSMWorld
public: public:
InfoConditionAdapter (); InfoConditionAdapter ();
virtual void addRow(Record<Info>& record, int position) const; void addRow(Record<Info>& record, int position) const override;
virtual void removeRow(Record<Info>& record, int rowToRemove) const; void removeRow(Record<Info>& record, int rowToRemove) const override;
virtual void setTable(Record<Info>& record, void setTable(Record<Info>& record,
const NestedTableWrapperBase& nestedTable) const; const NestedTableWrapperBase& nestedTable) const override;
virtual NestedTableWrapperBase* table(const Record<Info>& record) const; NestedTableWrapperBase* table(const Record<Info>& record) const override;
virtual QVariant getData(const Record<Info>& record, QVariant getData(const Record<Info>& record,
int subRowIndex, int subColIndex) const; int subRowIndex, int subColIndex) const override;
virtual void setData(Record<Info>& record, void setData(Record<Info>& record,
const QVariant& value, int subRowIndex, int subColIndex) const; const QVariant& value, int subRowIndex, int subColIndex) const override;
virtual int getColumnsCount(const Record<Info>& record) const; int getColumnsCount(const Record<Info>& record) const override;
virtual int getRowsCount(const Record<Info>& record) const; int getRowsCount(const Record<Info>& record) const override;
}; };
class RaceAttributeAdapter : public NestedColumnAdapter<ESM::Race> class RaceAttributeAdapter : public NestedColumnAdapter<ESM::Race>
@ -481,24 +481,24 @@ namespace CSMWorld
public: public:
RaceAttributeAdapter (); RaceAttributeAdapter ();
virtual void addRow(Record<ESM::Race>& record, int position) const; void addRow(Record<ESM::Race>& record, int position) const override;
virtual void removeRow(Record<ESM::Race>& record, int rowToRemove) const; void removeRow(Record<ESM::Race>& record, int rowToRemove) const override;
virtual void setTable(Record<ESM::Race>& record, void setTable(Record<ESM::Race>& record,
const NestedTableWrapperBase& nestedTable) const; const NestedTableWrapperBase& nestedTable) const override;
virtual NestedTableWrapperBase* table(const Record<ESM::Race>& record) const; NestedTableWrapperBase* table(const Record<ESM::Race>& record) const override;
virtual QVariant getData(const Record<ESM::Race>& record, QVariant getData(const Record<ESM::Race>& record,
int subRowIndex, int subColIndex) const; int subRowIndex, int subColIndex) const override;
virtual void setData(Record<ESM::Race>& record, void setData(Record<ESM::Race>& record,
const QVariant& value, int subRowIndex, int subColIndex) const; const QVariant& value, int subRowIndex, int subColIndex) const override;
virtual int getColumnsCount(const Record<ESM::Race>& record) const; int getColumnsCount(const Record<ESM::Race>& record) const override;
virtual int getRowsCount(const Record<ESM::Race>& record) const; int getRowsCount(const Record<ESM::Race>& record) const override;
}; };
class RaceSkillsBonusAdapter : public NestedColumnAdapter<ESM::Race> class RaceSkillsBonusAdapter : public NestedColumnAdapter<ESM::Race>
@ -506,24 +506,24 @@ namespace CSMWorld
public: public:
RaceSkillsBonusAdapter (); RaceSkillsBonusAdapter ();
virtual void addRow(Record<ESM::Race>& record, int position) const; void addRow(Record<ESM::Race>& record, int position) const override;
virtual void removeRow(Record<ESM::Race>& record, int rowToRemove) const; void removeRow(Record<ESM::Race>& record, int rowToRemove) const override;
virtual void setTable(Record<ESM::Race>& record, void setTable(Record<ESM::Race>& record,
const NestedTableWrapperBase& nestedTable) const; const NestedTableWrapperBase& nestedTable) const override;
virtual NestedTableWrapperBase* table(const Record<ESM::Race>& record) const; NestedTableWrapperBase* table(const Record<ESM::Race>& record) const override;
virtual QVariant getData(const Record<ESM::Race>& record, QVariant getData(const Record<ESM::Race>& record,
int subRowIndex, int subColIndex) const; int subRowIndex, int subColIndex) const override;
virtual void setData(Record<ESM::Race>& record, void setData(Record<ESM::Race>& record,
const QVariant& value, int subRowIndex, int subColIndex) const; const QVariant& value, int subRowIndex, int subColIndex) const override;
virtual int getColumnsCount(const Record<ESM::Race>& record) const; int getColumnsCount(const Record<ESM::Race>& record) const override;
virtual int getRowsCount(const Record<ESM::Race>& record) const; int getRowsCount(const Record<ESM::Race>& record) const override;
}; };
class CellListAdapter : public NestedColumnAdapter<CSMWorld::Cell> class CellListAdapter : public NestedColumnAdapter<CSMWorld::Cell>
@ -531,24 +531,24 @@ namespace CSMWorld
public: public:
CellListAdapter (); CellListAdapter ();
virtual void addRow(Record<CSMWorld::Cell>& record, int position) const; void addRow(Record<CSMWorld::Cell>& record, int position) const override;
virtual void removeRow(Record<CSMWorld::Cell>& record, int rowToRemove) const; void removeRow(Record<CSMWorld::Cell>& record, int rowToRemove) const override;
virtual void setTable(Record<CSMWorld::Cell>& record, void setTable(Record<CSMWorld::Cell>& record,
const NestedTableWrapperBase& nestedTable) const; const NestedTableWrapperBase& nestedTable) const override;
virtual NestedTableWrapperBase* table(const Record<CSMWorld::Cell>& record) const; NestedTableWrapperBase* table(const Record<CSMWorld::Cell>& record) const override;
virtual QVariant getData(const Record<CSMWorld::Cell>& record, QVariant getData(const Record<CSMWorld::Cell>& record,
int subRowIndex, int subColIndex) const; int subRowIndex, int subColIndex) const override;
virtual void setData(Record<CSMWorld::Cell>& record, void setData(Record<CSMWorld::Cell>& record,
const QVariant& value, int subRowIndex, int subColIndex) const; const QVariant& value, int subRowIndex, int subColIndex) const override;
virtual int getColumnsCount(const Record<CSMWorld::Cell>& record) const; int getColumnsCount(const Record<CSMWorld::Cell>& record) const override;
virtual int getRowsCount(const Record<CSMWorld::Cell>& record) const; int getRowsCount(const Record<CSMWorld::Cell>& record) const override;
}; };
class RegionWeatherAdapter : public NestedColumnAdapter<ESM::Region> class RegionWeatherAdapter : public NestedColumnAdapter<ESM::Region>
@ -556,24 +556,24 @@ namespace CSMWorld
public: public:
RegionWeatherAdapter (); RegionWeatherAdapter ();
virtual void addRow(Record<ESM::Region>& record, int position) const; void addRow(Record<ESM::Region>& record, int position) const override;
virtual void removeRow(Record<ESM::Region>& record, int rowToRemove) const; void removeRow(Record<ESM::Region>& record, int rowToRemove) const override;
virtual void setTable(Record<ESM::Region>& record, void setTable(Record<ESM::Region>& record,
const NestedTableWrapperBase& nestedTable) const; const NestedTableWrapperBase& nestedTable) const override;
virtual NestedTableWrapperBase* table(const Record<ESM::Region>& record) const; NestedTableWrapperBase* table(const Record<ESM::Region>& record) const override;
virtual QVariant getData(const Record<ESM::Region>& record, QVariant getData(const Record<ESM::Region>& record,
int subRowIndex, int subColIndex) const; int subRowIndex, int subColIndex) const override;
virtual void setData(Record<ESM::Region>& record, void setData(Record<ESM::Region>& record,
const QVariant& value, int subRowIndex, int subColIndex) const; const QVariant& value, int subRowIndex, int subColIndex) const override;
virtual int getColumnsCount(const Record<ESM::Region>& record) const; int getColumnsCount(const Record<ESM::Region>& record) const override;
virtual int getRowsCount(const Record<ESM::Region>& record) const; int getRowsCount(const Record<ESM::Region>& record) const override;
}; };
} }

View file

@ -32,24 +32,24 @@ namespace CSMWorld
NestedIdCollection (); NestedIdCollection ();
~NestedIdCollection(); ~NestedIdCollection();
virtual void addNestedRow(int row, int column, int position); void addNestedRow(int row, int column, int position) override;
virtual void removeNestedRows(int row, int column, int subRow); void removeNestedRows(int row, int column, int subRow) override;
virtual QVariant getNestedData(int row, int column, int subRow, int subColumn) const; QVariant getNestedData(int row, int column, int subRow, int subColumn) const override;
virtual void setNestedData(int row, int column, const QVariant& data, int subRow, int subColumn); void setNestedData(int row, int column, const QVariant& data, int subRow, int subColumn) override;
virtual NestedTableWrapperBase* nestedTable(int row, int column) const; NestedTableWrapperBase* nestedTable(int row, int column) const override;
virtual void setNestedTable(int row, int column, const NestedTableWrapperBase& nestedTable); void setNestedTable(int row, int column, const NestedTableWrapperBase& nestedTable) override;
virtual int getNestedRowsCount(int row, int column) const; int getNestedRowsCount(int row, int column) const override;
virtual int getNestedColumnsCount(int row, int column) const; int getNestedColumnsCount(int row, int column) const override;
// this method is inherited from NestedCollection, not from Collection<ESXRecordT> // this method is inherited from NestedCollection, not from Collection<ESXRecordT>
virtual NestableColumn *getNestableColumn(int column); NestableColumn *getNestableColumn(int column) override;
void addAdapter(std::pair<const ColumnBase*, NestedColumnAdapter<ESXRecordT>* > adapter); void addAdapter(std::pair<const ColumnBase*, NestedColumnAdapter<ESXRecordT>* > adapter);
}; };

View file

@ -24,24 +24,24 @@ namespace CSMWorld
NestedInfoCollection (); NestedInfoCollection ();
~NestedInfoCollection(); ~NestedInfoCollection();
virtual void addNestedRow(int row, int column, int position); void addNestedRow(int row, int column, int position) override;
virtual void removeNestedRows(int row, int column, int subRow); void removeNestedRows(int row, int column, int subRow) override;
virtual QVariant getNestedData(int row, int column, int subRow, int subColumn) const; QVariant getNestedData(int row, int column, int subRow, int subColumn) const override;
virtual void setNestedData(int row, int column, const QVariant& data, int subRow, int subColumn); void setNestedData(int row, int column, const QVariant& data, int subRow, int subColumn) override;
virtual NestedTableWrapperBase* nestedTable(int row, int column) const; NestedTableWrapperBase* nestedTable(int row, int column) const override;
virtual void setNestedTable(int row, int column, const NestedTableWrapperBase& nestedTable); void setNestedTable(int row, int column, const NestedTableWrapperBase& nestedTable) override;
virtual int getNestedRowsCount(int row, int column) const; int getNestedRowsCount(int row, int column) const override;
virtual int getNestedColumnsCount(int row, int column) const; int getNestedColumnsCount(int row, int column) const override;
// this method is inherited from NestedCollection, not from Collection<Info, IdAccessor<Info> > // this method is inherited from NestedCollection, not from Collection<Info, IdAccessor<Info> >
virtual NestableColumn *getNestableColumn(int column); NestableColumn *getNestableColumn(int column) override;
void addAdapter(std::pair<const ColumnBase*, NestedColumnAdapter<Info>* > adapter); void addAdapter(std::pair<const ColumnBase*, NestedColumnAdapter<Info>* > adapter);
}; };

View file

@ -39,25 +39,25 @@ namespace CSMWorld
CSMWorld::IdTree* model() const; CSMWorld::IdTree* model() const;
virtual QModelIndex mapFromSource(const QModelIndex& sourceIndex) const; QModelIndex mapFromSource(const QModelIndex& sourceIndex) const override;
virtual QModelIndex mapToSource(const QModelIndex& proxyIndex) const; QModelIndex mapToSource(const QModelIndex& proxyIndex) const override;
virtual int rowCount(const QModelIndex& parent) const; int rowCount(const QModelIndex& parent) const override;
virtual int columnCount(const QModelIndex& parent) const; int columnCount(const QModelIndex& parent) const override;
virtual QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const; QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override;
virtual QModelIndex parent(const QModelIndex& index) const; QModelIndex parent(const QModelIndex& index) const override;
virtual QVariant headerData (int section, Qt::Orientation orientation, int role) const; QVariant headerData (int section, Qt::Orientation orientation, int role) const override;
virtual QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const; QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const override;
virtual bool setData (const QModelIndex & index, const QVariant & value, int role = Qt::EditRole); bool setData (const QModelIndex & index, const QVariant & value, int role = Qt::EditRole) override;
virtual Qt::ItemFlags flags(const QModelIndex& index) const; Qt::ItemFlags flags(const QModelIndex& index) const override;
private: private:
void setupHeaderVectors(ColumnBase::Display columnId); void setupHeaderVectors(ColumnBase::Display columnId);

View file

@ -22,7 +22,7 @@ namespace CSMWorld
virtual ~NestedTableWrapper() {} virtual ~NestedTableWrapper() {}
virtual int size() const int size() const override
{ {
return mNestedTable.size(); //i hope that this will be enough return mNestedTable.size(); //i hope that this will be enough
} }

View file

@ -45,11 +45,11 @@ namespace CSMWorld
Record(State state, Record(State state,
const ESXRecordT *base = 0, const ESXRecordT *modified = 0); const ESXRecordT *base = 0, const ESXRecordT *modified = 0);
virtual RecordBase *clone() const; RecordBase *clone() const override;
virtual RecordBase *modifiedCopy() const; RecordBase *modifiedCopy() const override;
virtual void assign (const RecordBase& record); void assign (const RecordBase& record) override;
const ESXRecordT& get() const; const ESXRecordT& get() const;
///< Throws an exception, if the record is deleted. ///< Throws an exception, if the record is deleted.

File diff suppressed because it is too large Load diff

View file

@ -32,9 +32,9 @@ namespace CSMWorld
int flag = Flag_Table | Flag_Dialogue, bool editable = true, int flag = Flag_Table | Flag_Dialogue, bool editable = true,
bool userEditable = true); bool userEditable = true);
virtual bool isEditable() const; bool isEditable() const override;
virtual bool isUserEditable() const; bool isUserEditable() const override;
}; };
class RefIdCollection : public CollectionBase, public NestedCollection class RefIdCollection : public CollectionBase, public NestedCollection
@ -60,82 +60,82 @@ namespace CSMWorld
virtual ~RefIdCollection(); virtual ~RefIdCollection();
virtual int getSize() const; int getSize() const override;
virtual std::string getId (int index) const; std::string getId (int index) const override;
virtual int getIndex (const std::string& id) const; int getIndex (const std::string& id) const override;
virtual int getColumns() const; int getColumns() const override;
virtual const ColumnBase& getColumn (int column) const; const ColumnBase& getColumn (int column) const override;
virtual QVariant getData (int index, int column) const; QVariant getData (int index, int column) const override;
virtual void setData (int index, int column, const QVariant& data); void setData (int index, int column, const QVariant& data) override;
virtual void removeRows (int index, int count); void removeRows (int index, int count) override;
virtual void cloneRecord(const std::string& origin, void cloneRecord(const std::string& origin,
const std::string& destination, const std::string& destination,
const UniversalId::Type type); const UniversalId::Type type) override;
virtual bool touchRecord(const std::string& id); bool touchRecord(const std::string& id) override;
virtual void appendBlankRecord (const std::string& id, UniversalId::Type type); void appendBlankRecord (const std::string& id, UniversalId::Type type) override;
///< \param type Will be ignored, unless the collection supports multiple record types ///< \param type Will be ignored, unless the collection supports multiple record types
virtual int searchId (const std::string& id) const; int searchId (const std::string& id) const override;
////< Search record with \a id. ////< Search record with \a id.
/// \return index of record (if found) or -1 (not found) /// \return index of record (if found) or -1 (not found)
virtual void replace (int index, const RecordBase& record); void replace (int index, const RecordBase& record) override;
///< If the record type does not match, an exception is thrown. ///< If the record type does not match, an exception is thrown.
/// ///
/// \attention \a record must not change the ID. /// \attention \a record must not change the ID.
virtual void appendRecord (const RecordBase& record, UniversalId::Type type); void appendRecord (const RecordBase& record, UniversalId::Type type) override;
///< If the record type does not match, an exception is thrown. ///< If the record type does not match, an exception is thrown.
/// ///
///< \param type Will be ignored, unless the collection supports multiple record types ///< \param type Will be ignored, unless the collection supports multiple record types
virtual const RecordBase& getRecord (const std::string& id) const; const RecordBase& getRecord (const std::string& id) const override;
virtual const RecordBase& getRecord (int index) const; const RecordBase& getRecord (int index) const override;
void load (ESM::ESMReader& reader, bool base, UniversalId::Type type); void load (ESM::ESMReader& reader, bool base, UniversalId::Type type);
virtual int getAppendIndex (const std::string& id, UniversalId::Type type) const; int getAppendIndex (const std::string& id, UniversalId::Type type) const override;
///< \param type Will be ignored, unless the collection supports multiple record types ///< \param type Will be ignored, unless the collection supports multiple record types
virtual std::vector<std::string> getIds (bool listDeleted) const; std::vector<std::string> getIds (bool listDeleted) const override;
///< Return a sorted collection of all IDs ///< Return a sorted collection of all IDs
/// ///
/// \param listDeleted include deleted record in the list /// \param listDeleted include deleted record in the list
virtual bool reorderRows (int baseIndex, const std::vector<int>& newOrder); bool reorderRows (int baseIndex, const std::vector<int>& newOrder) override;
///< Reorder the rows [baseIndex, baseIndex+newOrder.size()) according to the indices ///< Reorder the rows [baseIndex, baseIndex+newOrder.size()) according to the indices
/// given in \a newOrder (baseIndex+newOrder[0] specifies the new index of row baseIndex). /// given in \a newOrder (baseIndex+newOrder[0] specifies the new index of row baseIndex).
/// ///
/// \return Success? /// \return Success?
virtual QVariant getNestedData(int row, int column, int subRow, int subColumn) const; QVariant getNestedData(int row, int column, int subRow, int subColumn) const override;
virtual NestedTableWrapperBase* nestedTable(int row, int column) const; NestedTableWrapperBase* nestedTable(int row, int column) const override;
virtual void setNestedTable(int row, int column, const NestedTableWrapperBase& nestedTable); void setNestedTable(int row, int column, const NestedTableWrapperBase& nestedTable) override;
virtual int getNestedRowsCount(int row, int column) const; int getNestedRowsCount(int row, int column) const override;
virtual int getNestedColumnsCount(int row, int column) const; int getNestedColumnsCount(int row, int column) const override;
NestableColumn *getNestableColumn(int column); NestableColumn *getNestableColumn(int column) override;
virtual void setNestedData(int row, int column, const QVariant& data, int subRow, int subColumn); void setNestedData(int row, int column, const QVariant& data, int subRow, int subColumn) override;
virtual void removeNestedRows(int row, int column, int subRow); void removeNestedRows(int row, int column, int subRow) override;
virtual void addNestedRow(int row, int col, int position); void addNestedRow(int row, int col, int position) override;
void save (int index, ESM::ESMWriter& writer) const; void save (int index, ESM::ESMWriter& writer) const;

View file

@ -66,24 +66,24 @@ namespace CSMWorld
{ {
std::vector<Record<RecordT> > mContainer; std::vector<Record<RecordT> > mContainer;
virtual int getSize() const; int getSize() const override;
virtual const RecordBase& getRecord (int index) const; const RecordBase& getRecord (int index) const override;
virtual RecordBase& getRecord (int index); RecordBase& getRecord (int index) override;
virtual void appendRecord (const std::string& id, bool base); void appendRecord (const std::string& id, bool base) override;
virtual void insertRecord (RecordBase& record); void insertRecord (RecordBase& record) override;
virtual int load (ESM::ESMReader& reader, bool base); int load (ESM::ESMReader& reader, bool base) override;
///< \return index of a loaded record or -1 if no record was loaded ///< \return index of a loaded record or -1 if no record was loaded
virtual void erase (int index, int count); void erase (int index, int count) override;
virtual std::string getId (int index) const; std::string getId (int index) const override;
virtual void save (int index, ESM::ESMWriter& writer) const; void save (int index, ESM::ESMWriter& writer) const override;
}; };
template<typename RecordT> template<typename RecordT>

View file

@ -91,15 +91,15 @@ namespace CSMWorld
RegionMap (Data& data); RegionMap (Data& data);
virtual int rowCount (const QModelIndex& parent = QModelIndex()) const; int rowCount (const QModelIndex& parent = QModelIndex()) const override;
virtual int columnCount (const QModelIndex& parent = QModelIndex()) const; int columnCount (const QModelIndex& parent = QModelIndex()) const override;
virtual QVariant data (const QModelIndex& index, int role = Qt::DisplayRole) const; QVariant data (const QModelIndex& index, int role = Qt::DisplayRole) const override;
///< \note Calling this function with role==Role_CellId may return the ID of a cell ///< \note Calling this function with role==Role_CellId may return the ID of a cell
/// that does not exist. /// that does not exist.
virtual Qt::ItemFlags flags (const QModelIndex& index) const; Qt::ItemFlags flags (const QModelIndex& index) const override;
private slots: private slots:

View file

@ -18,41 +18,40 @@ namespace CSMWorld
virtual ~ResourceTable(); virtual ~ResourceTable();
virtual int rowCount (const QModelIndex & parent = QModelIndex()) const; int rowCount (const QModelIndex & parent = QModelIndex()) const override;
virtual int columnCount (const QModelIndex & parent = QModelIndex()) const; int columnCount (const QModelIndex & parent = QModelIndex()) const override;
virtual QVariant data (const QModelIndex & index, int role = Qt::DisplayRole) const; QVariant data (const QModelIndex & index, int role = Qt::DisplayRole) const override;
virtual QVariant headerData (int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; QVariant headerData (int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
virtual bool setData ( const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); bool setData ( const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
virtual Qt::ItemFlags flags (const QModelIndex & index) const; Qt::ItemFlags flags (const QModelIndex & index) const override;
virtual QModelIndex index (int row, int column, const QModelIndex& parent = QModelIndex()) QModelIndex index (int row, int column, const QModelIndex& parent = QModelIndex()) const override;
const;
virtual QModelIndex parent (const QModelIndex& index) const; QModelIndex parent (const QModelIndex& index) const override;
virtual QModelIndex getModelIndex (const std::string& id, int column) const; QModelIndex getModelIndex (const std::string& id, int column) const override;
/// Return index of column with the given \a id. If no such column exists, -1 is /// Return index of column with the given \a id. If no such column exists, -1 is
/// returned. /// returned.
virtual int searchColumnIndex (Columns::ColumnId id) const; int searchColumnIndex (Columns::ColumnId id) const override;
/// Return index of column with the given \a id. If no such column exists, an /// Return index of column with the given \a id. If no such column exists, an
/// exception is thrown. /// exception is thrown.
virtual int findColumnIndex (Columns::ColumnId id) const; int findColumnIndex (Columns::ColumnId id) const override;
/// Return the UniversalId and the hint for viewing \a row. If viewing is not /// Return the UniversalId and the hint for viewing \a row. If viewing is not
/// supported by this table, return (UniversalId::Type_None, ""). /// supported by this table, return (UniversalId::Type_None, "").
virtual std::pair<UniversalId, std::string> view (int row) const; std::pair<UniversalId, std::string> view (int row) const override;
/// Is \a id flagged as deleted? /// Is \a id flagged as deleted?
virtual bool isDeleted (const std::string& id) const; bool isDeleted (const std::string& id) const override;
virtual int getColumnId (int column) const; int getColumnId (int column) const override;
/// Signal Qt that the data is about to change. /// Signal Qt that the data is about to change.
void beginReset(); void beginReset();

View file

@ -23,23 +23,23 @@ namespace CSMWorld
ScriptContext (const Data& data); ScriptContext (const Data& data);
virtual bool canDeclareLocals() const; bool canDeclareLocals() const override;
///< Is the compiler allowed to declare local variables? ///< Is the compiler allowed to declare local variables?
virtual char getGlobalType (const std::string& name) const; char getGlobalType (const std::string& name) const override;
///< 'l: long, 's': short, 'f': float, ' ': does not exist. ///< 'l: long, 's': short, 'f': float, ' ': does not exist.
virtual std::pair<char, bool> getMemberType (const std::string& name, std::pair<char, bool> getMemberType (const std::string& name,
const std::string& id) const; const std::string& id) const override;
///< Return type of member variable \a name in script \a id or in script of reference of ///< Return type of member variable \a name in script \a id or in script of reference of
/// \a id /// \a id
/// \return first: 'l: long, 's': short, 'f': float, ' ': does not exist. /// \return first: 'l: long, 's': short, 'f': float, ' ': does not exist.
/// second: true: script of reference /// second: true: script of reference
virtual bool isId (const std::string& name) const; bool isId (const std::string& name) const override;
///< Does \a name match an ID, that can be referenced? ///< Does \a name match an ID, that can be referenced?
virtual bool isJournalId (const std::string& name) const; bool isJournalId (const std::string& name) const override;
///< Does \a name match a journal ID? ///< Does \a name match a journal ID?
void invalidateIds(); void invalidateIds();

View file

@ -20,7 +20,7 @@ namespace CSMWorld
{ {
const IdCollection<Cell>& mCells; const IdCollection<Cell>& mCells;
virtual void loadRecord (ESXRecordT& record, ESM::ESMReader& reader, bool& isDeleted); void loadRecord (ESXRecordT& record, ESM::ESMReader& reader, bool& isDeleted) override;
public: public:

View file

@ -36,7 +36,7 @@ namespace CSMWorld
~TableMimeData(); ~TableMimeData();
virtual QStringList formats() const; QStringList formats() const override;
std::string getIcon() const; std::string getIcon() const;

View file

@ -38,7 +38,7 @@ namespace CSVDoc
private: private:
void closeEvent (QCloseEvent *event); void closeEvent (QCloseEvent *event) override;
public: public:

View file

@ -44,7 +44,7 @@ namespace CSVDoc
void create(); void create();
void reject(); void reject() override;
}; };
} }

View file

@ -13,7 +13,7 @@ namespace CSVDoc
RunLogSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document); RunLogSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document);
virtual void setEditLock (bool locked); void setEditLock (bool locked) override;
}; };
} }

View file

@ -14,7 +14,7 @@ namespace CSVDoc
SizeHintWidget(QWidget *parent = 0); SizeHintWidget(QWidget *parent = 0);
~SizeHintWidget(); ~SizeHintWidget();
virtual QSize sizeHint() const; QSize sizeHint() const override;
void setSizeHint(const QSize &size); void setSizeHint(const QSize &size);
}; };
} }

View file

@ -34,7 +34,7 @@ namespace CSVDoc
void setUniversalId(const CSMWorld::UniversalId& id); void setUniversalId(const CSMWorld::UniversalId& id);
bool event (QEvent *event); bool event (QEvent *event) override;
public: public:
@ -54,7 +54,7 @@ namespace CSVDoc
private: private:
void closeEvent (QCloseEvent *event); void closeEvent (QCloseEvent *event) override;
signals: signals:

View file

@ -12,7 +12,7 @@ namespace CSVDoc
{ {
public: public:
virtual CSVDoc::SubView *makeSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document); CSVDoc::SubView *makeSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document) override;
}; };
template<class SubViewT> template<class SubViewT>
@ -32,7 +32,7 @@ namespace CSVDoc
SubViewFactoryWithCreator (bool sorting = true); SubViewFactoryWithCreator (bool sorting = true);
virtual CSVDoc::SubView *makeSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document); CSVDoc::SubView *makeSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document) override;
}; };
template<class SubViewT, class CreatorFactoryT> template<class SubViewT, class CreatorFactoryT>

View file

@ -64,7 +64,7 @@ namespace CSVDoc
private: private:
void closeEvent (QCloseEvent *event); void closeEvent (QCloseEvent *event) override;
QAction* createMenuEntry(CSMWorld::UniversalId::Type type, QMenu* menu, const char* shortcutName); QAction* createMenuEntry(CSMWorld::UniversalId::Type type, QMenu* menu, const char* shortcutName);
QAction* createMenuEntry(const std::string& title, const std::string& iconName, QMenu* menu, const char* shortcutName); QAction* createMenuEntry(const std::string& title, const std::string& iconName, QMenu* menu, const char* shortcutName);

View file

@ -34,11 +34,11 @@ namespace CSVFilter
private: private:
void dragEnterEvent (QDragEnterEvent* event); void dragEnterEvent (QDragEnterEvent* event) override;
void dropEvent (QDropEvent* event); void dropEvent (QDropEvent* event) override;
void dragMoveEvent(QDragMoveEvent *event); void dragMoveEvent(QDragMoveEvent *event) override;
signals: signals:
void recordFilterChanged (std::shared_ptr<CSMFilter::Node> filter); void recordFilterChanged (std::shared_ptr<CSMFilter::Node> filter);

View file

@ -18,9 +18,9 @@ namespace CSVPrefs
protected: protected:
void contextMenuEvent(QContextMenuEvent* e); void contextMenuEvent(QContextMenuEvent* e) override;
void mousePressEvent(QMouseEvent* e); void mousePressEvent(QMouseEvent* e) override;
private slots: private slots:

View file

@ -34,7 +34,7 @@ namespace CSVPrefs
protected: protected:
void closeEvent (QCloseEvent *event); void closeEvent (QCloseEvent *event) override;
public slots: public slots:

View file

@ -26,7 +26,7 @@ namespace CSVPrefs
protected: protected:
void contextMenuEvent(QContextMenuEvent*); void contextMenuEvent(QContextMenuEvent*) override;
private slots: private slots:

Some files were not shown because too many files have changed in this diff Show more