1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-03 21:45:34 +00:00

Merge branch 'appveyor' of github.com:ace13/openmw into appveyor

This commit is contained in:
Alexander "Ace" Olofsson 2015-07-14 18:42:18 +02:00
commit fd750de21d
38 changed files with 1858 additions and 1434 deletions

View file

@ -124,6 +124,11 @@ add_runtime_dlls() {
RUNTIME_DLLS="$RUNTIME_DLLS $@" RUNTIME_DLLS="$RUNTIME_DLLS $@"
} }
OSG_PLUGINS=""
add_osg_dlls() {
OSG_PLUGINS="$OSG_PLUGINS $@"
}
if [ -z $PLATFORM ]; then if [ -z $PLATFORM ]; then
PLATFORM=`uname -m` PLATFORM=`uname -m`
fi fi
@ -250,279 +255,283 @@ mkdir -p Build_$BITS/deps
cd Build_$BITS/deps cd Build_$BITS/deps
DEPS_INSTALL=`pwd` DEPS_INSTALL=`pwd`
cd $DEPS
echo echo
echo "Extracting dependencies..." echo "Extracting dependencies..."
# Boost # Boost
if [ -z $APPVEYOR ]; then printf "Boost 1.58.0... "
printf "Boost 1.58.0... " {
cd $DEPS_INSTALL if [ -z $APPVEYOR ]; then
cd $DEPS_INSTALL
BOOST_SDK="`real_pwd`/Boost" BOOST_SDK="`real_pwd`/Boost"
if [ -d Boost ] && grep "BOOST_VERSION 105800" Boost/boost/version.hpp > /dev/null; then if [ -d Boost ] && grep "BOOST_VERSION 105800" Boost/boost/version.hpp > /dev/null; then
printf "Exists. " printf "Exists. "
elif [ -z $SKIP_EXTRACT ]; then elif [ -z $SKIP_EXTRACT ]; then
rm -rf Boost rm -rf Boost
$DEPS/boost-1.58.0-win$BITS.exe //dir="$(echo $BOOST_SDK | sed s,/,\\\\,g)" //verysilent $DEPS/boost-1.58.0-win$BITS.exe //dir="$(echo $BOOST_SDK | sed s,/,\\\\,g)" //verysilent
fi
add_cmake_opts -DBOOST_ROOT="$BOOST_SDK" \
-DBOOST_LIBRARYDIR="$BOOST_SDK/lib$BITS-msvc-12.0"
echo Done.
else
# Appveyor unstable has all the boost we need already
BOOST_SDK="c:/Libraries/boost"
add_cmake_opts -DBOOST_ROOT="$BOOST_SDK" \
-DBOOST_LIBRARYDIR="$BOOST_SDK/lib$BITS-msvc-12.0"
echo AppVeyor.
fi fi
}
add_cmake_opts -DBOOST_ROOT="$BOOST_SDK" \ cd $DEPS
-DBOOST_LIBRARYDIR="$BOOST_SDK/lib$BITS-msvc-12.0"
cd $DEPS
echo Done.
else
# Appveyor unstable has all the boost we need already
BOOST_SDK="c:/Libraries/boost"
add_cmake_opts -DBOOST_ROOT="$BOOST_SDK" \
-DBOOST_LIBRARYDIR="$BOOST_SDK/lib$BITS-msvc-12.0"
fi
# Bullet # Bullet
printf "Bullet 2.83.5... " printf "Bullet 2.83.5... "
cd $DEPS_INSTALL {
cd $DEPS_INSTALL
if [ -d Bullet ]; then if [ -d Bullet ]; then
printf "Exists. (No version checking) " printf "Exists. (No version checking) "
elif [ -z $SKIP_EXTRACT ]; then elif [ -z $SKIP_EXTRACT ]; then
rm -rf Bullet rm -rf Bullet
eval 7z x -y $DEPS/Bullet-2.83.5-win$BITS.7z $STRIP eval 7z x -y $DEPS/Bullet-2.83.5-win$BITS.7z $STRIP
mv Bullet-2.83.5-win$BITS Bullet mv Bullet-2.83.5-win$BITS Bullet
fi fi
BULLET_SDK="`real_pwd`/Bullet" BULLET_SDK="`real_pwd`/Bullet"
add_cmake_opts -DBULLET_INCLUDE_DIR="$BULLET_SDK/include/bullet" \ add_cmake_opts -DBULLET_INCLUDE_DIR="$BULLET_SDK/include/bullet" \
-DBULLET_COLLISION_LIBRARY="$BULLET_SDK/lib/BulletCollision.lib" \ -DBULLET_COLLISION_LIBRARY="$BULLET_SDK/lib/BulletCollision.lib" \
-DBULLET_COLLISION_LIBRARY_DEBUG="$BULLET_SDK/lib/BulletCollision_Debug.lib" \ -DBULLET_COLLISION_LIBRARY_DEBUG="$BULLET_SDK/lib/BulletCollision_Debug.lib" \
-DBULLET_DYNAMICS_LIBRARY="$BULLET_SDK/lib/BulletDynamics.lib" \ -DBULLET_MATH_LIBRARY="$BULLET_SDK/lib/LinearMath.lib" \
-DBULLET_DYNAMICS_LIBRARY_DEBUG="$BULLET_SDK/lib/BulletDynamics_Debug.lib" \ -DBULLET_MATH_LIBRARY_DEBUG="$BULLET_SDK/lib/LinearMath_Debug.lib"
-DBULLET_MATH_LIBRARY="$BULLET_SDK/lib/LinearMath.lib" \
-DBULLET_MATH_LIBRARY_DEBUG="$BULLET_SDK/lib/LinearMath_Debug.lib"
echo Done.
}
cd $DEPS cd $DEPS
echo Done.
# FFmpeg # FFmpeg
printf "FFmpeg 2.5.2... " printf "FFmpeg 2.5.2... "
cd $DEPS_INSTALL {
cd $DEPS_INSTALL
if [ -d FFmpeg ] && grep "FFmpeg version: 2.5.2" FFmpeg/README.txt > /dev/null; then if [ -d FFmpeg ] && grep "FFmpeg version: 2.5.2" FFmpeg/README.txt > /dev/null; then
printf "Exists. " printf "Exists. "
elif [ -z $SKIP_EXTRACT ]; then elif [ -z $SKIP_EXTRACT ]; then
rm -rf FFmpeg rm -rf FFmpeg
eval 7z x -y $DEPS/ffmpeg$BITS-2.5.2.7z $STRIP eval 7z x -y $DEPS/ffmpeg$BITS-2.5.2.7z $STRIP
eval 7z x -y $DEPS/ffmpeg$BITS-2.5.2-dev.7z $STRIP eval 7z x -y $DEPS/ffmpeg$BITS-2.5.2-dev.7z $STRIP
mv ffmpeg-2.5.2-win$BITS-shared FFmpeg mv ffmpeg-2.5.2-win$BITS-shared FFmpeg
cp -r ffmpeg-2.5.2-win$BITS-dev/* FFmpeg/ cp -r ffmpeg-2.5.2-win$BITS-dev/* FFmpeg/
rm -rf ffmpeg-2.5.2-win$BITS-dev rm -rf ffmpeg-2.5.2-win$BITS-dev
fi fi
FFMPEG_SDK="`real_pwd`/FFmpeg" FFMPEG_SDK="`real_pwd`/FFmpeg"
add_cmake_opts -DAVCODEC_INCLUDE_DIRS="$FFMPEG_SDK/include" \ add_cmake_opts -DAVCODEC_INCLUDE_DIRS="$FFMPEG_SDK/include" \
-DAVCODEC_LIBRARIES="$FFMPEG_SDK/lib/avcodec.lib" \ -DAVCODEC_LIBRARIES="$FFMPEG_SDK/lib/avcodec.lib" \
-DAVDEVICE_INCLUDE_DIRS="$FFMPEG_SDK/include" \ -DAVDEVICE_INCLUDE_DIRS="$FFMPEG_SDK/include" \
-DAVDEVICE_LIBRARIES="$FFMPEG_SDK/lib/avdevice.lib" \ -DAVDEVICE_LIBRARIES="$FFMPEG_SDK/lib/avdevice.lib" \
-DAVFORMAT_INCLUDE_DIRS="$FFMPEG_SDK/include" \ -DAVFORMAT_INCLUDE_DIRS="$FFMPEG_SDK/include" \
-DAVFORMAT_LIBRARIES="$FFMPEG_SDK/lib/avformat.lib" \ -DAVFORMAT_LIBRARIES="$FFMPEG_SDK/lib/avformat.lib" \
-DAVUTIL_INCLUDE_DIRS="$FFMPEG_SDK/include" \ -DAVUTIL_INCLUDE_DIRS="$FFMPEG_SDK/include" \
-DAVUTIL_LIBRARIES="$FFMPEG_SDK/lib/avutil.lib" \ -DAVUTIL_LIBRARIES="$FFMPEG_SDK/lib/avutil.lib" \
-DPOSTPROC_INCLUDE_DIRS="$FFMPEG_SDK/include" \ -DPOSTPROC_INCLUDE_DIRS="$FFMPEG_SDK/include" \
-DPOSTPROC_LIBRARIES="$FFMPEG_SDK/lib/postproc.lib" \ -DPOSTPROC_LIBRARIES="$FFMPEG_SDK/lib/postproc.lib" \
-DSWRESAMPLE_INCLUDE_DIRS="$FFMPEG_SDK/include" \ -DSWRESAMPLE_INCLUDE_DIRS="$FFMPEG_SDK/include" \
-DSWRESAMPLE_LIBRARIES="$FFMPEG_SDK/lib/swresample.lib" \ -DSWRESAMPLE_LIBRARIES="$FFMPEG_SDK/lib/swresample.lib" \
-DSWSCALE_INCLUDE_DIRS="$FFMPEG_SDK/include" \ -DSWSCALE_INCLUDE_DIRS="$FFMPEG_SDK/include" \
-DSWSCALE_LIBRARIES="$FFMPEG_SDK/lib/swscale.lib" -DSWSCALE_LIBRARIES="$FFMPEG_SDK/lib/swscale.lib"
add_runtime_dlls `pwd`/FFmpeg/bin/{avcodec-56,avformat-56,avutil-54,swresample-1,swscale-3}.dll add_runtime_dlls `pwd`/FFmpeg/bin/{avcodec-56,avformat-56,avutil-54,swresample-1,swscale-3}.dll
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
echo Done.
}
cd $DEPS cd $DEPS
echo Done.
# MyGUI # MyGUI
printf "MyGUI 3.2.2... " printf "MyGUI 3.2.2... "
cd $DEPS_INSTALL {
cd $DEPS_INSTALL
if [ -d MyGUI ] && \ if [ -d MyGUI ] && \
grep "MYGUI_VERSION_MAJOR 3" MyGUI/include/MYGUI/MyGUI_Prerequest.h > /dev/null && \ grep "MYGUI_VERSION_MAJOR 3" MyGUI/include/MYGUI/MyGUI_Prerequest.h > /dev/null && \
grep "MYGUI_VERSION_MINOR 2" MyGUI/include/MYGUI/MyGUI_Prerequest.h > /dev/null && \ grep "MYGUI_VERSION_MINOR 2" MyGUI/include/MYGUI/MyGUI_Prerequest.h > /dev/null && \
grep "MYGUI_VERSION_PATCH 2" MyGUI/include/MYGUI/MyGUI_Prerequest.h > /dev/null grep "MYGUI_VERSION_PATCH 2" MyGUI/include/MYGUI/MyGUI_Prerequest.h > /dev/null
then then
printf "Exists. " printf "Exists. "
elif [ -z $SKIP_EXTRACT ]; then elif [ -z $SKIP_EXTRACT ]; then
rm -rf MyGUI rm -rf MyGUI
eval 7z x -y $DEPS/MyGUI-3.2.2-win$BITS.7z $STRIP eval 7z x -y $DEPS/MyGUI-3.2.2-win$BITS.7z $STRIP
mv MyGUI-3.2.2-win$BITS MyGUI mv MyGUI-3.2.2-win$BITS MyGUI
fi fi
MYGUI_SDK="`real_pwd`/MyGUI" MYGUI_SDK="`real_pwd`/MyGUI"
add_cmake_opts -DMYGUISDK="$MYGUI_SDK" \ add_cmake_opts -DMYGUISDK="$MYGUI_SDK" \
-DMYGUI_INCLUDE_DIRS="$MYGUI_SDK/include" \ -DMYGUI_INCLUDE_DIRS="$MYGUI_SDK/include/MYGUI" \
-DMYGUI_PLATFORM_INCLUDE_DIRS="$MYGUI_SDK/include/MYGUI" \ -DMYGUI_PREQUEST_FILE="$MYGUI_SDK/include/MYGUI/MyGUI_Prerequest.h"
-DMYGUI_PREQUEST_FILE="$MYGUI_SDK/include/MYGUI/MyGUI_Prerequest.h"
if [ $CONFIGURATION == "Debug" ]; then if [ $CONFIGURATION == "Debug" ]; then
SUFFIX="_d" SUFFIX="_d"
else else
SUFFIX="" SUFFIX=""
fi fi
add_runtime_dlls `pwd`/MyGUI/bin/$CONFIGURATION/MyGUIEngine$SUFFIX.dll add_runtime_dlls `pwd`/MyGUI/bin/$CONFIGURATION/MyGUIEngine$SUFFIX.dll
echo Done.
}
cd $DEPS cd $DEPS
echo Done.
# OpenAL # OpenAL
printf "OpenAL-Soft 1.16.0... " printf "OpenAL-Soft 1.16.0... "
if [ -d openal-soft-1.16.0-bin ]; then {
printf "Exists. " if [ -d openal-soft-1.16.0-bin ]; then
elif [ -z $SKIP_EXTRACT ]; then printf "Exists. "
rm -rf openal-soft-1.16.0-bin elif [ -z $SKIP_EXTRACT ]; then
eval 7z x -y OpenAL-Soft-1.16.0.zip $STRIP rm -rf openal-soft-1.16.0-bin
fi eval 7z x -y OpenAL-Soft-1.16.0.zip $STRIP
fi
OPENAL_SDK="`real_pwd`/openal-soft-1.16.0-bin" OPENAL_SDK="`real_pwd`/openal-soft-1.16.0-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"
echo Done.
echo Done.
}
cd $DEPS
# OSG # OSG
printf "OSG 3.3.8... " printf "OSG 3.3.8... "
cd $DEPS_INSTALL {
cd $DEPS_INSTALL
if [ -d OSG ] && \ if [ -d OSG ] && \
grep "OPENSCENEGRAPH_MAJOR_VERSION 3" OSG/include/osg/Version > /dev/null && \ grep "OPENSCENEGRAPH_MAJOR_VERSION 3" OSG/include/osg/Version > /dev/null && \
grep "OPENSCENEGRAPH_MINOR_VERSION 3" OSG/include/osg/Version > /dev/null && \ grep "OPENSCENEGRAPH_MINOR_VERSION 3" OSG/include/osg/Version > /dev/null && \
grep "OPENSCENEGRAPH_PATCH_VERSION 8" OSG/include/osg/Version > /dev/null grep "OPENSCENEGRAPH_PATCH_VERSION 8" OSG/include/osg/Version > /dev/null
then then
printf "Exists. " printf "Exists. "
elif [ -z $SKIP_EXTRACT ]; then elif [ -z $SKIP_EXTRACT ]; then
rm -rf OSG rm -rf OSG
eval 7z x -y $DEPS/OSG-3.3.8-win$BITS.7z $STRIP eval 7z x -y $DEPS/OSG-3.3.8-win$BITS.7z $STRIP
mv OSG-3.3.8-win$BITS OSG mv OSG-3.3.8-win$BITS OSG
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 if [ $CONFIGURATION == "Debug" ]; then
SUFFIX="d" SUFFIX="d"
else else
SUFFIX="" SUFFIX=""
fi fi
add_runtime_dlls `pwd`/OSG/bin/{OpenThreads,zlib}$SUFFIX.dll \
`pwd`/OSG/bin/osg{,Animation,DB,FX,GA,Particle,Qt,Text,Util,Viewer}$SUFFIX.dll
OSG_PLUGINS="" add_runtime_dlls `pwd`/OSG/bin/{OpenThreads,zlib}$SUFFIX.dll \
add_osg_dlls() { `pwd`/OSG/bin/osg{,Animation,DB,FX,GA,Particle,Qt,Text,Util,Viewer}$SUFFIX.dll
OSG_PLUGINS="$OSG_PLUGINS $@"
add_osg_dlls `pwd`/OSG/bin/osgPlugins-3.3.8/osgdb_{bmp,dds,gif,jpeg,png,tga}$SUFFIX.dll
echo Done.
} }
add_osg_dlls `pwd`/OSG/bin/osgPlugins-3.3.8/osgdb_{bmp,dds,gif,jpeg,png,tga}$SUFFIX.dll
cd $DEPS cd $DEPS
echo Done.
# Qt # Qt
if [ -z $APPVEYOR ]; then if [ -z $APPVEYOR ]; then
printf "Qt 4.8.6... " printf "Qt 4.8.6... "
cd $DEPS_INSTALL
if [ -d Qt ] && head -n2 Qt/BUILDINFO.txt | grep "4.8.6" > /dev/null; then
printf "Exists. "
elif [ -z $SKIP_EXTRACT ]; then
rm -rf Qt
eval 7z x -y $DEPS/qt$BITS-4.8.6.7z $STRIP
mv qt-4.8.6-* Qt
fi
QT_SDK="`real_pwd`/Qt"
cd $QT_SDK
eval qtbinpatcher.exe $STRIP
add_cmake_opts -DDESIRED_QT_VERSION=4 \
-DQT_QMAKE_EXECUTABLE="$QT_SDK/bin/qmake.exe"
if [ $CONFIGURATION == "Debug" ]; then
SUFFIX="d4"
else
SUFFIX="4"
fi
add_runtime_dlls `pwd`/bin/Qt{Core,Gui,Network,OpenGL}$SUFFIX.dll
cd $DEPS
echo Done.
else else
echo "Using Appveyor Qt 5 version." printf "Qt 5.4... "
if [ $PLATFORM == "win32" ]; then
QT_SDK="C:/Qt/5.4/msvc2013_opengl"
else
QT_SDK="C:/Qt/5.4/msvc2013_64_opengl"
fi
add_cmake_opts -DDESIRED_QT_VERSION=5 \
-DQT_QMAKE_EXECUTABLE="$QT_SDK/bin/qmake.exe"
fi fi
{
if [ -z $APPVEYOR ]; then
cd $DEPS_INSTALL
QT_SDK="`real_pwd`/Qt"
if [ -d Qt ] && head -n2 Qt/BUILDINFO.txt | grep "4.8.6" > /dev/null; then
printf "Exists. "
elif [ -z $SKIP_EXTRACT ]; then
rm -rf Qt
eval 7z x -y $DEPS/qt$BITS-4.8.6.7z $STRIP
mv qt-4.8.6-* Qt
(
cd $QT_SDK
eval qtbinpatcher.exe $STRIP
)
fi
cd $QT_SDK
add_cmake_opts -DDESIRED_QT_VERSION=4 \
-DQT_QMAKE_EXECUTABLE="$QT_SDK/bin/qmake.exe"
if [ $CONFIGURATION == "Debug" ]; then
SUFFIX="d4"
else
SUFFIX="4"
fi
add_runtime_dlls `pwd`/bin/Qt{Core,Gui,Network,OpenGL}$SUFFIX.dll
echo Done.
else
if [ $BITS -eq 32 ]; then
QT_SDK="C:/Qt/5.4/msvc2013_opengl"
else
QT_SDK="C:/Qt/5.4/msvc2013_64_opengl"
fi
add_cmake_opts -DDESIRED_QT_VERSION=5 \
-DQT_QMAKE_EXECUTABLE="$QT_SDK/bin/qmake.exe" \
-DCMAKE_PREFIX_PATH="$QT_SDK"
fi
}
cd $DEPS
# SDL2 # SDL2
printf "SDL 2.0.3... " printf "SDL 2.0.3... "
{
if [ -d SDL2-2.0.3 ]; then
printf "Exists. "
elif [ -z $SKIP_EXTRACT ]; then
rm -rf SDL2-2.0.3
eval 7z x -y SDL2-2.0.3.zip $STRIP
fi
if [ -d SDL2-2.0.3 ]; then SDL_SDK="`real_pwd`/SDL2-2.0.3"
printf "Exists. " add_cmake_opts -DSDL2_INCLUDE_DIR="$SDL_SDK/include" \
elif [ -z $SKIP_EXTRACT ]; then -DSDL2MAIN_LIBRARY="$SDL_SDK/lib/x$ARCHSUFFIX/SDL2main.lib" \
rm -rf SDL2-2.0.3 -DSDL2_LIBRARY_PATH="$SDL_SDK/lib/x$ARCHSUFFIX/SDL2.lib"
eval 7z x -y SDL2-2.0.3.zip $STRIP
fi
SDL_SDK="`real_pwd`/SDL2-2.0.3" add_runtime_dlls `pwd`/SDL2-2.0.3/lib/x$ARCHSUFFIX/SDL2.dll
add_cmake_opts -DSDL2_INCLUDE_DIR="$SDL_SDK/include" \
-DSDL2MAIN_LIBRARY="$SDL_SDK/lib/x$ARCHSUFFIX/SDL2main.lib" \
-DSDL2_LIBRARY_PATH="$SDL_SDK/lib/x$ARCHSUFFIX/SDL2.lib" \
-DSDL2_LIBRARY_ONLY="$SDL_SDK/lib/x$ARCHSUFFIX/SDL2.lib"
add_runtime_dlls `pwd`/SDL2-2.0.3/lib/x$ARCHSUFFIX/SDL2.dll echo Done.
}
cd $DEPS
echo Done.
echo
cd $DEPS_INSTALL/.. cd $DEPS_INSTALL/..
echo
echo "Setting up OpenMW build..." echo "Setting up OpenMW build..."
add_cmake_opts -DBUILD_BSATOOL=no \ add_cmake_opts -DBUILD_BSATOOL=no \
-DBUILD_ESMTOOL=no \ -DBUILD_ESMTOOL=no \
-DBUILD_MYGUI_PLUGIN=no \ -DBUILD_MYGUI_PLUGIN=no \
-DOPENMW_MP_BUILD=yes -DOPENMW_MP_BUILD=on
if [ -z $APPVEYOR ]; then if [ -z $CI ]; then
echo " (Outside of AppVeyor, doing full build.)" echo " (Outside of CI, doing full build.)"
else else
case $STEP in case $STEP in
components ) components )
@ -533,7 +542,6 @@ else
-DBUILD_OPENCS=no \ -DBUILD_OPENCS=no \
-DBUILD_OPENMW=no \ -DBUILD_OPENMW=no \
-DBUILD_WIZARD=no -DBUILD_WIZARD=no
rm -rf components
;; ;;
openmw ) openmw )
echo " Subproject: OpenMW." echo " Subproject: OpenMW."
@ -575,7 +583,8 @@ fi
echo echo
if [ -z $APPVEYOR ]; then # NOTE: Disable this when/if we want to run test cases
if [ -z $CI ]; then
echo "Copying Runtime DLLs..." echo "Copying Runtime DLLs..."
mkdir -p $CONFIGURATION mkdir -p $CONFIGURATION
for DLL in $RUNTIME_DLLS; do for DLL in $RUNTIME_DLLS; do

View file

@ -50,6 +50,10 @@ else
msbuild OpenMW.sln //t:Build //m:8 //logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" msbuild OpenMW.sln //t:Build //m:8 //logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
fi fi
if [ ! -z $PACKAGE ]; then RET=$?
if [ $RET -eq 0 ] && [ ! -z $PACKAGE ]; then
msbuild PACKAGE.vcxproj //t:Build //m:8 msbuild PACKAGE.vcxproj //t:Build //m:8
fi RET=$?
fi
exit $RET

View file

@ -1,5 +1,7 @@
#include "convertplayer.hpp" #include "convertplayer.hpp"
#include <components/misc/stringops.hpp>
namespace ESSImport namespace ESSImport
{ {

View file

@ -276,11 +276,11 @@ void CSVWorld::ScriptEdit::lineNumberAreaPaintEvent(QPaintEvent *event)
if(textCursor().hasSelection()) if(textCursor().hasSelection())
{ {
QString str = textCursor().selection().toPlainText(); QString str = textCursor().selection().toPlainText();
int selectedLines = str.count("\n")+1; int offset = str.count("\n");
if(textCursor().position() < textCursor().anchor()) if(textCursor().position() < textCursor().anchor())
endBlock += selectedLines; endBlock += offset;
else else
startBlock -= selectedLines; startBlock -= offset;
} }
painter.setBackgroundMode(Qt::OpaqueMode); painter.setBackgroundMode(Qt::OpaqueMode);
QFont font = painter.font(); QFont font = painter.font();

View file

@ -10,6 +10,7 @@
#include <components/esm/loaddial.hpp> #include <components/esm/loaddial.hpp>
#include <components/esm/loadinfo.hpp> #include <components/esm/loadinfo.hpp>
#include <components/esm/dialoguestate.hpp> #include <components/esm/dialoguestate.hpp>
#include <components/esm/esmwriter.hpp>
#include <components/compiler/exception.hpp> #include <components/compiler/exception.hpp>
#include <components/compiler/errorhandler.hpp> #include <components/compiler/errorhandler.hpp>

View file

@ -10,10 +10,14 @@
#include <osg/Texture2D> #include <osg/Texture2D>
#include <components/misc/stringops.hpp>
#include <components/myguiplatform/myguitexture.hpp> #include <components/myguiplatform/myguitexture.hpp>
#include <components/settings/settings.hpp> #include <components/settings/settings.hpp>
#include <components/misc/stringops.hpp>
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/soundmanager.hpp" #include "../mwbase/soundmanager.hpp"

View file

@ -12,6 +12,7 @@
#include <MyGUI_FactoryManager.h> #include <MyGUI_FactoryManager.h>
#include <components/esm/globalmap.hpp> #include <components/esm/globalmap.hpp>
#include <components/esm/esmwriter.hpp>
#include <components/settings/settings.hpp> #include <components/settings/settings.hpp>
#include <components/myguiplatform/myguitexture.hpp> #include <components/myguiplatform/myguitexture.hpp>

View file

@ -5,6 +5,7 @@
#include <MyGUI_Gui.h> #include <MyGUI_Gui.h>
#include <MyGUI_ImageBox.h> #include <MyGUI_ImageBox.h>
#include <components/esm/esmwriter.hpp>
#include <components/esm/quickkeys.hpp> #include <components/esm/quickkeys.hpp>
#include "../mwworld/inventorystore.hpp" #include "../mwworld/inventorystore.hpp"

View file

@ -22,6 +22,9 @@
#include <components/sdlutil/sdlcursormanager.hpp> #include <components/sdlutil/sdlcursormanager.hpp>
#include <components/esm/esmreader.hpp>
#include <components/esm/esmwriter.hpp>
#include <components/fontloader/fontloader.hpp> #include <components/fontloader/fontloader.hpp>
#include <components/resource/resourcesystem.hpp> #include <components/resource/resourcesystem.hpp>

View file

@ -4,7 +4,10 @@
#include <osg/PositionAttitudeTransform> #include <osg/PositionAttitudeTransform>
#include <components/esm/esmreader.hpp>
#include <components/esm/esmwriter.hpp>
#include <components/esm/loadnpc.hpp> #include <components/esm/loadnpc.hpp>
#include <components/esm/esmreader.hpp>
#include "../mwworld/esmstore.hpp" #include "../mwworld/esmstore.hpp"
#include "../mwworld/class.hpp" #include "../mwworld/class.hpp"

View file

@ -267,6 +267,7 @@ namespace MWMechanics
moveNow = false; moveNow = false;
walking = false; walking = false;
chooseAction = true; chooseAction = true;
mStuckCount = 0;
} }
//#endif //#endif
} }
@ -410,7 +411,7 @@ namespace MWMechanics
ESM::Pathgrid::Point start(PathFinder::MakePathgridPoint(pos)); ESM::Pathgrid::Point start(PathFinder::MakePathgridPoint(pos));
// don't take shortcuts for wandering // don't take shortcuts for wandering
storage.mPathFinder.buildPath(start, dest, actor.getCell(), false); storage.mPathFinder.buildSyncedPath(start, dest, actor.getCell(), false);
if(storage.mPathFinder.isPathConstructed()) if(storage.mPathFinder.isPathConstructed())
{ {
@ -510,17 +511,10 @@ namespace MWMechanics
ESM::Pathgrid::Point start(PathFinder::MakePathgridPoint(pos)); ESM::Pathgrid::Point start(PathFinder::MakePathgridPoint(pos));
// don't take shortcuts for wandering // don't take shortcuts for wandering
storage.mPathFinder.buildPath(start, dest, actor.getCell(), false); storage.mPathFinder.buildSyncedPath(start, dest, actor.getCell(), false);
if(storage.mPathFinder.isPathConstructed()) if(storage.mPathFinder.isPathConstructed())
{ {
// buildPath inserts dest in case it is not a pathgraph point
// index which is a duplicate for AiWander. However below code
// does not work since getPath() returns a copy of path not a
// reference
//if(storage.mPathFinder.getPathSize() > 1)
//storage.mPathFinder.getPath().pop_back();
// Remove this node as an option and add back the previously used node (stops NPC from picking the same node): // Remove this node as an option and add back the previously used node (stops NPC from picking the same node):
ESM::Pathgrid::Point temp = mAllowedNodes[randNode]; ESM::Pathgrid::Point temp = mAllowedNodes[randNode];
mAllowedNodes.erase(mAllowedNodes.begin() + randNode); mAllowedNodes.erase(mAllowedNodes.begin() + randNode);
@ -726,36 +720,10 @@ namespace MWMechanics
mCurrentNode = mAllowedNodes[index]; mCurrentNode = mAllowedNodes[index];
mAllowedNodes.erase(mAllowedNodes.begin() + index); mAllowedNodes.erase(mAllowedNodes.begin() + index);
} }
// In vanilla Morrowind, sometimes distance is too small to include at least two points,
// in which case, we will take the two closest points regardless of the wander distance
// This is a backup option, as std::sort is potentially O(n^2) in time.
if (mAllowedNodes.empty())
{
// Start with list of PathGrid nodes, sorted by distance from actor
std::vector<PathDistance> nodeDistances;
for (unsigned int counter = 0; counter < pathgrid->mPoints.size(); counter++)
{
float distance = (npcPos - PathFinder::MakeOsgVec3(pathgrid->mPoints[counter])).length2();
nodeDistances.push_back(std::make_pair(distance, &pathgrid->mPoints.at(counter)));
}
std::sort(nodeDistances.begin(), nodeDistances.end(), sortByDistance);
// make closest node the current node
mCurrentNode = *nodeDistances[0].second;
// give Actor a 2nd node to walk to
mAllowedNodes.push_back(*nodeDistances[1].second);
}
mStoredAvailableNodes = true; // set only if successful in finding allowed nodes mStoredAvailableNodes = true; // set only if successful in finding allowed nodes
} }
} }
bool AiWander::sortByDistance(const PathDistance& left, const PathDistance& right)
{
return left.first < right.first;
}
void AiWander::writeState(ESM::AiSequence::AiSequence &sequence) const void AiWander::writeState(ESM::AiSequence::AiSequence &sequence) const
{ {
std::auto_ptr<ESM::AiSequence::AiWander> wander(new ESM::AiSequence::AiWander()); std::auto_ptr<ESM::AiSequence::AiWander> wander(new ESM::AiSequence::AiWander());

View file

@ -120,13 +120,6 @@ namespace MWMechanics
/// lookup table for converting idleSelect value to groupName /// lookup table for converting idleSelect value to groupName
static const std::string sIdleSelectToGroupName[GroupIndex_MaxIdle - GroupIndex_MinIdle + 1]; static const std::string sIdleSelectToGroupName[GroupIndex_MaxIdle - GroupIndex_MinIdle + 1];
/// record distances of pathgrid point nodes to actor
/// first value is distance between actor and node, second value is PathGrid node
typedef std::pair<float, const ESM::Pathgrid::Point*> PathDistance;
/// used to sort array of PathDistance objects into ascending order
static bool sortByDistance(const PathDistance& left, const PathDistance& right);
}; };

View file

@ -3,6 +3,8 @@
#include <algorithm> #include <algorithm>
#include <components/esm/creaturestats.hpp> #include <components/esm/creaturestats.hpp>
#include <components/esm/esmreader.hpp>
#include <components/esm/esmwriter.hpp>
#include "../mwworld/esmstore.hpp" #include "../mwworld/esmstore.hpp"

View file

@ -6,6 +6,7 @@
#include <components/misc/rng.hpp> #include <components/misc/rng.hpp>
#include <components/esm/esmwriter.hpp>
#include <components/esm/stolenitems.hpp> #include <components/esm/stolenitems.hpp>
#include "../mwworld/esmstore.hpp" #include "../mwworld/esmstore.hpp"

View file

@ -35,9 +35,6 @@ namespace MWMechanics
void clearPath(); void clearPath();
void buildPath(const ESM::Pathgrid::Point &startPoint, const ESM::Pathgrid::Point &endPoint,
const MWWorld::CellStore* cell, bool allowShortcuts = true);
bool checkPathCompleted(float x, float y, float tolerance=32.f); bool checkPathCompleted(float x, float y, float tolerance=32.f);
///< \Returns true if we are within \a tolerance units of the last path point. ///< \Returns true if we are within \a tolerance units of the last path point.
@ -92,6 +89,8 @@ namespace MWMechanics
} }
private: private:
void buildPath(const ESM::Pathgrid::Point &startPoint, const ESM::Pathgrid::Point &endPoint,
const MWWorld::CellStore* cell, bool allowShortcuts = true);
std::list<ESM::Pathgrid::Point> mPath; std::list<ESM::Pathgrid::Point> mPath;

View file

@ -5,6 +5,7 @@
#include <components/esm/loadspel.hpp> #include <components/esm/loadspel.hpp>
#include <components/esm/spellstate.hpp> #include <components/esm/spellstate.hpp>
#include <components/misc/rng.hpp>
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"

View file

@ -1,28 +1,276 @@
#include "stat.hpp" #include "stat.hpp"
void MWMechanics::AttributeValue::writeState (ESM::StatState<int>& state) const #include <components/esm/statstate.hpp>
namespace MWMechanics
{ {
state.mBase = mBase; template<typename T>
state.mMod = mModifier; Stat<T>::Stat() : mBase (0), mModified (0) {}
state.mDamage = mDamage; template<typename T>
Stat<T>::Stat(T base) : mBase (base), mModified (base) {}
template<typename T>
Stat<T>::Stat(T base, T modified) : mBase (base), mModified (modified) {}
template<typename T>
const T& Stat<T>::getBase() const
{
return mBase;
}
template<typename T>
T Stat<T>::getModified() const
{
return std::max(static_cast<T>(0), mModified);
}
template<typename T>
T Stat<T>::getModifier() const
{
return mModified-mBase;
}
template<typename T>
void Stat<T>::set (const T& value)
{
mBase = mModified = value;
}
template<typename T>
void Stat<T>::modify(const T& diff)
{
mBase += diff;
if(mBase >= static_cast<T>(0))
mModified += diff;
else
{
mModified += diff - mBase;
mBase = static_cast<T>(0);
}
}
template<typename T>
void Stat<T>::setBase (const T& value)
{
T diff = value - mBase;
mBase = value;
mModified += diff;
}
template<typename T>
void Stat<T>::setModified (T value, const T& min, const T& max)
{
T diff = value - mModified;
if (mBase+diff<min)
{
value = min + (mModified - mBase);
diff = value - mModified;
}
else if (mBase+diff>max)
{
value = max + (mModified - mBase);
diff = value - mModified;
}
mModified = value;
mBase += diff;
}
template<typename T>
void Stat<T>::setModifier (const T& modifier)
{
mModified = mBase + modifier;
}
template<typename T>
void Stat<T>::writeState (ESM::StatState<T>& state) const
{
state.mBase = mBase;
state.mMod = mModified;
}
template<typename T>
void Stat<T>::readState (const ESM::StatState<T>& state)
{
mBase = state.mBase;
mModified = state.mMod;
}
template<typename T>
DynamicStat<T>::DynamicStat() : mStatic (0), mCurrent (0) {}
template<typename T>
DynamicStat<T>::DynamicStat(T base) : mStatic (base), mCurrent (base) {}
template<typename T>
DynamicStat<T>::DynamicStat(T base, T modified, T current) : mStatic(base, modified), mCurrent (current) {}
template<typename T>
DynamicStat<T>::DynamicStat(const Stat<T> &stat, T current) : mStatic(stat), mCurrent (current) {}
template<typename T>
const T& DynamicStat<T>::getBase() const
{
return mStatic.getBase();
}
template<typename T>
T DynamicStat<T>::getModified() const
{
return mStatic.getModified();
}
template<typename T>
const T& DynamicStat<T>::getCurrent() const
{
return mCurrent;
}
template<typename T>
void DynamicStat<T>::set (const T& value)
{
mStatic.set (value);
mCurrent = value;
}
template<typename T>
void DynamicStat<T>::setBase (const T& value)
{
mStatic.setBase (value);
if (mCurrent>getModified())
mCurrent = getModified();
}
template<typename T>
void DynamicStat<T>::setModified (T value, const T& min, const T& max)
{
mStatic.setModified (value, min, max);
if (mCurrent>getModified())
mCurrent = getModified();
}
template<typename T>
void DynamicStat<T>::modify (const T& diff, bool allowCurrentDecreaseBelowZero)
{
mStatic.modify (diff);
setCurrent (getCurrent()+diff, allowCurrentDecreaseBelowZero);
}
template<typename T>
void DynamicStat<T>::setCurrent (const T& value, bool allowDecreaseBelowZero)
{
if (value > mCurrent)
{
// increase
mCurrent = value;
if (mCurrent > getModified())
mCurrent = getModified();
}
else if (value > 0 || allowDecreaseBelowZero)
{
// allowed decrease
mCurrent = value;
}
else if (mCurrent > 0)
{
// capped decrease
mCurrent = 0;
}
}
template<typename T>
void DynamicStat<T>::setModifier (const T& modifier, bool allowCurrentDecreaseBelowZero)
{
T diff = modifier - mStatic.getModifier();
mStatic.setModifier (modifier);
setCurrent (getCurrent()+diff, allowCurrentDecreaseBelowZero);
}
template<typename T>
void DynamicStat<T>::writeState (ESM::StatState<T>& state) const
{
mStatic.writeState (state);
state.mCurrent = mCurrent;
}
template<typename T>
void DynamicStat<T>::readState (const ESM::StatState<T>& state)
{
mStatic.readState (state);
mCurrent = state.mCurrent;
}
AttributeValue::AttributeValue() :
mBase(0), mModifier(0), mDamage(0)
{
}
int AttributeValue::getModified() const
{
return std::max(0, mBase - (int) mDamage + mModifier);
}
int AttributeValue::getBase() const
{
return mBase;
}
int AttributeValue::getModifier() const
{
return mModifier;
}
void AttributeValue::setBase(int base)
{
mBase = std::max(0, base);
}
void AttributeValue::setModifier(int mod)
{
mModifier = mod;
}
void AttributeValue::damage(float damage)
{
mDamage += std::min(damage, (float)getModified());
}
void AttributeValue::restore(float amount)
{
mDamage -= std::min(mDamage, amount);
}
float AttributeValue::getDamage() const
{
return mDamage;
}
void AttributeValue::writeState (ESM::StatState<int>& state) const
{
state.mBase = mBase;
state.mMod = mModifier;
state.mDamage = mDamage;
}
void AttributeValue::readState (const ESM::StatState<int>& state)
{
mBase = state.mBase;
mModifier = state.mMod;
mDamage = state.mDamage;
}
SkillValue::SkillValue() :
mProgress(0)
{
}
float SkillValue::getProgress() const
{
return mProgress;
}
void SkillValue::setProgress(float progress)
{
mProgress = progress;
}
void SkillValue::writeState (ESM::StatState<int>& state) const
{
AttributeValue::writeState (state);
state.mProgress = mProgress;
}
void SkillValue::readState (const ESM::StatState<int>& state)
{
AttributeValue::readState (state);
mProgress = state.mProgress;
}
} }
void MWMechanics::AttributeValue::readState (const ESM::StatState<int>& state) template class MWMechanics::Stat<int>;
{ template class MWMechanics::Stat<float>;
mBase = state.mBase; template class MWMechanics::DynamicStat<int>;
mModifier = state.mMod; template class MWMechanics::DynamicStat<float>;
mDamage = state.mDamage;
}
void MWMechanics::SkillValue::writeState (ESM::StatState<int>& state) const
{
AttributeValue::writeState (state);
state.mProgress = mProgress;
}
void MWMechanics::SkillValue::readState (const ESM::StatState<int>& state)
{
AttributeValue::readState (state);
mProgress = state.mProgress;
}

View file

@ -1,9 +1,14 @@
#ifndef GAME_MWMECHANICS_STAT_H #ifndef GAME_MWMECHANICS_STAT_H
#define GAME_MWMECHANICS_STAT_H #define GAME_MWMECHANICS_STAT_H
#include <algorithm>
#include <limits> #include <limits>
#include <components/esm/statstate.hpp> namespace ESM
{
template<typename T>
struct StatState;
}
namespace MWMechanics namespace MWMechanics
{ {
@ -16,87 +21,28 @@ namespace MWMechanics
public: public:
typedef T Type; typedef T Type;
Stat() : mBase (0), mModified (0) {} Stat();
Stat(T base) : mBase (base), mModified (base) {} Stat(T base);
Stat(T base, T modified) : mBase (base), mModified (modified) {} Stat(T base, T modified);
const T& getBase() const const T& getBase() const;
{
return mBase;
}
T getModified() const T getModified() const;
{ T getModifier() const;
return std::max(static_cast<T>(0), mModified);
}
T getModifier() const
{
return mModified-mBase;
}
/// Set base and modified to \a value. /// Set base and modified to \a value.
void set (const T& value) void set (const T& value);
{ void modify(const T& diff);
mBase = mModified = value;
}
void modify(const T& diff)
{
mBase += diff;
if(mBase >= static_cast<T>(0))
mModified += diff;
else
{
mModified += diff - mBase;
mBase = static_cast<T>(0);
}
}
/// Set base and adjust modified accordingly. /// Set base and adjust modified accordingly.
void setBase (const T& value) void setBase (const T& value);
{
T diff = value - mBase;
mBase = value;
mModified += diff;
}
/// Set modified value an adjust base accordingly. /// Set modified value an adjust base accordingly.
void setModified (T value, const T& min, const T& max = std::numeric_limits<T>::max()) void setModified (T value, const T& min, const T& max = std::numeric_limits<T>::max());
{ void setModifier (const T& modifier);
T diff = value - mModified;
if (mBase+diff<min) void writeState (ESM::StatState<T>& state) const;
{ void readState (const ESM::StatState<T>& state);
value = min + (mModified - mBase);
diff = value - mModified;
}
else if (mBase+diff>max)
{
value = max + (mModified - mBase);
diff = value - mModified;
}
mModified = value;
mBase += diff;
}
void setModifier (const T& modifier)
{
mModified = mBase + modifier;
}
void writeState (ESM::StatState<T>& state) const
{
state.mBase = mBase;
state.mMod = mModified;
}
void readState (const ESM::StatState<T>& state)
{
mBase = state.mBase;
mModified = state.mMod;
}
}; };
template<typename T> template<typename T>
@ -121,98 +67,32 @@ namespace MWMechanics
public: public:
typedef T Type; typedef T Type;
DynamicStat() : mStatic (0), mCurrent (0) {} DynamicStat();
DynamicStat(T base) : mStatic (base), mCurrent (base) {} DynamicStat(T base);
DynamicStat(T base, T modified, T current) : mStatic(base, modified), mCurrent (current) {} DynamicStat(T base, T modified, T current);
DynamicStat(const Stat<T> &stat, T current) : mStatic(stat), mCurrent (current) {} DynamicStat(const Stat<T> &stat, T current);
const T& getBase() const const T& getBase() const;
{ T getModified() const;
return mStatic.getBase(); const T& getCurrent() const;
}
T getModified() const
{
return mStatic.getModified();
}
const T& getCurrent() const
{
return mCurrent;
}
/// Set base, modified and current to \a value. /// Set base, modified and current to \a value.
void set (const T& value) void set (const T& value);
{
mStatic.set (value);
mCurrent = value;
}
/// Set base and adjust modified accordingly. /// Set base and adjust modified accordingly.
void setBase (const T& value) void setBase (const T& value);
{
mStatic.setBase (value);
if (mCurrent>getModified())
mCurrent = getModified();
}
/// Set modified value an adjust base accordingly. /// Set modified value an adjust base accordingly.
void setModified (T value, const T& min, const T& max = std::numeric_limits<T>::max()) void setModified (T value, const T& min, const T& max = std::numeric_limits<T>::max());
{
mStatic.setModified (value, min, max);
if (mCurrent>getModified())
mCurrent = getModified();
}
/// Change modified relatively. /// Change modified relatively.
void modify (const T& diff, bool allowCurrentDecreaseBelowZero=false) void modify (const T& diff, bool allowCurrentDecreaseBelowZero=false);
{
mStatic.modify (diff);
setCurrent (getCurrent()+diff, allowCurrentDecreaseBelowZero);
}
void setCurrent (const T& value, bool allowDecreaseBelowZero = false) void setCurrent (const T& value, bool allowDecreaseBelowZero = false);
{ void setModifier (const T& modifier, bool allowCurrentDecreaseBelowZero=false);
if (value > mCurrent)
{
// increase
mCurrent = value;
if (mCurrent > getModified()) void writeState (ESM::StatState<T>& state) const;
mCurrent = getModified(); void readState (const ESM::StatState<T>& state);
}
else if (value > 0 || allowDecreaseBelowZero)
{
// allowed decrease
mCurrent = value;
}
else if (mCurrent > 0)
{
// capped decrease
mCurrent = 0;
}
}
void setModifier (const T& modifier, bool allowCurrentDecreaseBelowZero=false)
{
T diff = modifier - mStatic.getModifier();
mStatic.setModifier (modifier);
setCurrent (getCurrent()+diff, allowCurrentDecreaseBelowZero);
}
void writeState (ESM::StatState<T>& state) const
{
mStatic.writeState (state);
state.mCurrent = mCurrent;
}
void readState (const ESM::StatState<T>& state)
{
mStatic.readState (state);
mCurrent = state.mCurrent;
}
}; };
template<typename T> template<typename T>
@ -236,26 +116,25 @@ namespace MWMechanics
float mDamage; // needs to be float to allow continuous damage float mDamage; // needs to be float to allow continuous damage
public: public:
AttributeValue() : mBase(0), mModifier(0), mDamage(0) {} AttributeValue();
int getModified() const { return std::max(0, mBase - (int) mDamage + mModifier); } int getModified() const;
int getBase() const { return mBase; } int getBase() const;
int getModifier() const { return mModifier; } int getModifier() const;
void setBase(int base) { mBase = std::max(0, base); } void setBase(int base);
void setModifier(int mod) { mModifier = mod; } void setModifier(int mod);
// Maximum attribute damage is limited to the modified value. // Maximum attribute damage is limited to the modified value.
// Note: I think MW applies damage directly to mModified, since you can also // Note: I think MW applies damage directly to mModified, since you can also
// "restore" drained attributes. We need to rewrite the magic effect system to support this. // "restore" drained attributes. We need to rewrite the magic effect system to support this.
void damage(float damage) { mDamage += std::min(damage, (float)getModified()); } void damage(float damage);
void restore(float amount) { mDamage -= std::min(mDamage, amount); } void restore(float amount);
float getDamage() const { return mDamage; } float getDamage() const;
void writeState (ESM::StatState<int>& state) const; void writeState (ESM::StatState<int>& state) const;
void readState (const ESM::StatState<int>& state); void readState (const ESM::StatState<int>& state);
}; };
@ -263,12 +142,11 @@ namespace MWMechanics
{ {
float mProgress; float mProgress;
public: public:
SkillValue() : mProgress(0) {} SkillValue();
float getProgress() const { return mProgress; } float getProgress() const;
void setProgress(float progress) { mProgress = progress; } void setProgress(float progress);
void writeState (ESM::StatState<int>& state) const; void writeState (ESM::StatState<int>& state) const;
void readState (const ESM::StatState<int>& state); void readState (const ESM::StatState<int>& state);
}; };

View file

@ -8,6 +8,7 @@
#include <osg/PositionAttitudeTransform> #include <osg/PositionAttitudeTransform>
#include <osg/TexEnvCombine> #include <osg/TexEnvCombine>
#include <osg/TexMat> #include <osg/TexMat>
#include <osg/Version>
#include <osgParticle/ParticleSystem> #include <osgParticle/ParticleSystem>
#include <osgParticle/ParticleSystemUpdater> #include <osgParticle/ParticleSystemUpdater>
@ -727,7 +728,11 @@ public:
if (stateset->getAttribute(osg::StateAttribute::MATERIAL)) if (stateset->getAttribute(osg::StateAttribute::MATERIAL))
{ {
SceneUtil::CompositeStateSetUpdater* composite = NULL; SceneUtil::CompositeStateSetUpdater* composite = NULL;
#if OSG_MIN_VERSION_REQUIRED(3,3,3)
osg::Callback* callback = node.getUpdateCallback();
#else
osg::NodeCallback* callback = node.getUpdateCallback(); osg::NodeCallback* callback = node.getUpdateCallback();
#endif
while (callback) while (callback)
{ {
if ((composite = dynamic_cast<SceneUtil::CompositeStateSetUpdater*>(callback))) if ((composite = dynamic_cast<SceneUtil::CompositeStateSetUpdater*>(callback)))

View file

@ -5,6 +5,7 @@
#include <iostream> #include <iostream>
#include <components/misc/stringops.hpp> #include <components/misc/stringops.hpp>
#include <components/esm/esmwriter.hpp>
#include <components/esm/globalscript.hpp> #include <components/esm/globalscript.hpp>
#include "../mwworld/esmstore.hpp" #include "../mwworld/esmstore.hpp"

View file

@ -6,6 +6,8 @@
#include <components/esm/cellid.hpp> #include <components/esm/cellid.hpp>
#include <components/esm/loadcell.hpp> #include <components/esm/loadcell.hpp>
#include <components/loadinglistener/loadinglistener.hpp>
#include <components/misc/stringops.hpp> #include <components/misc/stringops.hpp>
#include <components/settings/settings.hpp> #include <components/settings/settings.hpp>

View file

@ -4,6 +4,7 @@
#include <components/esm/esmwriter.hpp> #include <components/esm/esmwriter.hpp>
#include <components/esm/defs.hpp> #include <components/esm/defs.hpp>
#include <components/esm/cellstate.hpp> #include <components/esm/cellstate.hpp>
#include <components/loadinglistener/loadinglistener.hpp>
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"

View file

@ -5,6 +5,7 @@
#include <components/esm/cellstate.hpp> #include <components/esm/cellstate.hpp>
#include <components/esm/cellid.hpp> #include <components/esm/cellid.hpp>
#include <components/esm/esmreader.hpp>
#include <components/esm/esmwriter.hpp> #include <components/esm/esmwriter.hpp>
#include <components/esm/objectstate.hpp> #include <components/esm/objectstate.hpp>
#include <components/esm/containerstate.hpp> #include <components/esm/containerstate.hpp>

View file

@ -8,6 +8,7 @@
#include <components/loadinglistener/loadinglistener.hpp> #include <components/loadinglistener/loadinglistener.hpp>
#include <components/esm/esmreader.hpp> #include <components/esm/esmreader.hpp>
#include <components/esm/esmwriter.hpp>
namespace MWWorld namespace MWWorld
{ {

View file

@ -1,6 +1,7 @@
#ifndef OPENMW_MWWORLD_ESMSTORE_H #ifndef OPENMW_MWWORLD_ESMSTORE_H
#define OPENMW_MWWORLD_ESMSTORE_H #define OPENMW_MWWORLD_ESMSTORE_H
#include <sstream>
#include <stdexcept> #include <stdexcept>
#include <components/esm/records.hpp> #include <components/esm/records.hpp>

View file

@ -6,6 +6,7 @@
#include <components/esm/loadench.hpp> #include <components/esm/loadench.hpp>
#include <components/esm/inventorystate.hpp> #include <components/esm/inventorystate.hpp>
#include <components/misc/rng.hpp>
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"

View file

@ -2,6 +2,7 @@
#include <osg/PositionAttitudeTransform> #include <osg/PositionAttitudeTransform>
#include <components/esm/esmwriter.hpp>
#include <components/esm/projectilestate.hpp> #include <components/esm/projectilestate.hpp>
#include <components/resource/resourcesystem.hpp> #include <components/resource/resourcesystem.hpp>
#include <components/resource/scenemanager.hpp> #include <components/resource/scenemanager.hpp>

View file

@ -3,6 +3,7 @@
#include <limits> #include <limits>
#include <components/nif/niffile.hpp> #include <components/nif/niffile.hpp>
#include <components/loadinglistener/loadinglistener.hpp>
#include <components/misc/resourcehelpers.hpp> #include <components/misc/resourcehelpers.hpp>
#include <components/settings/settings.hpp> #include <components/settings/settings.hpp>
#include <components/resource/resourcesystem.hpp> #include <components/resource/resourcesystem.hpp>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -5,6 +5,7 @@
#include <components/misc/rng.hpp> #include <components/misc/rng.hpp>
#include <components/esm/esmwriter.hpp>
#include <components/esm/weatherstate.hpp> #include <components/esm/weatherstate.hpp>
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"

View file

@ -12,11 +12,15 @@
#include <osg/ComputeBoundsVisitor> #include <osg/ComputeBoundsVisitor>
#include <osg/PositionAttitudeTransform> #include <osg/PositionAttitudeTransform>
#include <components/esm/esmreader.hpp>
#include <components/esm/esmwriter.hpp>
#include <components/misc/rng.hpp> #include <components/misc/rng.hpp>
#include <components/files/collections.hpp> #include <components/files/collections.hpp>
#include <components/compiler/locals.hpp> #include <components/compiler/locals.hpp>
#include <components/esm/cellid.hpp> #include <components/esm/cellid.hpp>
#include <components/esm/esmreader.hpp>
#include <components/misc/resourcehelpers.hpp> #include <components/misc/resourcehelpers.hpp>
#include <components/resource/resourcesystem.hpp> #include <components/resource/resourcesystem.hpp>

View file

@ -52,6 +52,11 @@ namespace MWRender
class Camera; class Camera;
} }
namespace ToUTF8
{
class Utf8Encoder;
}
struct ContentLoader; struct ContentLoader;
namespace MWWorld namespace MWWorld

View file

@ -1,17 +1,22 @@
version: "{build}" version: "{build}"
branches:
only:
- appveyor
platform: platform:
- Win32 - Win32
- x64 - x64
configuration: configuration: Debug
- Debug
environment: environment:
matrix: matrix:
- STEP: openmw - STEP: misc
- STEP: opencs # - STEP: components # misc builds this too
- STEP: misc # Build takes too long for these, ignore for now
# - STEP: openmw
# - STEP: opencs
matrix: matrix:
fast_finish: true fast_finish: true
@ -32,18 +37,14 @@ cache:
- C:\projects\openmw\deps\ffmpeg64-2.5.2.7z - C:\projects\openmw\deps\ffmpeg64-2.5.2.7z
- C:\projects\openmw\deps\ffmpeg64-2.5.2-dev.7z - C:\projects\openmw\deps\ffmpeg64-2.5.2-dev.7z
init:
- cmd: bash --version
- cmd: cmake --version
- cmd: msbuild /version
- cmd: echo.
clone_folder: C:\projects\openmw clone_folder: C:\projects\openmw
build_script:
- cmd: bash --login C:\projects\openmw\CI\build.msvc.sh
before_build: before_build:
- cmd: bash --login C:\projects\openmw\CI\before_script.msvc.sh - cmd: sh %APPVEYOR_BUILD_FOLDER%\CI\before_script.msvc.sh
build_script:
- cmd: if %PLATFORM%==Win32 set build=Build_32
- cmd: if %PLATFORM%==x64 set build=Build_64
- cmd: msbuild %build%\OpenMW.sln /t:Build /p:Configuration=%configuration% /m:2 /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
test: off test: off

View file

@ -1,4 +1,6 @@
#include "creaturestats.hpp" #include "creaturestats.hpp"
#include "esmreader.hpp"
#include "esmwriter.hpp"
void ESM::CreatureStats::load (ESMReader &esm) void ESM::CreatureStats::load (ESMReader &esm)
{ {

View file

@ -0,0 +1,52 @@
#include "statstate.hpp"
#include "esmreader.hpp"
#include "esmwriter.hpp"
namespace ESM
{
template<typename T>
StatState<T>::StatState() : mBase(0), mMod(0), mCurrent(0), mDamage(0), mProgress(0) {}
template<typename T>
void StatState<T>::load(ESMReader &esm)
{
esm.getHNT(mBase, "STBA");
mMod = 0;
esm.getHNOT(mMod, "STMO");
mCurrent = 0;
esm.getHNOT(mCurrent, "STCU");
// mDamage was changed to a float; ensure backwards compatibility
T oldDamage = 0;
esm.getHNOT(oldDamage, "STDA");
mDamage = static_cast<float>(oldDamage);
esm.getHNOT(mDamage, "STDF");
mProgress = 0;
esm.getHNOT(mProgress, "STPR");
}
template<typename T>
void StatState<T>::save(ESMWriter &esm) const
{
esm.writeHNT("STBA", mBase);
if (mMod != 0)
esm.writeHNT("STMO", mMod);
if (mCurrent)
esm.writeHNT("STCU", mCurrent);
if (mDamage)
esm.writeHNT("STDF", mDamage);
if (mProgress)
esm.writeHNT("STPR", mProgress);
}
}
template struct ESM::StatState<int>;
template struct ESM::StatState<float>;

View file

@ -1,11 +1,11 @@
#ifndef OPENMW_ESM_STATSTATE_H #ifndef OPENMW_ESM_STATSTATE_H
#define OPENMW_ESM_STATSTATE_H #define OPENMW_ESM_STATSTATE_H
#include "esmreader.hpp"
#include "esmwriter.hpp"
namespace ESM namespace ESM
{ {
class ESMReader;
class ESMWriter;
// format 0, saved games only // format 0, saved games only
template<typename T> template<typename T>
@ -23,48 +23,6 @@ namespace ESM
void load (ESMReader &esm); void load (ESMReader &esm);
void save (ESMWriter &esm) const; void save (ESMWriter &esm) const;
}; };
template<typename T>
StatState<T>::StatState() : mBase (0), mMod (0), mCurrent (0), mDamage (0), mProgress (0) {}
template<typename T>
void StatState<T>::load (ESMReader &esm)
{
esm.getHNT (mBase, "STBA");
mMod = 0;
esm.getHNOT (mMod, "STMO");
mCurrent = 0;
esm.getHNOT (mCurrent, "STCU");
// mDamage was changed to a float; ensure backwards compatibility
T oldDamage = 0;
esm.getHNOT(oldDamage, "STDA");
mDamage = static_cast<float>(oldDamage);
esm.getHNOT (mDamage, "STDF");
mProgress = 0;
esm.getHNOT (mProgress, "STPR");
}
template<typename T>
void StatState<T>::save (ESMWriter &esm) const
{
esm.writeHNT ("STBA", mBase);
if (mMod != 0)
esm.writeHNT ("STMO", mMod);
if (mCurrent)
esm.writeHNT ("STCU", mCurrent);
if (mDamage)
esm.writeHNT ("STDF", mDamage);
if (mProgress)
esm.writeHNT ("STPR", mProgress);
}
} }
#endif #endif

View file

@ -11,6 +11,7 @@ namespace SceneUtil
class ControllerSource class ControllerSource
{ {
public: public:
virtual ~ControllerSource() { }
virtual float getValue(osg::NodeVisitor* nv) = 0; virtual float getValue(osg::NodeVisitor* nv) = 0;
}; };