diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9f5442ae42..d815c7d77f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,26 +1,26 @@ -# use the official gcc image, based on debian -# can use verions as well, like gcc:5.2 -# see https://hub.docker.com/_/gcc/ -image: gcc - -cache: - key: apt-cache - paths: - - apt-cache/ - -before_script: - - export APT_CACHE_DIR=`pwd`/apt-cache && mkdir -pv $APT_CACHE_DIR - - apt-get update -yq - - apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -y cmake libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libswresample-dev libsdl2-dev libqt4-dev libopenal-dev libopenscenegraph-3.4-dev libunshield-dev libtinyxml-dev -# - apt-get install -y libmygui-dev libbullet-dev # to be updated to latest below because stretch is too old - - curl http://ftp.us.debian.org/debian/pool/main/b/bullet/libbullet-dev_2.87+dfsg-2_amd64.deb -o libbullet-dev_2.87+dfsg-2_amd64.deb - - curl http://ftp.us.debian.org/debian/pool/main/b/bullet/libbullet2.87_2.87+dfsg-2_amd64.deb -o libbullet2.87_2.87+dfsg-2_amd64.deb - - curl http://ftp.us.debian.org/debian/pool/main/m/mygui/libmygui.openglplatform0debian1v5_3.2.2+dfsg-1_amd64.deb -o libmygui.openglplatform0debian1v5_3.2.2+dfsg-1_amd64.deb - - curl http://ftp.us.debian.org/debian/pool/main/m/mygui/libmyguiengine3debian1v5_3.2.2+dfsg-1_amd64.deb -o libmyguiengine3debian1v5_3.2.2+dfsg-1_amd64.deb - - curl http://ftp.us.debian.org/debian/pool/main/m/mygui/libmygui-dev_3.2.2+dfsg-1_amd64.deb -o libmygui-dev_3.2.2+dfsg-1_amd64.deb - - dpkg --ignore-depends=libmygui.ogreplatform0debian1v5 -i *.deb - -build: +stages: + - build + +Debian: + tags: + - docker + - linux + image: gcc + cache: + key: apt-cache + paths: + - apt-cache/ + before_script: + - export APT_CACHE_DIR=`pwd`/apt-cache && mkdir -pv $APT_CACHE_DIR + - apt-get update -yq + - apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -y cmake libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libswresample-dev libsdl2-dev libqt4-dev libopenal-dev libopenscenegraph-3.4-dev libunshield-dev libtinyxml-dev + # - apt-get install -y libmygui-dev libbullet-dev # to be updated to latest below because stretch is too old + - curl http://ftp.us.debian.org/debian/pool/main/b/bullet/libbullet-dev_2.87+dfsg-2_amd64.deb -o libbullet-dev_2.87+dfsg-2_amd64.deb + - curl http://ftp.us.debian.org/debian/pool/main/b/bullet/libbullet2.87_2.87+dfsg-2_amd64.deb -o libbullet2.87_2.87+dfsg-2_amd64.deb + - curl http://ftp.us.debian.org/debian/pool/main/m/mygui/libmygui.openglplatform0debian1v5_3.2.2+dfsg-1_amd64.deb -o libmygui.openglplatform0debian1v5_3.2.2+dfsg-1_amd64.deb + - curl http://ftp.us.debian.org/debian/pool/main/m/mygui/libmyguiengine3debian1v5_3.2.2+dfsg-1_amd64.deb -o libmyguiengine3debian1v5_3.2.2+dfsg-1_amd64.deb + - curl http://ftp.us.debian.org/debian/pool/main/m/mygui/libmygui-dev_3.2.2+dfsg-1_amd64.deb -o libmygui-dev_3.2.2+dfsg-1_amd64.deb + - dpkg --ignore-depends=libmygui.ogreplatform0debian1v5 -i *.deb stage: build script: - cores_to_use=$((`nproc`-2)); if (( $cores_to_use < 1 )); then cores_to_use=1; fi @@ -30,13 +30,17 @@ build: artifacts: paths: - build/artifacts/ - # depending on your build setup it's most likely a good idea to cache outputs to reduce the build time - cache: +MacOS: + tags: + - macos + - xcode + stage: build + allow_failure: true + script: + - rm -fr build/* # remove anything in the build directory + - CI/before_install.osx.sh + - CI/before_script.osx.sh + - cd build; make -j2 package + artifacts: paths: - - "*.o" - -# TODO: run tests using the binary built before -#test: -# stage: test -# script: -# - ls + - build/OpenMW-*.dmg \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 7d2e6a795b..c6facef2ba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,6 @@ env: # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created # via the "travis encrypt" command using the project repo's public key - secure: "jybGzAdUbqt9vWR/GEnRd96BgAi/7Zd1+2HK68j/i/8+/1YH2XxLOy4Jv/DUBhBlJIkxs/Xv8dRcUlFOclZDHX1d/9Qnsqd3oUVkD7k1y7cTOWy9TBQaE/v/kZo3LpzA3xPwwthrb0BvqIbOfIELi5fS5s8ba85WFRg3AX70wWE=" - - macos_qt_formula=qt addons: apt: sources: diff --git a/CHANGELOG.md b/CHANGELOG.md index 782a817e82..8379b6bea4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,7 @@ Bug #4036: Weird behaviour of AI packages if package target has non-unique ID Bug #4047: OpenMW not reporting its version number in MacOS; OpenMW-CS not doing it fully Bug #4125: OpenMW logo cropped on bugtracker - Bug #4215: OpenMW shows book text after last
tag + Bug #4215: OpenMW shows book text after last EOL tag Bug #4221: Characters get stuck in V-shaped terrain Bug #4251: Stationary NPCs do not return to their position after combat Bug #4286: Scripted animations can be interrupted @@ -49,6 +49,7 @@ Bug #4461: "Open" spell from non-player caster isn't a crime Bug #4469: Abot Silt Striders – Model turn 90 degrees on horizontal Bug #4471: Retrieve SDL window settings instead of using magic numbers + Bug #4474: No fallback when getVampireHead fails Feature #3276: Editor: Search- Show number of (remaining) search results and indicate a search without any results Feature #4222: 360° screenshots Feature #4256: Implement ToggleBorders (TB) console command diff --git a/CI/before_install.osx.sh b/CI/before_install.osx.sh index 47f4021cfe..2ab996b10f 100755 --- a/CI/before_install.osx.sh +++ b/CI/before_install.osx.sh @@ -4,7 +4,7 @@ brew update brew outdated cmake || brew upgrade cmake brew outdated pkgconfig || brew upgrade pkgconfig -brew install $macos_qt_formula +brew install qt -curl https://downloads.openmw.org/osx/dependencies/openmw-deps-100d2e0.zip -o ~/openmw-deps.zip -unzip ~/openmw-deps.zip -d /private/tmp/openmw-deps > /dev/null +curl -fSL -R -J https://downloads.openmw.org/osx/dependencies/openmw-deps-100d2e0.zip -o ~/openmw-deps.zip +unzip -o ~/openmw-deps.zip -d /private/tmp/openmw-deps > /dev/null diff --git a/CI/before_script.osx.sh b/CI/before_script.osx.sh index 2d1cf8729d..8ee01b652d 100755 --- a/CI/before_script.osx.sh +++ b/CI/before_script.osx.sh @@ -4,7 +4,7 @@ export CXX=clang++ export CC=clang DEPENDENCIES_ROOT="/private/tmp/openmw-deps/openmw-deps" -QT_PATH=`brew --prefix $macos_qt_formula` +QT_PATH=`brew --prefix qt` mkdir build cd build diff --git a/apps/openmw/mwgui/formatting.cpp b/apps/openmw/mwgui/formatting.cpp index 16568e2f34..edcb94eed9 100644 --- a/apps/openmw/mwgui/formatting.cpp +++ b/apps/openmw/mwgui/formatting.cpp @@ -31,13 +31,16 @@ namespace MWGui boost::algorithm::replace_all(mText, "\r", ""); - // vanilla game does not show any text after last
tag. + // vanilla game does not show any text after the last EOL tag. const std::string lowerText = Misc::StringUtils::lowerCase(mText); - int index = lowerText.rfind("
"); - if (index == -1) + int brIndex = lowerText.rfind("
"); + int pIndex = lowerText.rfind("

"); + if (brIndex == pIndex) mText = ""; + else if (brIndex > pIndex) + mText = mText.substr(0, brIndex+4); else - mText = mText.substr(0, index+4); + mText = mText.substr(0, pIndex+3); registerTag("br", Event_BrTag); registerTag("p", Event_PTag); diff --git a/apps/openmw/mwgui/hud.cpp b/apps/openmw/mwgui/hud.cpp index 23eb499dee..1841303f25 100644 --- a/apps/openmw/mwgui/hud.cpp +++ b/apps/openmw/mwgui/hud.cpp @@ -158,7 +158,9 @@ namespace MWGui getWidget(mCrosshair, "Crosshair"); - LocalMapBase::init(mMinimap, mCompass, Settings::Manager::getInt("local map hud widget size", "Map"), Settings::Manager::getInt("local map cell distance", "Map")); + int mapSize = std::max(1, Settings::Manager::getInt("local map hud widget size", "Map")); + int cellDistance = std::max(1, Settings::Manager::getInt("local map cell distance", "Map")); + LocalMapBase::init(mMinimap, mCompass, mapSize, cellDistance); mMainWidget->eventMouseButtonClick += MyGUI::newDelegate(this, &HUD::onWorldClicked); mMainWidget->eventMouseMove += MyGUI::newDelegate(this, &HUD::onWorldMouseOver); diff --git a/apps/openmw/mwgui/mapwindow.cpp b/apps/openmw/mwgui/mapwindow.cpp index d3c1ec292a..c1ff9510d3 100644 --- a/apps/openmw/mwgui/mapwindow.cpp +++ b/apps/openmw/mwgui/mapwindow.cpp @@ -679,7 +679,9 @@ namespace MWGui mEventBoxLocal->eventMouseButtonPressed += MyGUI::newDelegate(this, &MapWindow::onDragStart); mEventBoxLocal->eventMouseButtonDoubleClick += MyGUI::newDelegate(this, &MapWindow::onMapDoubleClicked); - LocalMapBase::init(mLocalMap, mPlayerArrowLocal, Settings::Manager::getInt("local map widget size", "Map"), Settings::Manager::getInt("local map cell distance", "Map")); + int mapSize = std::max(1, Settings::Manager::getInt("local map widget size", "Map")); + int cellDistance = std::max(1, Settings::Manager::getInt("local map cell distance", "Map")); + LocalMapBase::init(mLocalMap, mPlayerArrowLocal, mapSize, cellDistance); mGlobalMap->setVisible(mGlobal); mLocalMap->setVisible(!mGlobal); diff --git a/apps/openmw/mwrender/npcanimation.cpp b/apps/openmw/mwrender/npcanimation.cpp index 08e376f083..baf6cb8229 100644 --- a/apps/openmw/mwrender/npcanimation.cpp +++ b/apps/openmw/mwrender/npcanimation.cpp @@ -416,6 +416,7 @@ void NpcAnimation::updateNpcBase() const ESM::Race *race = store.get().find(mNpc->mRace); bool isWerewolf = (mNpcType == Type_Werewolf); bool isVampire = (mNpcType == Type_Vampire); + bool isFemale = !mNpc->isMale(); if (isWerewolf) { @@ -425,8 +426,9 @@ void NpcAnimation::updateNpcBase() else { mHeadModel = ""; - if (isVampire) // FIXME: fall back to regular head when getVampireHead fails? - mHeadModel = getVampireHead(mNpc->mRace, mNpc->mFlags & ESM::NPC::Female); + const std::string& vampireHead = getVampireHead(mNpc->mRace, isFemale); + if (isVampire && !vampireHead.empty()) + mHeadModel = vampireHead; else if (!mNpc->mHead.empty()) { const ESM::BodyPart* bp = store.get().search(mNpc->mHead); @@ -448,7 +450,6 @@ void NpcAnimation::updateNpcBase() } bool isBeast = (race->mData.mFlags & ESM::Race::Beast) != 0; - bool isFemale = !mNpc->isMale(); std::string smodel; if (mViewMode != VM_FirstPerson) diff --git a/apps/openmw/mwscript/locals.cpp b/apps/openmw/mwscript/locals.cpp index 9dd9d338ed..64f3058eb2 100644 --- a/apps/openmw/mwscript/locals.cpp +++ b/apps/openmw/mwscript/locals.cpp @@ -240,6 +240,10 @@ namespace MWScript char type = declarations.getType (iter->first); int index2 = declarations.getIndex (iter->first); + // silently ignore locals that don't exist anymore + if (type == ' ' || index2 == -1) + continue; + try { switch (type) @@ -247,8 +251,6 @@ namespace MWScript case 's': mShorts.at (index2) = iter->second.getInteger(); break; case 'l': mLongs.at (index2) = iter->second.getInteger(); break; case 'f': mFloats.at (index2) = iter->second.getFloat(); break; - - // silently ignore locals that don't exist anymore } } catch (...) diff --git a/apps/openmw/mwsound/openal_output.cpp b/apps/openmw/mwsound/openal_output.cpp index 31d46ce311..f4587130e0 100644 --- a/apps/openmw/mwsound/openal_output.cpp +++ b/apps/openmw/mwsound/openal_output.cpp @@ -387,7 +387,7 @@ private: OpenAL_SoundStream::OpenAL_SoundStream(ALuint src, DecoderPtr decoder) : mSource(src), mCurrentBufIdx(0), mFormat(AL_NONE), mSampleRate(0) , mBufferSize(0), mFrameSize(0), mSilence(0), mDecoder(std::move(decoder)) - , mLoudnessAnalyzer(nullptr) + , mLoudnessAnalyzer(nullptr), mIsFinished(true) { mBuffers.fill(0); } diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 83d27f6d83..9de4da1ee2 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -1179,8 +1179,8 @@ namespace MWWorld } else { - bool currCellActive = mWorldScene->isCellActive(*currCell); - bool newCellActive = mWorldScene->isCellActive(*newCell); + bool currCellActive = currCell && mWorldScene->isCellActive(*currCell); + bool newCellActive = newCell && mWorldScene->isCellActive(*newCell); if (!currCellActive && newCellActive) { newPtr = currCell->moveTo(ptr, newCell); diff --git a/components/esm/loadland.hpp b/components/esm/loadland.hpp index 2163c30fc7..cccb472de9 100644 --- a/components/esm/loadland.hpp +++ b/components/esm/loadland.hpp @@ -83,7 +83,12 @@ struct Land struct LandData { LandData() - : mDataLoaded(0) + : mHeightOffset(0) + , mMinHeight(0) + , mMaxHeight(0) + , mUnk1(0) + , mUnk2(0) + , mDataLoaded(0) { } diff --git a/components/esm/loadpgrd.hpp b/components/esm/loadpgrd.hpp index d1003eb865..4e74c9a24d 100644 --- a/components/esm/loadpgrd.hpp +++ b/components/esm/loadpgrd.hpp @@ -36,7 +36,10 @@ struct Pathgrid Point& operator=(const float[3]); Point(const float[3]); Point(); - Point(int x, int y, int z) : mX(x), mY(y), mZ(z) {} + Point(int x, int y, int z) + : mX(x), mY(y), mZ(z) + , mAutogenerated(0), mConnectionNum(0), mUnknown(0) + {} }; // 16 bytes struct Edge // path grid edge diff --git a/components/esm/objectstate.hpp b/components/esm/objectstate.hpp index b8eb138ebe..d14c04b648 100644 --- a/components/esm/objectstate.hpp +++ b/components/esm/objectstate.hpp @@ -34,7 +34,9 @@ namespace ESM ESM::AnimationState mAnimationState; - ObjectState() : mHasCustomState(true), mVersion(0) + ObjectState() + : mHasLocals(0), mEnabled(0), mCount(0) + , mFlags(0), mHasCustomState(true), mVersion(0) {} /// @note Does not load the CellRef ID, it should already be loaded before calling this method diff --git a/components/esmterrain/storage.cpp b/components/esmterrain/storage.cpp index 52850fd746..ff3123c5b8 100644 --- a/components/esmterrain/storage.cpp +++ b/components/esmterrain/storage.cpp @@ -24,6 +24,8 @@ namespace ESMTerrain }; LandObject::LandObject() + : mLand(nullptr) + , mLoadFlags(0) { } diff --git a/components/terrain/quadtreenode.cpp b/components/terrain/quadtreenode.cpp index 0394adea7f..f4fc8df897 100644 --- a/components/terrain/quadtreenode.cpp +++ b/components/terrain/quadtreenode.cpp @@ -61,6 +61,7 @@ QuadTreeNode::QuadTreeNode(QuadTreeNode* parent, ChildDirection direction, float , mValidBounds(false) , mSize(size) , mCenter(center) + , mViewDataMap(nullptr) { for (unsigned int i=0; i<4; ++i) mNeighbours[i] = 0; diff --git a/components/widgets/windowcaption.cpp b/components/widgets/windowcaption.cpp index bcb0a7c125..1c8fb5608d 100644 --- a/components/widgets/windowcaption.cpp +++ b/components/widgets/windowcaption.cpp @@ -8,6 +8,7 @@ namespace Gui WindowCaption::WindowCaption() : mLeft(NULL) , mRight(NULL) + , mClient(NULL) { }