From 224b94c0ce02349fbdfc99300f0350ad37b9581e Mon Sep 17 00:00:00 2001 From: Nikolay Kasyanov Date: Sat, 9 Jun 2018 10:55:34 +0200 Subject: [PATCH 01/18] Decompress cursors using SDL software renderer on Mac or if OSG >= 3.5.8 --- CHANGELOG.md | 1 + components/sdlutil/sdlcursormanager.cpp | 83 ++++++++++++++++++++----- 2 files changed, 70 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb72c7cac..6210f3f11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ Bug #4433: Guard behaviour is incorrect with Alarm = 0 Bug #4443: Goodbye option and dialogue choices are not mutually exclusive Feature #4444: Per-group KF-animation files support + Bug #4424: [macOS] Cursor is either empty or garbage when compiled against macOS 10.13 SDK 0.44.0 ------ diff --git a/components/sdlutil/sdlcursormanager.cpp b/components/sdlutil/sdlcursormanager.cpp index 65aa2106f..368d8e502 100644 --- a/components/sdlutil/sdlcursormanager.cpp +++ b/components/sdlutil/sdlcursormanager.cpp @@ -7,11 +7,14 @@ #include #include +#include +#include #include #include #include #include +#include #include #include "imagetosurface.hpp" @@ -22,6 +25,13 @@ USE_GRAPHICSWINDOW() #endif +#if OSG_VERSION_GREATER_OR_EQUAL(3, 5, 8) || defined(__APPLE__) +#define OPENMW_USE_SOFTWARE_CURSOR_DECOMPRESSION 1 +#else +#define OPENMW_USE_SOFTWARE_CURSOR_DECOMPRESSION 0 +#endif + +#if !OPENMW_USE_SOFTWARE_CURSOR_DECOMPRESSION namespace { @@ -132,17 +142,6 @@ namespace osg::ref_ptr geom; -#if defined(__APPLE__) - // Extra flip needed on OS X systems due to a driver bug - const char* envval = getenv("OPENMW_CURSOR_WORKAROUND"); - bool workaround = !envval || envval == std::string("1"); - std::string vendorString = (const char*)glGetString(GL_VENDOR); - if (!envval) - workaround = vendorString.find("Intel") != std::string::npos || vendorString.find("ATI") != std::string::npos || vendorString.find("AMD") != std::string::npos; - if (workaround) - geom = osg::createTexturedQuadGeometry(osg::Vec3(-1,1,0), osg::Vec3(2,0,0), osg::Vec3(0,-2,0)); - else -#endif geom = osg::createTexturedQuadGeometry(osg::Vec3(-1,-1,0), osg::Vec3(2,0,0), osg::Vec3(0,2,0)); geom->drawImplementation(renderInfo); @@ -157,6 +156,7 @@ namespace } } +#endif namespace SDLUtil { @@ -220,13 +220,63 @@ namespace SDLUtil #endif } +#if OPENMW_USE_SOFTWARE_CURSOR_DECOMPRESSION + typedef std::unique_ptr SDLSurfacePtr; + + SDLSurfacePtr decompress(osg::Image* source, int rotDegrees) + { + int width = source->s(); + int height = source->t(); + bool useAlpha = source->isImageTranslucent(); + + osg::ref_ptr decompressedImage = new osg::Image; + decompressedImage->setFileName(source->getFileName()); + decompressedImage->allocateImage(width, height, 1, useAlpha ? GL_RGBA : GL_RGB, GL_UNSIGNED_BYTE); + for (int s=0; ssetColor(source->getColor(s,t,0), s,t,0); + + Uint32 redMask = 0x000000ff; + Uint32 greenMask = 0x0000ff00; + Uint32 blueMask = 0x00ff0000; + Uint32 alphaMask = useAlpha ? 0xff000000 : 0; + + SDL_Surface *cursorSurface = SDL_CreateRGBSurfaceFrom(decompressedImage->data(), + width, + height, + decompressedImage->getPixelSizeInBits(), + decompressedImage->getRowSizeInBytes(), + redMask, + greenMask, + blueMask, + alphaMask); + + SDL_Surface *targetSurface = SDL_CreateRGBSurface(0, width, height, 32, redMask, greenMask, blueMask, alphaMask); + SDL_Renderer *renderer = SDL_CreateSoftwareRenderer(targetSurface); + + SDL_RenderClear(renderer); + + SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "1"); + SDL_Texture *cursorTexture = SDL_CreateTextureFromSurface(renderer, cursorSurface); + + SDL_RenderCopyEx(renderer, cursorTexture, NULL, NULL, -rotDegrees, NULL, SDL_FLIP_VERTICAL); + + SDL_DestroyTexture(cursorTexture); + SDL_FreeSurface(cursorSurface); + SDL_DestroyRenderer(renderer); + + return SDLSurfacePtr(targetSurface, SDL_FreeSurface); + } +#endif + void SDLCursorManager::_createCursorFromResource(const std::string& name, int rotDegrees, osg::Image* image, Uint8 hotspot_x, Uint8 hotspot_y) { - osg::ref_ptr decompressed; - if (mCursorMap.find(name) != mCursorMap.end()) return; +#if !OPENMW_USE_SOFTWARE_CURSOR_DECOMPRESSION + osg::ref_ptr decompressed; + try { decompressed = decompress(image, static_cast(rotDegrees)); } catch (std::exception& e) { @@ -239,10 +289,15 @@ namespace SDLUtil //set the cursor and store it for later SDL_Cursor* curs = SDL_CreateColorCursor(surf, hotspot_x, hotspot_y); - mCursorMap.insert(CursorMap::value_type(std::string(name), curs)); //clean up SDL_FreeSurface(surf); +#else + auto surf = decompress(image, rotDegrees); + //set the cursor and store it for later + SDL_Cursor* curs = SDL_CreateColorCursor(surf.get(), hotspot_x, hotspot_y); +#endif + mCursorMap.insert(CursorMap::value_type(std::string(name), curs)); } } From 94f695cffc8307c53c94e314b9380e3b8b27ab06 Mon Sep 17 00:00:00 2001 From: wareya Date: Tue, 12 Jun 2018 21:04:27 -0400 Subject: [PATCH 02/18] Fix #4452 and remove dead code --- components/esmterrain/storage.cpp | 22 ++++++++------------ components/esmterrain/storage.hpp | 2 -- components/terrain/material.cpp | 34 ++++++++++++++++++++++++++++--- components/terrain/storage.hpp | 2 -- 4 files changed, 39 insertions(+), 21 deletions(-) diff --git a/components/esmterrain/storage.cpp b/components/esmterrain/storage.cpp index dadc64f57..52850fd74 100644 --- a/components/esmterrain/storage.cpp +++ b/components/esmterrain/storage.cpp @@ -361,6 +361,11 @@ namespace ESMTerrain std::string Storage::getTextureName(UniqueTextureId id) { + // Goes under used terrain blend transitions + static const std::string baseTexture = "textures\\tx_black_01.dds"; + if (id.first == -1) + return baseTexture; + static const std::string defaultTexture = "textures\\_land_default.dds"; if (id.first == 0) return defaultTexture; // Not sure if the default texture really is hardcoded? @@ -396,11 +401,9 @@ namespace ESMTerrain // Save the used texture indices so we know the total number of textures // and number of required blend maps std::set textureIndices; - // Due to the way the blending works, the base layer will always shine through in between - // blend transitions (eg halfway between two texels, both blend values will be 0.5, so 25% of base layer visible). - // To get a consistent look, we need to make sure to use the same base layer in all cells. - // So we're always adding _land_default.dds as the base layer here, even if it's not referenced in this cell. - textureIndices.insert(std::make_pair(0,0)); + // Due to the way the blending works, the base layer will bleed between texture transitions so we want it to be a black texture + // The subsequent passes are added instead of blended, so this gives the correct result + textureIndices.insert(std::make_pair(-1,0)); // -1 goes to tx_black_01 LandCache cache; @@ -618,15 +621,6 @@ namespace ESMTerrain return info; } - Terrain::LayerInfo Storage::getDefaultLayer() - { - Terrain::LayerInfo info; - info.mDiffuseMap = "textures\\_land_default.dds"; - info.mParallax = false; - info.mSpecular = false; - return info; - } - float Storage::getCellWorldSize() { return static_cast(ESM::Land::REAL_SIZE); diff --git a/components/esmterrain/storage.hpp b/components/esmterrain/storage.hpp index 0bb24a4ab..f3300f748 100644 --- a/components/esmterrain/storage.hpp +++ b/components/esmterrain/storage.hpp @@ -94,8 +94,6 @@ namespace ESMTerrain virtual float getHeightAt (const osg::Vec3f& worldPos); - virtual Terrain::LayerInfo getDefaultLayer(); - /// Get the transformation factor for mapping cell units to world units. virtual float getCellWorldSize(); diff --git a/components/terrain/material.cpp b/components/terrain/material.cpp index 56ace0e5a..722df9507 100644 --- a/components/terrain/material.cpp +++ b/components/terrain/material.cpp @@ -2,11 +2,13 @@ #include +#include #include #include #include #include #include +#include #include @@ -59,24 +61,52 @@ namespace Terrain } return depth; } + osg::ref_ptr getLequalDepth() + { + static osg::ref_ptr depth; + if (!depth) + { + depth = new osg::Depth; + depth->setFunction(osg::Depth::LEQUAL); + } + return depth; + } std::vector > createPasses(bool useShaders, bool forcePerPixelLighting, bool clampLighting, Shader::ShaderManager* shaderManager, const std::vector &layers, const std::vector > &blendmaps, int blendmapScale, float layerTileSize) { std::vector > passes; - bool firstLayer = true; unsigned int blendmapIndex = 0; unsigned int passIndex = 0; for (std::vector::const_iterator it = layers.begin(); it != layers.end(); ++it) { + bool firstLayer = (it == layers.begin()); + osg::ref_ptr stateset (new osg::StateSet); if (!firstLayer) { + static osg::ref_ptr blendFunc; + if (!blendFunc) + { + blendFunc= new osg::BlendFunc(); + blendFunc->setFunction(osg::BlendFunc::SRC_ALPHA, osg::BlendFunc::ONE); + } stateset->setMode(GL_BLEND, osg::StateAttribute::ON); + stateset->setAttributeAndModes(blendFunc, osg::StateAttribute::ON); + stateset->setAttributeAndModes(getEqualDepth(), osg::StateAttribute::ON); } + // disable fog if we're the first layer of several - supposed to be completely black + if (firstLayer && blendmaps.size() > 0) + { + osg::ref_ptr fog (new osg::Fog); + fog->setStart(10000000); + fog->setEnd(10000000); + stateset->setAttributeAndModes(fog, osg::StateAttribute::OFF|osg::StateAttribute::OVERRIDE); + stateset->setAttributeAndModes(getLequalDepth(), osg::StateAttribute::ON); + } int texunit = 0; @@ -158,8 +188,6 @@ namespace Terrain stateset->setTextureAttributeAndModes(texunit, getLayerTexMat(layerTileSize), osg::StateAttribute::ON); } - firstLayer = false; - stateset->setRenderBinDetails(passIndex++, "RenderBin"); passes.push_back(stateset); diff --git a/components/terrain/storage.hpp b/components/terrain/storage.hpp index a4a8bc9fd..ebac1148c 100644 --- a/components/terrain/storage.hpp +++ b/components/terrain/storage.hpp @@ -72,8 +72,6 @@ namespace Terrain virtual float getHeightAt (const osg::Vec3f& worldPos) = 0; - virtual LayerInfo getDefaultLayer() = 0; - /// Get the transformation factor for mapping cell units to world units. virtual float getCellWorldSize() = 0; From bd4badc1531b3f7939267e18e81382b9621da21a Mon Sep 17 00:00:00 2001 From: wareya Date: Tue, 12 Jun 2018 21:05:12 -0400 Subject: [PATCH 03/18] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f407a156e..fd9325d0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ Bug #4429: [Windows] Error on build INSTALL.vcxproj project (debug) with cmake 3.7.2 Bug #4432: Guards behaviour is incorrect if they do not have AI packages Bug #4433: Guard behaviour is incorrect with Alarm = 0 + Bug #4452: Default terrain texture bleeds through texture transitions Feature #4345: Add equivalents for the command line commands to Launcher Feature #4444: Per-group KF-animation files support From 2854f6ca839d4d77b9bb335762911bd692c4974d Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Thu, 14 Jun 2018 21:32:40 +0400 Subject: [PATCH 04/18] Handle exception if we try to play non-music file (bug #4416) --- CHANGELOG.md | 1 + apps/openmw/mwsound/ffmpeg_decoder.cpp | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a59aca8e..22b589ed1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ Bug #4327: Missing animations during spell/weapon stance switching Bug #4368: Settings window ok button doesn't have key focus by default Bug #4393: NPCs walk back to where they were after using ResetActors + Bug #4416: Handle exception if we try to play non-music file Bug #4419: MRK NiStringExtraData is handled incorrectly Bug #4426: RotateWorld behavior is incorrect Bug #4429: [Windows] Error on build INSTALL.vcxproj project (debug) with cmake 3.7.2 diff --git a/apps/openmw/mwsound/ffmpeg_decoder.cpp b/apps/openmw/mwsound/ffmpeg_decoder.cpp index e2d54876f..f458c0a97 100644 --- a/apps/openmw/mwsound/ffmpeg_decoder.cpp +++ b/apps/openmw/mwsound/ffmpeg_decoder.cpp @@ -251,21 +251,24 @@ void FFmpeg_Decoder::open(const std::string &fname) if(mOutputChannelLayout == 0) mOutputChannelLayout = av_get_default_channel_layout((*mStream)->codec->channels); } - catch(...) { + catch(...) + { if(mStream) avcodec_close((*mStream)->codec); mStream = NULL; - if (mFormatCtx->pb->buffer != NULL) + if (mFormatCtx != NULL) { - av_free(mFormatCtx->pb->buffer); - mFormatCtx->pb->buffer = NULL; - } - av_free(mFormatCtx->pb); - mFormatCtx->pb = NULL; + if (mFormatCtx->pb->buffer != NULL) + { + av_free(mFormatCtx->pb->buffer); + mFormatCtx->pb->buffer = NULL; + } + av_free(mFormatCtx->pb); + mFormatCtx->pb = NULL; - avformat_close_input(&mFormatCtx); - throw; + avformat_close_input(&mFormatCtx); + } } } From 359f87ab9f4ad628b231705bcfd7b5f76c30071f Mon Sep 17 00:00:00 2001 From: Nikolay Kasyanov Date: Sat, 16 Jun 2018 12:12:32 +0200 Subject: [PATCH 05/18] Change imageToSurface to return a unique_ptr to avoid manual surface cleanup --- apps/openmw/engine.cpp | 5 ++--- components/sdlutil/imagetosurface.cpp | 4 ++-- components/sdlutil/imagetosurface.hpp | 6 ++++-- components/sdlutil/sdlcursormanager.cpp | 17 +++++------------ 4 files changed, 13 insertions(+), 19 deletions(-) diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index 78e368cfc..65ea181fb 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -428,9 +428,8 @@ void OMW::Engine::setWindowIcon() else { osg::ref_ptr image = result.getImage(); - SDL_Surface* surface = SDLUtil::imageToSurface(image, true); - SDL_SetWindowIcon(mWindow, surface); - SDL_FreeSurface(surface); + auto surface = SDLUtil::imageToSurface(image, true); + SDL_SetWindowIcon(mWindow, surface.get()); } } diff --git a/components/sdlutil/imagetosurface.cpp b/components/sdlutil/imagetosurface.cpp index 6313c0a8f..6e68c0f45 100644 --- a/components/sdlutil/imagetosurface.cpp +++ b/components/sdlutil/imagetosurface.cpp @@ -6,7 +6,7 @@ namespace SDLUtil { -SDL_Surface* imageToSurface(osg::Image *image, bool flip) +SurfaceUniquePtr imageToSurface(osg::Image *image, bool flip) { int width = image->s(); int height = image->t(); @@ -22,7 +22,7 @@ SDL_Surface* imageToSurface(osg::Image *image, bool flip) static_cast(clr.g() * 255), static_cast(clr.b() * 255), static_cast(clr.a() * 255)); } - return surface; + return SurfaceUniquePtr(surface, SDL_FreeSurface); } } diff --git a/components/sdlutil/imagetosurface.hpp b/components/sdlutil/imagetosurface.hpp index ad0457433..9ce56b909 100644 --- a/components/sdlutil/imagetosurface.hpp +++ b/components/sdlutil/imagetosurface.hpp @@ -1,6 +1,8 @@ #ifndef OPENMW_COMPONENTS_SDLUTIL_IMAGETOSURFACE_H #define OPENMW_COMPONENTS_SDLUTIL_IMAGETOSURFACE_H +#include + struct SDL_Surface; namespace osg @@ -10,10 +12,10 @@ namespace osg namespace SDLUtil { + typedef std::unique_ptr SurfaceUniquePtr; /// Convert an osg::Image to an SDL_Surface. - /// @note The returned surface must be freed using SDL_FreeSurface. - SDL_Surface* imageToSurface(osg::Image* image, bool flip=false); + SurfaceUniquePtr imageToSurface(osg::Image* image, bool flip=false); } diff --git a/components/sdlutil/sdlcursormanager.cpp b/components/sdlutil/sdlcursormanager.cpp index 368d8e502..bf265dc7e 100644 --- a/components/sdlutil/sdlcursormanager.cpp +++ b/components/sdlutil/sdlcursormanager.cpp @@ -221,9 +221,7 @@ namespace SDLUtil } #if OPENMW_USE_SOFTWARE_CURSOR_DECOMPRESSION - typedef std::unique_ptr SDLSurfacePtr; - - SDLSurfacePtr decompress(osg::Image* source, int rotDegrees) + SurfaceUniquePtr decompress(osg::Image* source, int rotDegrees) { int width = source->s(); int height = source->t(); @@ -265,7 +263,7 @@ namespace SDLUtil SDL_FreeSurface(cursorSurface); SDL_DestroyRenderer(renderer); - return SDLSurfacePtr(targetSurface, SDL_FreeSurface); + return SurfaceUniquePtr(targetSurface, SDL_FreeSurface); } #endif @@ -285,18 +283,13 @@ namespace SDLUtil return; } - SDL_Surface* surf = SDLUtil::imageToSurface(decompressed, true); - - //set the cursor and store it for later - SDL_Cursor* curs = SDL_CreateColorCursor(surf, hotspot_x, hotspot_y); - - //clean up - SDL_FreeSurface(surf); + auto surf = SDLUtil::imageToSurface(decompressed, true); #else auto surf = decompress(image, rotDegrees); +#endif //set the cursor and store it for later SDL_Cursor* curs = SDL_CreateColorCursor(surf.get(), hotspot_x, hotspot_y); -#endif + mCursorMap.insert(CursorMap::value_type(std::string(name), curs)); } From 75d79e98b9d91b3f251c5dbfbf4c5a3589292cc2 Mon Sep 17 00:00:00 2001 From: Nikolay Kasyanov Date: Sat, 16 Jun 2018 12:38:16 +0200 Subject: [PATCH 06/18] Force software decompression if OPENMW_DECOMPRESS_TEXTURES is set --- components/sdlutil/sdlcursormanager.cpp | 140 ++++++++++++------------ 1 file changed, 68 insertions(+), 72 deletions(-) diff --git a/components/sdlutil/sdlcursormanager.cpp b/components/sdlutil/sdlcursormanager.cpp index bf265dc7e..1747c9b94 100644 --- a/components/sdlutil/sdlcursormanager.cpp +++ b/components/sdlutil/sdlcursormanager.cpp @@ -25,15 +25,14 @@ USE_GRAPHICSWINDOW() #endif -#if OSG_VERSION_GREATER_OR_EQUAL(3, 5, 8) || defined(__APPLE__) -#define OPENMW_USE_SOFTWARE_CURSOR_DECOMPRESSION 1 -#else -#define OPENMW_USE_SOFTWARE_CURSOR_DECOMPRESSION 0 -#endif - -#if !OPENMW_USE_SOFTWARE_CURSOR_DECOMPRESSION -namespace +namespace CursorDecompression { + // macOS builds use the OSG fork that includes DXTC commit + #if OSG_VERSION_GREATER_OR_EQUAL(3, 5, 8) || defined(__APPLE__) + static const bool DXTCSupported = true; + #else + static const bool DXTCSupported = false; + #endif class MyGraphicsContext { public: @@ -90,10 +89,8 @@ namespace osg::ref_ptr _gc; }; - osg::ref_ptr decompress (osg::ref_ptr source, float rotDegrees) + SDLUtil::SurfaceUniquePtr hardwareDecompress (osg::ref_ptr source, float rotDegrees) { - // TODO: use software decompression once S3TC patent expires - int width = source->s(); int height = source->t(); @@ -152,11 +149,55 @@ namespace source->releaseGLObjects(); texture->releaseGLObjects(); - return resultImage; + return SDLUtil::imageToSurface(resultImage, true); + } + + SDLUtil::SurfaceUniquePtr softwareDecompress (osg::ref_ptr source, float rotDegrees) + { + int width = source->s(); + int height = source->t(); + bool useAlpha = source->isImageTranslucent(); + + osg::ref_ptr decompressedImage = new osg::Image; + decompressedImage->setFileName(source->getFileName()); + decompressedImage->allocateImage(width, height, 1, useAlpha ? GL_RGBA : GL_RGB, GL_UNSIGNED_BYTE); + for (int s=0; ssetColor(source->getColor(s,t,0), s,t,0); + + Uint32 redMask = 0x000000ff; + Uint32 greenMask = 0x0000ff00; + Uint32 blueMask = 0x00ff0000; + Uint32 alphaMask = useAlpha ? 0xff000000 : 0; + + SDL_Surface *cursorSurface = SDL_CreateRGBSurfaceFrom(decompressedImage->data(), + width, + height, + decompressedImage->getPixelSizeInBits(), + decompressedImage->getRowSizeInBytes(), + redMask, + greenMask, + blueMask, + alphaMask); + + SDL_Surface *targetSurface = SDL_CreateRGBSurface(0, width, height, 32, redMask, greenMask, blueMask, alphaMask); + SDL_Renderer *renderer = SDL_CreateSoftwareRenderer(targetSurface); + + SDL_RenderClear(renderer); + + SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "1"); + SDL_Texture *cursorTexture = SDL_CreateTextureFromSurface(renderer, cursorSurface); + + SDL_RenderCopyEx(renderer, cursorTexture, NULL, NULL, -rotDegrees, NULL, SDL_FLIP_VERTICAL); + + SDL_DestroyTexture(cursorTexture); + SDL_FreeSurface(cursorSurface); + SDL_DestroyRenderer(renderer); + + return SDLUtil::SurfaceUniquePtr(targetSurface, SDL_FreeSurface); } } -#endif namespace SDLUtil { @@ -220,77 +261,32 @@ namespace SDLUtil #endif } -#if OPENMW_USE_SOFTWARE_CURSOR_DECOMPRESSION - SurfaceUniquePtr decompress(osg::Image* source, int rotDegrees) - { - int width = source->s(); - int height = source->t(); - bool useAlpha = source->isImageTranslucent(); - - osg::ref_ptr decompressedImage = new osg::Image; - decompressedImage->setFileName(source->getFileName()); - decompressedImage->allocateImage(width, height, 1, useAlpha ? GL_RGBA : GL_RGB, GL_UNSIGNED_BYTE); - for (int s=0; ssetColor(source->getColor(s,t,0), s,t,0); - - Uint32 redMask = 0x000000ff; - Uint32 greenMask = 0x0000ff00; - Uint32 blueMask = 0x00ff0000; - Uint32 alphaMask = useAlpha ? 0xff000000 : 0; - - SDL_Surface *cursorSurface = SDL_CreateRGBSurfaceFrom(decompressedImage->data(), - width, - height, - decompressedImage->getPixelSizeInBits(), - decompressedImage->getRowSizeInBytes(), - redMask, - greenMask, - blueMask, - alphaMask); - - SDL_Surface *targetSurface = SDL_CreateRGBSurface(0, width, height, 32, redMask, greenMask, blueMask, alphaMask); - SDL_Renderer *renderer = SDL_CreateSoftwareRenderer(targetSurface); - - SDL_RenderClear(renderer); - - SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "1"); - SDL_Texture *cursorTexture = SDL_CreateTextureFromSurface(renderer, cursorSurface); - - SDL_RenderCopyEx(renderer, cursorTexture, NULL, NULL, -rotDegrees, NULL, SDL_FLIP_VERTICAL); - - SDL_DestroyTexture(cursorTexture); - SDL_FreeSurface(cursorSurface); - SDL_DestroyRenderer(renderer); - - return SurfaceUniquePtr(targetSurface, SDL_FreeSurface); - } -#endif - void SDLCursorManager::_createCursorFromResource(const std::string& name, int rotDegrees, osg::Image* image, Uint8 hotspot_x, Uint8 hotspot_y) { if (mCursorMap.find(name) != mCursorMap.end()) return; -#if !OPENMW_USE_SOFTWARE_CURSOR_DECOMPRESSION - osg::ref_ptr decompressed; + static bool forceSoftwareDecompression = (getenv("OPENMW_DECOMPRESS_TEXTURES") != 0); + + SurfaceUniquePtr (*decompressionFunction)(osg::ref_ptr, float); + if (forceSoftwareDecompression || CursorDecompression::DXTCSupported) { + decompressionFunction = CursorDecompression::softwareDecompress; + } else { + decompressionFunction = CursorDecompression::hardwareDecompress; + } try { - decompressed = decompress(image, static_cast(rotDegrees)); + auto surface = decompressionFunction(image, static_cast(rotDegrees)); + + //set the cursor and store it for later + SDL_Cursor* curs = SDL_CreateColorCursor(surface.get(), hotspot_x, hotspot_y); + + mCursorMap.insert(CursorMap::value_type(std::string(name), curs)); } catch (std::exception& e) { std::cerr << e.what() << std::endl; std::cerr <<"Using default cursor."< Date: Tue, 19 Jun 2018 17:03:43 +0300 Subject: [PATCH 07/18] Make Open spells casted by anything trigger player crime event (fixes #4461) --- apps/openmw/mwmechanics/spellcasting.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwmechanics/spellcasting.cpp b/apps/openmw/mwmechanics/spellcasting.cpp index f6d92726d..0fa13fc07 100644 --- a/apps/openmw/mwmechanics/spellcasting.cpp +++ b/apps/openmw/mwmechanics/spellcasting.cpp @@ -665,8 +665,9 @@ namespace MWMechanics if (target.getCellRef().getLockLevel() > 0) { MWBase::Environment::get().getSoundManager()->playSound3D(target, "Open Lock", 1.f, 1.f); - if (!caster.isEmpty() && caster.getClass().isActor()) - MWBase::Environment::get().getMechanicsManager()->objectOpened(caster, target); + if (!caster.isEmpty()) + MWBase::Environment::get().getMechanicsManager()->objectOpened(getPlayer(), target); + // Use the player instead of the caster for vanilla crime compatibility if (caster == getPlayer()) MWBase::Environment::get().getWindowManager()->messageBox("#{sMagicOpenSuccess}"); From 0731d79c091ab056c148ea5dbb17d5c97c17e7af Mon Sep 17 00:00:00 2001 From: Capostrophic <21265616+Capostrophic@users.noreply.github.com> Date: Tue, 19 Jun 2018 17:06:31 +0300 Subject: [PATCH 08/18] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc150f344..aa680a09e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ Bug #4457: Item without CanCarry flag prevents shield autoequipping in dark areas Bug #4458: AiWander console command handles idle chances incorrectly Bug #4459: NotCell dialogue condition doesn't support partial matches + Bug #4461: "Open" spell from non-player caster isn't a crime Feature #4256: Implement ToggleBorders (TB) console command Feature #3276: Editor: Search- Show number of (remaining) search results and indicate a search without any results Feature #4222: 360° screenshots From 0d70cb9473abd68583db9cbc51cc6562ce349858 Mon Sep 17 00:00:00 2001 From: Adam Bowen Date: Tue, 19 Jun 2018 15:45:04 +0000 Subject: [PATCH 09/18] Re-link bugtracker links to Gitlab * Link "1.0" issues to the "1.0" tag * Link "report a bug" to the issues page * Link "known issues" to the "Bug" tag --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9af9ef976..333eedff1 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Font Licenses: Current Status -------------- -The main quests in Morrowind, Tribunal and Bloodmoon are all completable. Some issues with side quests are to be expected (but rare). Check the [bug tracker](https://bugs.openmw.org/) for a list of issues we need to resolve before the "1.0" release. Even before the "1.0" release however, OpenMW boasts some new [features](https://wiki.openmw.org/index.php?title=Features), such as improved graphics and user interfaces. +The main quests in Morrowind, Tribunal and Bloodmoon are all completable. Some issues with side quests are to be expected (but rare). Check the [bug tracker](https://gitlab.com/OpenMW/openmw/issues?label_name%5B%5D=1.0) for a list of issues we need to resolve before the "1.0" release. Even before the "1.0" release however, OpenMW boasts some new [features](https://wiki.openmw.org/index.php?title=Features), such as improved graphics and user interfaces. Pre-existing modifications created for the original Morrowind engine can be hit-and-miss. The OpenMW script compiler performs more thorough error-checking than Morrowind does, meaning that a mod created for Morrowind may not necessarily run in OpenMW. Some mods also rely on quirky behaviour or engine bugs in order to work. We are considering such compatibility issues on a case-by-case basis - in some cases adding a workaround to OpenMW may be feasible, in other cases fixing the mod will be the only option. If you know of any mods that work or don't work, feel free to add them to the [Mod status](https://wiki.openmw.org/index.php?title=Mod_status) wiki page. @@ -30,8 +30,8 @@ Getting Started * [Build from source](https://wiki.openmw.org/index.php?title=Development_Environment_Setup) * [Testing the game](https://wiki.openmw.org/index.php?title=Testing) * [How to contribute](https://wiki.openmw.org/index.php?title=Contribution_Wanted) -* [Report a bug](https://bugs.openmw.org/projects/openmw) - read the [guidelines](https://wiki.openmw.org/index.php?title=Bug_Reporting_Guidelines) before submitting your first bug! -* [Known issues](https://bugs.openmw.org/projects/openmw/issues?utf8=%E2%9C%93&set_filter=1&f%5B%5D=status_id&op%5Bstatus_id%5D=%3D&v%5Bstatus_id%5D%5B%5D=7&f%5B%5D=tracker_id&op%5Btracker_id%5D=%3D&v%5Btracker_id%5D%5B%5D=1&f%5B%5D=&c%5B%5D=project&c%5B%5D=tracker&c%5B%5D=status&c%5B%5D=priority&c%5B%5D=subject&c%5B%5D=assigned_to&c%5B%5D=updated_on&group_by=tracker) +* [Report a bug](https://gitlab.com/OpenMW/openmw/issues) - read the [guidelines](https://wiki.openmw.org/index.php?title=Bug_Reporting_Guidelines) before submitting your first bug! +* [Known issues](https://gitlab.com/OpenMW/openmw/issues?label_name%5B%5D=Bug) The data path ------------- From 6c23caadd7bf37bee5e80c5d0e1f8f323697144e Mon Sep 17 00:00:00 2001 From: Capostrophic <21265616+Capostrophic@users.noreply.github.com> Date: Tue, 19 Jun 2018 20:33:30 +0300 Subject: [PATCH 10/18] Fix crash when a target in a different cell is (un)locked --- apps/openmw/mwmechanics/spellcasting.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwmechanics/spellcasting.cpp b/apps/openmw/mwmechanics/spellcasting.cpp index 0fa13fc07..f1997e8d7 100644 --- a/apps/openmw/mwmechanics/spellcasting.cpp +++ b/apps/openmw/mwmechanics/spellcasting.cpp @@ -644,8 +644,9 @@ namespace MWMechanics { const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore(); const ESM::MagicEffect *magiceffect = store.get().find(effectId); - MWRender::Animation* animation = MWBase::Environment::get().getWorld()->getAnimation(target); - animation->addSpellCastGlow(magiceffect); + MWRender::Animation* animation = MWBase::Environment::get().getWorld()->getAnimation(target); + if (animation) + animation->addSpellCastGlow(magiceffect); if (target.getCellRef().getLockLevel() < magnitude) //If the door is not already locked to a higher value, lock it to spell magnitude { if (caster == getPlayer()) @@ -658,15 +659,16 @@ namespace MWMechanics { const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore(); const ESM::MagicEffect *magiceffect = store.get().find(effectId); - MWRender::Animation* animation = MWBase::Environment::get().getWorld()->getAnimation(target); - animation->addSpellCastGlow(magiceffect); + MWRender::Animation* animation = MWBase::Environment::get().getWorld()->getAnimation(target); + if (animation) + animation->addSpellCastGlow(magiceffect); if (target.getCellRef().getLockLevel() <= magnitude) { if (target.getCellRef().getLockLevel() > 0) { MWBase::Environment::get().getSoundManager()->playSound3D(target, "Open Lock", 1.f, 1.f); if (!caster.isEmpty()) - MWBase::Environment::get().getMechanicsManager()->objectOpened(getPlayer(), target); + MWBase::Environment::get().getMechanicsManager()->objectOpened(getPlayer(), target); // Use the player instead of the caster for vanilla crime compatibility if (caster == getPlayer()) From 9d61d76e928d146f9c1ad76ab6152fdcda58c711 Mon Sep 17 00:00:00 2001 From: Atahualpa Date: Wed, 20 Jun 2018 00:20:03 +0200 Subject: [PATCH 11/18] Adds the option to ignore "Base" records when running the verifier. (fixes #4466) Adds a boolean setting to the user preferences. This setting is locally saved to all OpenMW-CS check stages. When a verification is done, the setting is updated on setup for each check stage. If set to true, the boolean value is then used to skip the verification process for every base record - minus some special cases where, e.g., counters are to be set first. Related issue: - Fixes #4466: Editor: Add option to ignore base records when running verifier (https://gitlab.com/OpenMW/openmw/issues/4466) Tests: The changes were successfully tested in OpenMW-CS by creating faulty "Base" and "Modified" records for every record type (if possible) and, then, running the verifier with and without the option respectively. --- CHANGELOG.md | 3 +- apps/opencs/model/prefs/state.cpp | 1 + apps/opencs/model/tools/birthsigncheck.cpp | 11 ++- apps/opencs/model/tools/birthsigncheck.hpp | 1 + apps/opencs/model/tools/bodypartcheck.cpp | 11 ++- apps/opencs/model/tools/bodypartcheck.hpp | 1 + apps/opencs/model/tools/classcheck.cpp | 11 ++- apps/opencs/model/tools/classcheck.hpp | 1 + apps/opencs/model/tools/factioncheck.cpp | 11 ++- apps/opencs/model/tools/factioncheck.hpp | 1 + apps/opencs/model/tools/gmstcheck.cpp | 11 ++- apps/opencs/model/tools/gmstcheck.hpp | 1 + apps/opencs/model/tools/journalcheck.cpp | 15 +++- apps/opencs/model/tools/journalcheck.hpp | 1 + apps/opencs/model/tools/magiceffectcheck.cpp | 16 +++- apps/opencs/model/tools/magiceffectcheck.hpp | 1 + apps/opencs/model/tools/pathgridcheck.cpp | 11 ++- apps/opencs/model/tools/pathgridcheck.hpp | 1 + apps/opencs/model/tools/racecheck.cpp | 20 +++-- apps/opencs/model/tools/racecheck.hpp | 1 + .../opencs/model/tools/referenceablecheck.cpp | 78 ++++++++++++------- .../opencs/model/tools/referenceablecheck.hpp | 1 + apps/opencs/model/tools/referencecheck.cpp | 8 +- apps/opencs/model/tools/referencecheck.hpp | 1 + apps/opencs/model/tools/regioncheck.cpp | 11 ++- apps/opencs/model/tools/regioncheck.hpp | 1 + apps/opencs/model/tools/scriptcheck.cpp | 16 +++- apps/opencs/model/tools/scriptcheck.hpp | 1 + apps/opencs/model/tools/skillcheck.cpp | 11 ++- apps/opencs/model/tools/skillcheck.hpp | 1 + apps/opencs/model/tools/soundcheck.cpp | 11 ++- apps/opencs/model/tools/soundcheck.hpp | 1 + apps/opencs/model/tools/soundgencheck.cpp | 14 +++- apps/opencs/model/tools/soundgencheck.hpp | 1 + apps/opencs/model/tools/spellcheck.cpp | 11 ++- apps/opencs/model/tools/spellcheck.hpp | 1 + apps/opencs/model/tools/startscriptcheck.cpp | 11 ++- apps/opencs/model/tools/startscriptcheck.hpp | 1 + apps/opencs/model/tools/topicinfocheck.cpp | 11 ++- apps/opencs/model/tools/topicinfocheck.hpp | 2 + apps/opencs/model/world/record.cpp | 5 ++ apps/opencs/model/world/record.hpp | 2 + 42 files changed, 260 insertions(+), 70 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc150f344..33ba3e461 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,12 +44,13 @@ Bug #4457: Item without CanCarry flag prevents shield autoequipping in dark areas Bug #4458: AiWander console command handles idle chances incorrectly Bug #4459: NotCell dialogue condition doesn't support partial matches - Feature #4256: Implement ToggleBorders (TB) console command 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 Feature #4324: Add CFBundleIdentifier in Info.plist to allow for macOS function key shortcuts Feature #4345: Add equivalents for the command line commands to Launcher Feature #4444: Per-group KF-animation files support + Feature #4466: (OpenMW-CS) Add option to ignore "Base" records when running verifier 0.44.0 ------ diff --git a/apps/opencs/model/prefs/state.cpp b/apps/opencs/model/prefs/state.cpp index 6f64da72e..e1236a0e4 100644 --- a/apps/opencs/model/prefs/state.cpp +++ b/apps/opencs/model/prefs/state.cpp @@ -123,6 +123,7 @@ void CSMPrefs::State::declare() declareEnum ("double-s", "Shift Double Click", actionRemove).addValues (reportValues); declareEnum ("double-c", "Control Double Click", actionEditAndRemove).addValues (reportValues); declareEnum ("double-sc", "Shift Control Double Click", actionNone).addValues (reportValues); + declareBool("ignore-base-records", "Ignore base records in verifier", false); declareCategory ("Search & Replace"); declareInt ("char-before", "Characters before search string", 10). diff --git a/apps/opencs/model/tools/birthsigncheck.cpp b/apps/opencs/model/tools/birthsigncheck.cpp index 9898352f1..5fe2479cd 100644 --- a/apps/opencs/model/tools/birthsigncheck.cpp +++ b/apps/opencs/model/tools/birthsigncheck.cpp @@ -5,14 +5,20 @@ #include +#include "../prefs/state.hpp" + #include "../world/universalid.hpp" CSMTools::BirthsignCheckStage::BirthsignCheckStage (const CSMWorld::IdCollection& birthsigns) : mBirthsigns (birthsigns) -{} +{ + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); +} int CSMTools::BirthsignCheckStage::setup() { + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + return mBirthsigns.getSize(); } @@ -20,7 +26,8 @@ void CSMTools::BirthsignCheckStage::perform (int stage, CSMDoc::Messages& messag { const CSMWorld::Record& record = mBirthsigns.getRecord (stage); - if (record.isDeleted()) + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted()) return; const ESM::BirthSign& birthsign = record.get(); diff --git a/apps/opencs/model/tools/birthsigncheck.hpp b/apps/opencs/model/tools/birthsigncheck.hpp index 16d4c666f..a8a7a2c14 100644 --- a/apps/opencs/model/tools/birthsigncheck.hpp +++ b/apps/opencs/model/tools/birthsigncheck.hpp @@ -13,6 +13,7 @@ namespace CSMTools class BirthsignCheckStage : public CSMDoc::Stage { const CSMWorld::IdCollection& mBirthsigns; + bool mIgnoreBaseRecords; public: diff --git a/apps/opencs/model/tools/bodypartcheck.cpp b/apps/opencs/model/tools/bodypartcheck.cpp index 68a09485f..8d19ef489 100644 --- a/apps/opencs/model/tools/bodypartcheck.cpp +++ b/apps/opencs/model/tools/bodypartcheck.cpp @@ -1,5 +1,7 @@ #include "bodypartcheck.hpp" +#include "../prefs/state.hpp" + CSMTools::BodyPartCheckStage::BodyPartCheckStage( const CSMWorld::IdCollection &bodyParts, const CSMWorld::Resources &meshes, @@ -7,10 +9,14 @@ CSMTools::BodyPartCheckStage::BodyPartCheckStage( mBodyParts(bodyParts), mMeshes(meshes), mRaces(races) -{ } +{ + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); +} int CSMTools::BodyPartCheckStage::setup() { + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + return mBodyParts.getSize(); } @@ -18,7 +24,8 @@ void CSMTools::BodyPartCheckStage::perform (int stage, CSMDoc::Messages &message { const CSMWorld::Record &record = mBodyParts.getRecord(stage); - if ( record.isDeleted() ) + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted()) return; const ESM::BodyPart &bodyPart = record.get(); diff --git a/apps/opencs/model/tools/bodypartcheck.hpp b/apps/opencs/model/tools/bodypartcheck.hpp index dbab5f5c6..5c8ae2929 100644 --- a/apps/opencs/model/tools/bodypartcheck.hpp +++ b/apps/opencs/model/tools/bodypartcheck.hpp @@ -17,6 +17,7 @@ namespace CSMTools const CSMWorld::IdCollection &mBodyParts; const CSMWorld::Resources &mMeshes; const CSMWorld::IdCollection &mRaces; + bool mIgnoreBaseRecords; public: BodyPartCheckStage( diff --git a/apps/opencs/model/tools/classcheck.cpp b/apps/opencs/model/tools/classcheck.cpp index 79cb704bf..82007c860 100644 --- a/apps/opencs/model/tools/classcheck.cpp +++ b/apps/opencs/model/tools/classcheck.cpp @@ -6,14 +6,20 @@ #include #include +#include "../prefs/state.hpp" + #include "../world/universalid.hpp" CSMTools::ClassCheckStage::ClassCheckStage (const CSMWorld::IdCollection& classes) : mClasses (classes) -{} +{ + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); +} int CSMTools::ClassCheckStage::setup() { + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + return mClasses.getSize(); } @@ -21,7 +27,8 @@ void CSMTools::ClassCheckStage::perform (int stage, CSMDoc::Messages& messages) { const CSMWorld::Record& record = mClasses.getRecord (stage); - if (record.isDeleted()) + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted()) return; const ESM::Class& class_ = record.get(); diff --git a/apps/opencs/model/tools/classcheck.hpp b/apps/opencs/model/tools/classcheck.hpp index b76da3f13..ba0a07047 100644 --- a/apps/opencs/model/tools/classcheck.hpp +++ b/apps/opencs/model/tools/classcheck.hpp @@ -13,6 +13,7 @@ namespace CSMTools class ClassCheckStage : public CSMDoc::Stage { const CSMWorld::IdCollection& mClasses; + bool mIgnoreBaseRecords; public: diff --git a/apps/opencs/model/tools/factioncheck.cpp b/apps/opencs/model/tools/factioncheck.cpp index 621b28070..2cf88fc0e 100644 --- a/apps/opencs/model/tools/factioncheck.cpp +++ b/apps/opencs/model/tools/factioncheck.cpp @@ -6,14 +6,20 @@ #include #include +#include "../prefs/state.hpp" + #include "../world/universalid.hpp" CSMTools::FactionCheckStage::FactionCheckStage (const CSMWorld::IdCollection& factions) : mFactions (factions) -{} +{ + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); +} int CSMTools::FactionCheckStage::setup() { + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + return mFactions.getSize(); } @@ -21,7 +27,8 @@ void CSMTools::FactionCheckStage::perform (int stage, CSMDoc::Messages& messages { const CSMWorld::Record& record = mFactions.getRecord (stage); - if (record.isDeleted()) + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted()) return; const ESM::Faction& faction = record.get(); diff --git a/apps/opencs/model/tools/factioncheck.hpp b/apps/opencs/model/tools/factioncheck.hpp index 321a4d6d8..b26d19717 100644 --- a/apps/opencs/model/tools/factioncheck.hpp +++ b/apps/opencs/model/tools/factioncheck.hpp @@ -13,6 +13,7 @@ namespace CSMTools class FactionCheckStage : public CSMDoc::Stage { const CSMWorld::IdCollection& mFactions; + bool mIgnoreBaseRecords; public: diff --git a/apps/opencs/model/tools/gmstcheck.cpp b/apps/opencs/model/tools/gmstcheck.cpp index 0c32c0056..e3b4777bf 100644 --- a/apps/opencs/model/tools/gmstcheck.cpp +++ b/apps/opencs/model/tools/gmstcheck.cpp @@ -2,14 +2,20 @@ #include +#include "../prefs/state.hpp" + #include "../world/defaultgmsts.hpp" CSMTools::GmstCheckStage::GmstCheckStage(const CSMWorld::IdCollection& gameSettings) : mGameSettings(gameSettings) -{} +{ + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); +} int CSMTools::GmstCheckStage::setup() { + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + return mGameSettings.getSize(); } @@ -17,7 +23,8 @@ void CSMTools::GmstCheckStage::perform(int stage, CSMDoc::Messages& messages) { const CSMWorld::Record& record = mGameSettings.getRecord (stage); - if (record.isDeleted()) + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted()) return; const ESM::GameSetting& gmst = record.get(); diff --git a/apps/opencs/model/tools/gmstcheck.hpp b/apps/opencs/model/tools/gmstcheck.hpp index 0d4f7f204..27bd61317 100644 --- a/apps/opencs/model/tools/gmstcheck.hpp +++ b/apps/opencs/model/tools/gmstcheck.hpp @@ -25,6 +25,7 @@ namespace CSMTools private: const CSMWorld::IdCollection& mGameSettings; + bool mIgnoreBaseRecords; std::string varTypeToString(ESM::VarType); diff --git a/apps/opencs/model/tools/journalcheck.cpp b/apps/opencs/model/tools/journalcheck.cpp index bdd14ddf0..a565f3786 100644 --- a/apps/opencs/model/tools/journalcheck.cpp +++ b/apps/opencs/model/tools/journalcheck.cpp @@ -3,13 +3,19 @@ #include #include +#include "../prefs/state.hpp" + CSMTools::JournalCheckStage::JournalCheckStage(const CSMWorld::IdCollection &journals, const CSMWorld::InfoCollection& journalInfos) : mJournals(journals), mJournalInfos(journalInfos) -{} +{ + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); +} int CSMTools::JournalCheckStage::setup() { + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + return mJournals.getSize(); } @@ -17,7 +23,8 @@ void CSMTools::JournalCheckStage::perform(int stage, CSMDoc::Messages& messages) { const CSMWorld::Record &journalRecord = mJournals.getRecord(stage); - if (journalRecord.isDeleted()) + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && journalRecord.isBaseOnly()) || journalRecord.isDeleted()) return; const ESM::Dialogue &journal = journalRecord.get(); @@ -43,6 +50,10 @@ void CSMTools::JournalCheckStage::perform(int stage, CSMDoc::Messages& messages) statusNamedCount += 1; } + // Skip "Base" records (setting!) + if (mIgnoreBaseRecords && infoRecord.isBaseOnly()) + continue; + if (journalInfo.mResponse.empty()) { CSMWorld::UniversalId id(CSMWorld::UniversalId::Type_JournalInfo, journalInfo.mId); diff --git a/apps/opencs/model/tools/journalcheck.hpp b/apps/opencs/model/tools/journalcheck.hpp index c9f619698..661edcaef 100644 --- a/apps/opencs/model/tools/journalcheck.hpp +++ b/apps/opencs/model/tools/journalcheck.hpp @@ -28,6 +28,7 @@ namespace CSMTools const CSMWorld::IdCollection& mJournals; const CSMWorld::InfoCollection& mJournalInfos; + bool mIgnoreBaseRecords; }; } diff --git a/apps/opencs/model/tools/magiceffectcheck.cpp b/apps/opencs/model/tools/magiceffectcheck.cpp index ab8b3b68b..f9e83aa23 100644 --- a/apps/opencs/model/tools/magiceffectcheck.cpp +++ b/apps/opencs/model/tools/magiceffectcheck.cpp @@ -2,6 +2,8 @@ #include +#include "../prefs/state.hpp" + #include "../world/resources.hpp" #include "../world/data.hpp" @@ -77,16 +79,26 @@ CSMTools::MagicEffectCheckStage::MagicEffectCheckStage(const CSMWorld::IdCollect mReferenceables(referenceables), mIcons(icons), mTextures(textures) -{} +{ + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); +} int CSMTools::MagicEffectCheckStage::setup() { + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + return mMagicEffects.getSize(); } void CSMTools::MagicEffectCheckStage::perform(int stage, CSMDoc::Messages &messages) { - ESM::MagicEffect effect = mMagicEffects.getRecord(stage).get(); + const CSMWorld::Record &record = mMagicEffects.getRecord(stage); + + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted()) + return; + + ESM::MagicEffect effect = record.get(); CSMWorld::UniversalId id(CSMWorld::UniversalId::Type_MagicEffect, effect.mId); if (effect.mData.mBaseCost < 0.0f) diff --git a/apps/opencs/model/tools/magiceffectcheck.hpp b/apps/opencs/model/tools/magiceffectcheck.hpp index 0ad6760d3..28a406283 100644 --- a/apps/opencs/model/tools/magiceffectcheck.hpp +++ b/apps/opencs/model/tools/magiceffectcheck.hpp @@ -24,6 +24,7 @@ namespace CSMTools const CSMWorld::RefIdCollection &mReferenceables; const CSMWorld::Resources &mIcons; const CSMWorld::Resources &mTextures; + bool mIgnoreBaseRecords; private: bool isTextureExists(const std::string &texture, bool isIcon) const; diff --git a/apps/opencs/model/tools/pathgridcheck.cpp b/apps/opencs/model/tools/pathgridcheck.cpp index be4d37792..53293fa79 100644 --- a/apps/opencs/model/tools/pathgridcheck.cpp +++ b/apps/opencs/model/tools/pathgridcheck.cpp @@ -3,6 +3,8 @@ #include #include +#include "../prefs/state.hpp" + #include "../world/universalid.hpp" #include "../world/idcollection.hpp" #include "../world/subcellcollection.hpp" @@ -10,10 +12,14 @@ CSMTools::PathgridCheckStage::PathgridCheckStage (const CSMWorld::SubCellCollection& pathgrids) : mPathgrids (pathgrids) -{} +{ + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); +} int CSMTools::PathgridCheckStage::setup() { + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + return mPathgrids.getSize(); } @@ -21,7 +27,8 @@ void CSMTools::PathgridCheckStage::perform (int stage, CSMDoc::Messages& message { const CSMWorld::Record& record = mPathgrids.getRecord (stage); - if (record.isDeleted()) + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted()) return; const CSMWorld::Pathgrid& pathgrid = record.get(); diff --git a/apps/opencs/model/tools/pathgridcheck.hpp b/apps/opencs/model/tools/pathgridcheck.hpp index f45b5bc93..3e2fdd0ab 100644 --- a/apps/opencs/model/tools/pathgridcheck.hpp +++ b/apps/opencs/model/tools/pathgridcheck.hpp @@ -25,6 +25,7 @@ namespace CSMTools { const CSMWorld::SubCellCollection >& mPathgrids; + bool mIgnoreBaseRecords; public: diff --git a/apps/opencs/model/tools/racecheck.cpp b/apps/opencs/model/tools/racecheck.cpp index b30088620..c7fd83224 100644 --- a/apps/opencs/model/tools/racecheck.cpp +++ b/apps/opencs/model/tools/racecheck.cpp @@ -4,6 +4,8 @@ #include +#include "../prefs/state.hpp" + #include "../world/universalid.hpp" void CSMTools::RaceCheckStage::performPerRecord (int stage, CSMDoc::Messages& messages) @@ -15,6 +17,14 @@ void CSMTools::RaceCheckStage::performPerRecord (int stage, CSMDoc::Messages& me const ESM::Race& race = record.get(); + // Consider mPlayable flag even when "Base" records are ignored + if (race.mData.mFlags & 0x1) + mPlayable = true; + + // Skip "Base" records (setting!) + if (mIgnoreBaseRecords && record.isBaseOnly()) + return; + CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Race, race.mId); // test for empty name and description @@ -38,10 +48,6 @@ void CSMTools::RaceCheckStage::performPerRecord (int stage, CSMDoc::Messages& me if (race.mData.mWeight.mFemale<0) messages.push_back (std::make_pair (id, "female " + race.mId + " has negative weight")); - // remember playable flag - if (race.mData.mFlags & 0x1) - mPlayable = true; - /// \todo check data members that can't be edited in the table view } @@ -55,11 +61,15 @@ void CSMTools::RaceCheckStage::performFinal (CSMDoc::Messages& messages) CSMTools::RaceCheckStage::RaceCheckStage (const CSMWorld::IdCollection& races) : mRaces (races), mPlayable (false) -{} +{ + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); +} int CSMTools::RaceCheckStage::setup() { mPlayable = false; + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + return mRaces.getSize()+1; } diff --git a/apps/opencs/model/tools/racecheck.hpp b/apps/opencs/model/tools/racecheck.hpp index 3e67b7577..55c283611 100644 --- a/apps/opencs/model/tools/racecheck.hpp +++ b/apps/opencs/model/tools/racecheck.hpp @@ -14,6 +14,7 @@ namespace CSMTools { const CSMWorld::IdCollection& mRaces; bool mPlayable; + bool mIgnoreBaseRecords; void performPerRecord (int stage, CSMDoc::Messages& messages); diff --git a/apps/opencs/model/tools/referenceablecheck.cpp b/apps/opencs/model/tools/referenceablecheck.cpp index 1e86dfe37..0c9a32b5c 100644 --- a/apps/opencs/model/tools/referenceablecheck.cpp +++ b/apps/opencs/model/tools/referenceablecheck.cpp @@ -2,6 +2,8 @@ #include +#include "../prefs/state.hpp" + #include "../world/record.hpp" #include "../world/universalid.hpp" @@ -18,6 +20,7 @@ CSMTools::ReferenceableCheckStage::ReferenceableCheckStage( mScripts(scripts), mPlayerPresent(false) { + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); } void CSMTools::ReferenceableCheckStage::perform (int stage, CSMDoc::Messages& messages) @@ -228,6 +231,8 @@ void CSMTools::ReferenceableCheckStage::perform (int stage, CSMDoc::Messages& me int CSMTools::ReferenceableCheckStage::setup() { mPlayerPresent = false; + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + return mReferencables.getSize() + 1; } @@ -238,7 +243,8 @@ void CSMTools::ReferenceableCheckStage::bookCheck( { const CSMWorld::RecordBase& baseRecord = records.getRecord(stage); - if (baseRecord.isDeleted()) + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) return; const ESM::Book& book = (dynamic_cast& >(baseRecord)).get(); @@ -257,7 +263,8 @@ void CSMTools::ReferenceableCheckStage::activatorCheck( { const CSMWorld::RecordBase& baseRecord = records.getRecord(stage); - if (baseRecord.isDeleted()) + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) return; const ESM::Activator& activator = (dynamic_cast& >(baseRecord)).get(); @@ -278,7 +285,8 @@ void CSMTools::ReferenceableCheckStage::potionCheck( { const CSMWorld::RecordBase& baseRecord = records.getRecord(stage); - if (baseRecord.isDeleted()) + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) return; const ESM::Potion& potion = (dynamic_cast& >(baseRecord)).get(); @@ -299,7 +307,8 @@ void CSMTools::ReferenceableCheckStage::apparatusCheck( { const CSMWorld::RecordBase& baseRecord = records.getRecord(stage); - if (baseRecord.isDeleted()) + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) return; const ESM::Apparatus& apparatus = (dynamic_cast& >(baseRecord)).get(); @@ -320,7 +329,8 @@ void CSMTools::ReferenceableCheckStage::armorCheck( { const CSMWorld::RecordBase& baseRecord = records.getRecord(stage); - if (baseRecord.isDeleted()) + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) return; const ESM::Armor& armor = (dynamic_cast& >(baseRecord)).get(); @@ -347,7 +357,8 @@ void CSMTools::ReferenceableCheckStage::clothingCheck( { const CSMWorld::RecordBase& baseRecord = records.getRecord(stage); - if (baseRecord.isDeleted()) + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) return; const ESM::Clothing& clothing = (dynamic_cast& >(baseRecord)).get(); @@ -365,7 +376,8 @@ void CSMTools::ReferenceableCheckStage::containerCheck( { const CSMWorld::RecordBase& baseRecord = records.getRecord(stage); - if (baseRecord.isDeleted()) + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) return; const ESM::Container& container = (dynamic_cast& >(baseRecord)).get(); @@ -397,7 +409,8 @@ void CSMTools::ReferenceableCheckStage::creatureCheck ( { const CSMWorld::RecordBase& baseRecord = records.getRecord(stage); - if (baseRecord.isDeleted()) + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) return; const ESM::Creature& creature = (dynamic_cast&>(baseRecord)).get(); @@ -473,7 +486,8 @@ void CSMTools::ReferenceableCheckStage::doorCheck( { const CSMWorld::RecordBase& baseRecord = records.getRecord(stage); - if (baseRecord.isDeleted()) + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) return; const ESM::Door& door = (dynamic_cast&>(baseRecord)).get(); @@ -497,7 +511,8 @@ void CSMTools::ReferenceableCheckStage::ingredientCheck( { const CSMWorld::RecordBase& baseRecord = records.getRecord(stage); - if (baseRecord.isDeleted()) + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) return; const ESM::Ingredient& ingredient = (dynamic_cast& >(baseRecord)).get(); @@ -516,10 +531,9 @@ void CSMTools::ReferenceableCheckStage::creaturesLevListCheck( { const CSMWorld::RecordBase& baseRecord = records.getRecord(stage); - if (baseRecord.isDeleted()) - { + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) return; - } const ESM::CreatureLevList& CreatureLevList = (dynamic_cast& >(baseRecord)).get(); CSMWorld::UniversalId id(CSMWorld::UniversalId::Type_CreatureLevelledList, CreatureLevList.mId); //CreatureLevList but Type_CreatureLevelledList :/ @@ -534,10 +548,9 @@ void CSMTools::ReferenceableCheckStage::itemLevelledListCheck( { const CSMWorld::RecordBase& baseRecord = records.getRecord(stage); - if (baseRecord.isDeleted()) - { + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) return; - } const ESM::ItemLevList& ItemLevList = (dynamic_cast& >(baseRecord)).get(); CSMWorld::UniversalId id(CSMWorld::UniversalId::Type_ItemLevelledList, ItemLevList.mId); @@ -551,7 +564,8 @@ void CSMTools::ReferenceableCheckStage::lightCheck( { const CSMWorld::RecordBase& baseRecord = records.getRecord(stage); - if (baseRecord.isDeleted()) + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) return; const ESM::Light& light = (dynamic_cast& >(baseRecord)).get(); @@ -574,7 +588,8 @@ void CSMTools::ReferenceableCheckStage::lockpickCheck( { const CSMWorld::RecordBase& baseRecord = records.getRecord(stage); - if (baseRecord.isDeleted()) + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) return; const ESM::Lockpick& lockpick = (dynamic_cast& >(baseRecord)).get(); @@ -595,7 +610,8 @@ void CSMTools::ReferenceableCheckStage::miscCheck( { const CSMWorld::RecordBase& baseRecord = records.getRecord(stage); - if (baseRecord.isDeleted()) + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) return; const ESM::Miscellaneous& miscellaneous = (dynamic_cast& >(baseRecord)).get(); @@ -619,6 +635,14 @@ void CSMTools::ReferenceableCheckStage::npcCheck ( const ESM::NPC& npc = (dynamic_cast& >(baseRecord)).get(); CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Npc, npc.mId); + //Detect if player is present + if (Misc::StringUtils::ciEqual(npc.mId, "player")) //Happy now, scrawl? + mPlayerPresent = true; + + // Skip "Base" records (setting!) + if (mIgnoreBaseRecords && baseRecord.isBaseOnly()) + return; + short level(npc.mNpdt.mLevel); char disposition(npc.mNpdt.mDisposition); char reputation(npc.mNpdt.mReputation); @@ -626,10 +650,6 @@ void CSMTools::ReferenceableCheckStage::npcCheck ( //Don't know what unknown is for int gold(npc.mNpdt.mGold); - //Detect if player is present - if (Misc::StringUtils::ciEqual(npc.mId, "player")) //Happy now, scrawl? - mPlayerPresent = true; - if (npc.mNpdtType == ESM::NPC::NPC_WITH_AUTOCALCULATED_STATS) //12 = autocalculated { if ((npc.mFlags & ESM::NPC::Autocalc) == 0) //0x0010 = autocalculated flag @@ -728,7 +748,8 @@ void CSMTools::ReferenceableCheckStage::weaponCheck( { const CSMWorld::RecordBase& baseRecord = records.getRecord (stage); - if (baseRecord.isDeleted()) + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) return; const ESM::Weapon& weapon = (dynamic_cast& >(baseRecord)).get(); @@ -808,7 +829,8 @@ void CSMTools::ReferenceableCheckStage::probeCheck( { const CSMWorld::RecordBase& baseRecord = records.getRecord(stage); - if (baseRecord.isDeleted()) + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) return; const ESM::Probe& probe = (dynamic_cast& >(baseRecord)).get(); @@ -827,7 +849,8 @@ void CSMTools::ReferenceableCheckStage::repairCheck ( { const CSMWorld::RecordBase& baseRecord = records.getRecord (stage); - if (baseRecord.isDeleted()) + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) return; const ESM::Repair& repair = (dynamic_cast& >(baseRecord)).get(); @@ -846,7 +869,8 @@ void CSMTools::ReferenceableCheckStage::staticCheck ( { const CSMWorld::RecordBase& baseRecord = records.getRecord (stage); - if (baseRecord.isDeleted()) + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) return; const ESM::Static& staticElement = (dynamic_cast& >(baseRecord)).get(); diff --git a/apps/opencs/model/tools/referenceablecheck.hpp b/apps/opencs/model/tools/referenceablecheck.hpp index 4356e50b2..f9341bd9c 100644 --- a/apps/opencs/model/tools/referenceablecheck.hpp +++ b/apps/opencs/model/tools/referenceablecheck.hpp @@ -82,6 +82,7 @@ namespace CSMTools const CSMWorld::IdCollection& mFactions; const CSMWorld::IdCollection& mScripts; bool mPlayerPresent; + bool mIgnoreBaseRecords; }; } #endif // REFERENCEABLECHECKSTAGE_H diff --git a/apps/opencs/model/tools/referencecheck.cpp b/apps/opencs/model/tools/referencecheck.cpp index 7f247741c..347a8a399 100644 --- a/apps/opencs/model/tools/referencecheck.cpp +++ b/apps/opencs/model/tools/referencecheck.cpp @@ -1,5 +1,7 @@ #include "referencecheck.hpp" +#include "../prefs/state.hpp" + CSMTools::ReferenceCheckStage::ReferenceCheckStage( const CSMWorld::RefCollection& references, const CSMWorld::RefIdCollection& referencables, @@ -12,13 +14,15 @@ CSMTools::ReferenceCheckStage::ReferenceCheckStage( mCells(cells), mFactions(factions) { + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); } void CSMTools::ReferenceCheckStage::perform(int stage, CSMDoc::Messages &messages) { const CSMWorld::Record& record = mReferences.getRecord(stage); - if (record.isDeleted()) + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted()) return; const CSMWorld::CellRef& cellRef = record.get(); @@ -100,5 +104,7 @@ void CSMTools::ReferenceCheckStage::perform(int stage, CSMDoc::Messages &message int CSMTools::ReferenceCheckStage::setup() { + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + return mReferences.getSize(); } diff --git a/apps/opencs/model/tools/referencecheck.hpp b/apps/opencs/model/tools/referencecheck.hpp index 70ef02916..5e25924f3 100644 --- a/apps/opencs/model/tools/referencecheck.hpp +++ b/apps/opencs/model/tools/referencecheck.hpp @@ -23,6 +23,7 @@ namespace CSMTools const CSMWorld::RefIdData& mDataSet; const CSMWorld::IdCollection& mCells; const CSMWorld::IdCollection& mFactions; + bool mIgnoreBaseRecords; }; } diff --git a/apps/opencs/model/tools/regioncheck.cpp b/apps/opencs/model/tools/regioncheck.cpp index 734861080..45b311414 100644 --- a/apps/opencs/model/tools/regioncheck.cpp +++ b/apps/opencs/model/tools/regioncheck.cpp @@ -5,14 +5,20 @@ #include +#include "../prefs/state.hpp" + #include "../world/universalid.hpp" CSMTools::RegionCheckStage::RegionCheckStage (const CSMWorld::IdCollection& regions) : mRegions (regions) -{} +{ + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); +} int CSMTools::RegionCheckStage::setup() { + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + return mRegions.getSize(); } @@ -20,7 +26,8 @@ void CSMTools::RegionCheckStage::perform (int stage, CSMDoc::Messages& messages) { const CSMWorld::Record& record = mRegions.getRecord (stage); - if (record.isDeleted()) + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted()) return; const ESM::Region& region = record.get(); diff --git a/apps/opencs/model/tools/regioncheck.hpp b/apps/opencs/model/tools/regioncheck.hpp index 8ba32e137..4c12727f0 100644 --- a/apps/opencs/model/tools/regioncheck.hpp +++ b/apps/opencs/model/tools/regioncheck.hpp @@ -13,6 +13,7 @@ namespace CSMTools class RegionCheckStage : public CSMDoc::Stage { const CSMWorld::IdCollection& mRegions; + bool mIgnoreBaseRecords; public: diff --git a/apps/opencs/model/tools/scriptcheck.cpp b/apps/opencs/model/tools/scriptcheck.cpp index 268aea379..bf5d48f65 100644 --- a/apps/opencs/model/tools/scriptcheck.cpp +++ b/apps/opencs/model/tools/scriptcheck.cpp @@ -60,6 +60,8 @@ CSMTools::ScriptCheckStage::ScriptCheckStage (const CSMDoc::Document& document) Compiler::registerExtensions (mExtensions); mContext.setExtensions (&mExtensions); + + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); } int CSMTools::ScriptCheckStage::setup() @@ -78,17 +80,25 @@ int CSMTools::ScriptCheckStage::setup() mId.clear(); Compiler::ErrorHandler::reset(); + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + return mDocument.getData().getScripts().getSize(); } void CSMTools::ScriptCheckStage::perform (int stage, CSMDoc::Messages& messages) { + const CSMWorld::Record &record = mDocument.getData().getScripts().getRecord(stage); + mId = mDocument.getData().getScripts().getId (stage); if (mDocument.isBlacklisted ( CSMWorld::UniversalId (CSMWorld::UniversalId::Type_Script, mId))) return; + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted()) + return; + mMessages = &messages; switch (mWarningMode) @@ -100,10 +110,8 @@ void CSMTools::ScriptCheckStage::perform (int stage, CSMDoc::Messages& messages) try { - const CSMWorld::Data& data = mDocument.getData(); - - mFile = data.getScripts().getRecord (stage).get().mId; - std::istringstream input (data.getScripts().getRecord (stage).get().mScriptText); + mFile = record.get().mId; + std::istringstream input (record.get().mScriptText); Compiler::Scanner scanner (*this, input, mContext.getExtensions()); diff --git a/apps/opencs/model/tools/scriptcheck.hpp b/apps/opencs/model/tools/scriptcheck.hpp index f58215800..8f4ac9763 100644 --- a/apps/opencs/model/tools/scriptcheck.hpp +++ b/apps/opencs/model/tools/scriptcheck.hpp @@ -32,6 +32,7 @@ namespace CSMTools std::string mFile; CSMDoc::Messages *mMessages; WarningMode mWarningMode; + bool mIgnoreBaseRecords; CSMDoc::Message::Severity getSeverity (Type type); diff --git a/apps/opencs/model/tools/skillcheck.cpp b/apps/opencs/model/tools/skillcheck.cpp index 77ba8d4a2..2214ec11a 100644 --- a/apps/opencs/model/tools/skillcheck.cpp +++ b/apps/opencs/model/tools/skillcheck.cpp @@ -4,14 +4,20 @@ #include +#include "../prefs/state.hpp" + #include "../world/universalid.hpp" CSMTools::SkillCheckStage::SkillCheckStage (const CSMWorld::IdCollection& skills) : mSkills (skills) -{} +{ + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); +} int CSMTools::SkillCheckStage::setup() { + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + return mSkills.getSize(); } @@ -19,7 +25,8 @@ void CSMTools::SkillCheckStage::perform (int stage, CSMDoc::Messages& messages) { const CSMWorld::Record& record = mSkills.getRecord (stage); - if (record.isDeleted()) + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted()) return; const ESM::Skill& skill = record.get(); diff --git a/apps/opencs/model/tools/skillcheck.hpp b/apps/opencs/model/tools/skillcheck.hpp index 93b06fe71..edd6b79a0 100644 --- a/apps/opencs/model/tools/skillcheck.hpp +++ b/apps/opencs/model/tools/skillcheck.hpp @@ -13,6 +13,7 @@ namespace CSMTools class SkillCheckStage : public CSMDoc::Stage { const CSMWorld::IdCollection& mSkills; + bool mIgnoreBaseRecords; public: diff --git a/apps/opencs/model/tools/soundcheck.cpp b/apps/opencs/model/tools/soundcheck.cpp index 3dbd3ef11..b21341333 100644 --- a/apps/opencs/model/tools/soundcheck.cpp +++ b/apps/opencs/model/tools/soundcheck.cpp @@ -4,14 +4,20 @@ #include +#include "../prefs/state.hpp" + #include "../world/universalid.hpp" CSMTools::SoundCheckStage::SoundCheckStage (const CSMWorld::IdCollection& sounds) : mSounds (sounds) -{} +{ + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); +} int CSMTools::SoundCheckStage::setup() { + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + return mSounds.getSize(); } @@ -19,7 +25,8 @@ void CSMTools::SoundCheckStage::perform (int stage, CSMDoc::Messages& messages) { const CSMWorld::Record& record = mSounds.getRecord (stage); - if (record.isDeleted()) + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted()) return; const ESM::Sound& sound = record.get(); diff --git a/apps/opencs/model/tools/soundcheck.hpp b/apps/opencs/model/tools/soundcheck.hpp index 52f2d3714..d6fff5263 100644 --- a/apps/opencs/model/tools/soundcheck.hpp +++ b/apps/opencs/model/tools/soundcheck.hpp @@ -13,6 +13,7 @@ namespace CSMTools class SoundCheckStage : public CSMDoc::Stage { const CSMWorld::IdCollection& mSounds; + bool mIgnoreBaseRecords; public: diff --git a/apps/opencs/model/tools/soundgencheck.cpp b/apps/opencs/model/tools/soundgencheck.cpp index a36c494a1..acd245016 100644 --- a/apps/opencs/model/tools/soundgencheck.cpp +++ b/apps/opencs/model/tools/soundgencheck.cpp @@ -2,6 +2,8 @@ #include +#include "../prefs/state.hpp" + #include "../world/refiddata.hpp" #include "../world/universalid.hpp" @@ -11,20 +13,24 @@ CSMTools::SoundGenCheckStage::SoundGenCheckStage(const CSMWorld::IdCollection &record = mSoundGens.getRecord(stage); - if (record.isDeleted()) - { + + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted()) return; - } const ESM::SoundGenerator& soundGen = record.get(); CSMWorld::UniversalId id(CSMWorld::UniversalId::Type_SoundGen, soundGen.mId); diff --git a/apps/opencs/model/tools/soundgencheck.hpp b/apps/opencs/model/tools/soundgencheck.hpp index 91b08f979..19388cb91 100644 --- a/apps/opencs/model/tools/soundgencheck.hpp +++ b/apps/opencs/model/tools/soundgencheck.hpp @@ -13,6 +13,7 @@ namespace CSMTools const CSMWorld::IdCollection &mSoundGens; const CSMWorld::IdCollection &mSounds; const CSMWorld::RefIdCollection &mReferenceables; + bool mIgnoreBaseRecords; public: SoundGenCheckStage(const CSMWorld::IdCollection &soundGens, diff --git a/apps/opencs/model/tools/spellcheck.cpp b/apps/opencs/model/tools/spellcheck.cpp index 91aed37ed..6fb38138b 100644 --- a/apps/opencs/model/tools/spellcheck.cpp +++ b/apps/opencs/model/tools/spellcheck.cpp @@ -5,14 +5,20 @@ #include +#include "../prefs/state.hpp" + #include "../world/universalid.hpp" CSMTools::SpellCheckStage::SpellCheckStage (const CSMWorld::IdCollection& spells) : mSpells (spells) -{} +{ + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); +} int CSMTools::SpellCheckStage::setup() { + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + return mSpells.getSize(); } @@ -20,7 +26,8 @@ void CSMTools::SpellCheckStage::perform (int stage, CSMDoc::Messages& messages) { const CSMWorld::Record& record = mSpells.getRecord (stage); - if (record.isDeleted()) + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted()) return; const ESM::Spell& spell = record.get(); diff --git a/apps/opencs/model/tools/spellcheck.hpp b/apps/opencs/model/tools/spellcheck.hpp index 9c3ea8885..03513adc3 100644 --- a/apps/opencs/model/tools/spellcheck.hpp +++ b/apps/opencs/model/tools/spellcheck.hpp @@ -13,6 +13,7 @@ namespace CSMTools class SpellCheckStage : public CSMDoc::Stage { const CSMWorld::IdCollection& mSpells; + bool mIgnoreBaseRecords; public: diff --git a/apps/opencs/model/tools/startscriptcheck.cpp b/apps/opencs/model/tools/startscriptcheck.cpp index 220751797..64c1c9209 100644 --- a/apps/opencs/model/tools/startscriptcheck.cpp +++ b/apps/opencs/model/tools/startscriptcheck.cpp @@ -1,18 +1,23 @@ #include "startscriptcheck.hpp" +#include "../prefs/state.hpp" + #include CSMTools::StartScriptCheckStage::StartScriptCheckStage ( const CSMWorld::IdCollection& startScripts, const CSMWorld::IdCollection& scripts) : mStartScripts (startScripts), mScripts (scripts) -{} +{ + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); +} void CSMTools::StartScriptCheckStage::perform(int stage, CSMDoc::Messages& messages) { const CSMWorld::Record& record = mStartScripts.getRecord (stage); - if (record.isDeleted()) + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted()) return; std::string scriptId = record.get().mId; @@ -26,5 +31,7 @@ void CSMTools::StartScriptCheckStage::perform(int stage, CSMDoc::Messages& messa int CSMTools::StartScriptCheckStage::setup() { + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + return mStartScripts.getSize(); } diff --git a/apps/opencs/model/tools/startscriptcheck.hpp b/apps/opencs/model/tools/startscriptcheck.hpp index cb82cbae7..a7d70ee5a 100644 --- a/apps/opencs/model/tools/startscriptcheck.hpp +++ b/apps/opencs/model/tools/startscriptcheck.hpp @@ -14,6 +14,7 @@ namespace CSMTools { const CSMWorld::IdCollection& mStartScripts; const CSMWorld::IdCollection& mScripts; + bool mIgnoreBaseRecords; public: diff --git a/apps/opencs/model/tools/topicinfocheck.cpp b/apps/opencs/model/tools/topicinfocheck.cpp index 05f02c763..69ebec96b 100644 --- a/apps/opencs/model/tools/topicinfocheck.cpp +++ b/apps/opencs/model/tools/topicinfocheck.cpp @@ -2,6 +2,8 @@ #include +#include "../prefs/state.hpp" + #include "../world/infoselectwrapper.hpp" CSMTools::TopicInfoCheckStage::TopicInfoCheckStage( @@ -29,7 +31,9 @@ CSMTools::TopicInfoCheckStage::TopicInfoCheckStage( mTopics(topics), mReferencables(referencables), mSoundFiles(soundFiles) -{} +{ + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); +} int CSMTools::TopicInfoCheckStage::setup() { @@ -67,6 +71,8 @@ int CSMTools::TopicInfoCheckStage::setup() } } + mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + return mTopicInfos.getSize(); } @@ -74,7 +80,8 @@ void CSMTools::TopicInfoCheckStage::perform(int stage, CSMDoc::Messages& message { const CSMWorld::Record& infoRecord = mTopicInfos.getRecord(stage); - if (infoRecord.isDeleted()) + // Skip "Base" records (setting!) and "Deleted" records + if ((mIgnoreBaseRecords && infoRecord.isBaseOnly()) || infoRecord.isDeleted()) return; const CSMWorld::Info& topicInfo = infoRecord.get(); diff --git a/apps/opencs/model/tools/topicinfocheck.hpp b/apps/opencs/model/tools/topicinfocheck.hpp index 510901dac..dbd5fe1c5 100644 --- a/apps/opencs/model/tools/topicinfocheck.hpp +++ b/apps/opencs/model/tools/topicinfocheck.hpp @@ -65,6 +65,8 @@ namespace CSMTools std::set mCellNames; + bool mIgnoreBaseRecords; + // These return false when not successful and write an error bool verifyActor(const std::string& name, const CSMWorld::UniversalId& id, CSMDoc::Messages& messages); bool verifyCell(const std::string& name, const CSMWorld::UniversalId& id, CSMDoc::Messages& messages); diff --git a/apps/opencs/model/world/record.cpp b/apps/opencs/model/world/record.cpp index f13a36afc..3291b0462 100644 --- a/apps/opencs/model/world/record.cpp +++ b/apps/opencs/model/world/record.cpp @@ -2,6 +2,11 @@ CSMWorld::RecordBase::~RecordBase() {} +bool CSMWorld::RecordBase::isBaseOnly() const +{ + return mState == State_BaseOnly; +} + bool CSMWorld::RecordBase::isDeleted() const { return mState==State_Deleted || mState==State_Erased; diff --git a/apps/opencs/model/world/record.hpp b/apps/opencs/model/world/record.hpp index 3362f9f96..0468bf8e7 100644 --- a/apps/opencs/model/world/record.hpp +++ b/apps/opencs/model/world/record.hpp @@ -27,6 +27,8 @@ namespace CSMWorld virtual void assign (const RecordBase& record) = 0; ///< Will throw an exception if the types don't match. + bool isBaseOnly() const; + bool isDeleted() const; bool isErased() const; From c9756cee4cbb346cd2259471972038581fa71bbb Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Wed, 20 Jun 2018 12:37:58 +0400 Subject: [PATCH 12/18] Fast-forward death animation to end if death animation was finished earlier (regression #4468) --- apps/openmw/mwmechanics/character.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index fbdb19d5b..e2df546cd 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -2026,10 +2026,11 @@ void CharacterController::update(float duration) { // initial start of death animation for actors that started the game as dead // not done in constructor since we need to give scripts a chance to set the mSkipAnim flag - if (!mSkipAnim && mDeathState != CharState_None && mCurrentDeath.empty() && cls.isPersistent(mPtr)) + if (!mSkipAnim && mDeathState != CharState_None && mCurrentDeath.empty()) { - // Fast-forward death animation to end for persisting corpses - playDeath(1.f, mDeathState); + // Fast-forward death animation to end for persisting corpses or corpses after end of death animation + if (cls.isPersistent(mPtr) || cls.getCreatureStats(mPtr).isDeathAnimationFinished()) + playDeath(1.f, mDeathState); } // We must always queue movement, even if there is none, to apply gravity. world->queueMovement(mPtr, osg::Vec3f(0.f, 0.f, 0.f)); From c0fc615cd6472c87854354089700a2719b42702b Mon Sep 17 00:00:00 2001 From: Atahualpa Date: Wed, 20 Jun 2018 11:29:38 +0200 Subject: [PATCH 13/18] Adds the option to ignore "Base" records when running the verifier. (fixes #4466) Improves previous commit: 1. Initialise mIgnoreBase boolean member with FALSE. 2. Remove isBaseOnly() function and replace with direct use of Record member. --- apps/opencs/model/tools/birthsigncheck.cpp | 4 +- apps/opencs/model/tools/bodypartcheck.cpp | 4 +- apps/opencs/model/tools/classcheck.cpp | 4 +- apps/opencs/model/tools/factioncheck.cpp | 4 +- apps/opencs/model/tools/gmstcheck.cpp | 4 +- apps/opencs/model/tools/journalcheck.cpp | 6 +-- apps/opencs/model/tools/magiceffectcheck.cpp | 4 +- apps/opencs/model/tools/pathgridcheck.cpp | 4 +- apps/opencs/model/tools/racecheck.cpp | 4 +- .../opencs/model/tools/referenceablecheck.cpp | 42 +++++++++---------- apps/opencs/model/tools/referencecheck.cpp | 4 +- apps/opencs/model/tools/regioncheck.cpp | 4 +- apps/opencs/model/tools/scriptcheck.cpp | 4 +- apps/opencs/model/tools/skillcheck.cpp | 4 +- apps/opencs/model/tools/soundcheck.cpp | 4 +- apps/opencs/model/tools/soundgencheck.cpp | 4 +- apps/opencs/model/tools/spellcheck.cpp | 4 +- apps/opencs/model/tools/startscriptcheck.cpp | 4 +- apps/opencs/model/tools/topicinfocheck.cpp | 4 +- apps/opencs/model/world/record.cpp | 7 +--- apps/opencs/model/world/record.hpp | 4 +- 21 files changed, 60 insertions(+), 67 deletions(-) diff --git a/apps/opencs/model/tools/birthsigncheck.cpp b/apps/opencs/model/tools/birthsigncheck.cpp index 5fe2479cd..fc2989307 100644 --- a/apps/opencs/model/tools/birthsigncheck.cpp +++ b/apps/opencs/model/tools/birthsigncheck.cpp @@ -12,7 +12,7 @@ CSMTools::BirthsignCheckStage::BirthsignCheckStage (const CSMWorld::IdCollection& birthsigns) : mBirthsigns (birthsigns) { - mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + mIgnoreBaseRecords = false; } int CSMTools::BirthsignCheckStage::setup() @@ -27,7 +27,7 @@ void CSMTools::BirthsignCheckStage::perform (int stage, CSMDoc::Messages& messag const CSMWorld::Record& record = mBirthsigns.getRecord (stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted()) + if ((mIgnoreBaseRecords && record.mState == CSMWorld::RecordBase::State_BaseOnly) || record.isDeleted()) return; const ESM::BirthSign& birthsign = record.get(); diff --git a/apps/opencs/model/tools/bodypartcheck.cpp b/apps/opencs/model/tools/bodypartcheck.cpp index 8d19ef489..b5bd78f6c 100644 --- a/apps/opencs/model/tools/bodypartcheck.cpp +++ b/apps/opencs/model/tools/bodypartcheck.cpp @@ -10,7 +10,7 @@ CSMTools::BodyPartCheckStage::BodyPartCheckStage( mMeshes(meshes), mRaces(races) { - mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + mIgnoreBaseRecords = false; } int CSMTools::BodyPartCheckStage::setup() @@ -25,7 +25,7 @@ void CSMTools::BodyPartCheckStage::perform (int stage, CSMDoc::Messages &message const CSMWorld::Record &record = mBodyParts.getRecord(stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted()) + if ((mIgnoreBaseRecords && record.mState == CSMWorld::RecordBase::State_BaseOnly) || record.isDeleted()) return; const ESM::BodyPart &bodyPart = record.get(); diff --git a/apps/opencs/model/tools/classcheck.cpp b/apps/opencs/model/tools/classcheck.cpp index 82007c860..89923a398 100644 --- a/apps/opencs/model/tools/classcheck.cpp +++ b/apps/opencs/model/tools/classcheck.cpp @@ -13,7 +13,7 @@ CSMTools::ClassCheckStage::ClassCheckStage (const CSMWorld::IdCollection& classes) : mClasses (classes) { - mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + mIgnoreBaseRecords = false; } int CSMTools::ClassCheckStage::setup() @@ -28,7 +28,7 @@ void CSMTools::ClassCheckStage::perform (int stage, CSMDoc::Messages& messages) const CSMWorld::Record& record = mClasses.getRecord (stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted()) + if ((mIgnoreBaseRecords && record.mState == CSMWorld::RecordBase::State_BaseOnly) || record.isDeleted()) return; const ESM::Class& class_ = record.get(); diff --git a/apps/opencs/model/tools/factioncheck.cpp b/apps/opencs/model/tools/factioncheck.cpp index 2cf88fc0e..39073db5f 100644 --- a/apps/opencs/model/tools/factioncheck.cpp +++ b/apps/opencs/model/tools/factioncheck.cpp @@ -13,7 +13,7 @@ CSMTools::FactionCheckStage::FactionCheckStage (const CSMWorld::IdCollection& factions) : mFactions (factions) { - mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + mIgnoreBaseRecords = false; } int CSMTools::FactionCheckStage::setup() @@ -28,7 +28,7 @@ void CSMTools::FactionCheckStage::perform (int stage, CSMDoc::Messages& messages const CSMWorld::Record& record = mFactions.getRecord (stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted()) + if ((mIgnoreBaseRecords && record.mState == CSMWorld::RecordBase::State_BaseOnly) || record.isDeleted()) return; const ESM::Faction& faction = record.get(); diff --git a/apps/opencs/model/tools/gmstcheck.cpp b/apps/opencs/model/tools/gmstcheck.cpp index e3b4777bf..7cd13e5c2 100644 --- a/apps/opencs/model/tools/gmstcheck.cpp +++ b/apps/opencs/model/tools/gmstcheck.cpp @@ -9,7 +9,7 @@ CSMTools::GmstCheckStage::GmstCheckStage(const CSMWorld::IdCollection& gameSettings) : mGameSettings(gameSettings) { - mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + mIgnoreBaseRecords = false; } int CSMTools::GmstCheckStage::setup() @@ -24,7 +24,7 @@ void CSMTools::GmstCheckStage::perform(int stage, CSMDoc::Messages& messages) const CSMWorld::Record& record = mGameSettings.getRecord (stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted()) + if ((mIgnoreBaseRecords && record.mState == CSMWorld::RecordBase::State_BaseOnly) || record.isDeleted()) return; const ESM::GameSetting& gmst = record.get(); diff --git a/apps/opencs/model/tools/journalcheck.cpp b/apps/opencs/model/tools/journalcheck.cpp index a565f3786..4a7ab7d66 100644 --- a/apps/opencs/model/tools/journalcheck.cpp +++ b/apps/opencs/model/tools/journalcheck.cpp @@ -9,7 +9,7 @@ CSMTools::JournalCheckStage::JournalCheckStage(const CSMWorld::IdCollection &journalRecord = mJournals.getRecord(stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && journalRecord.isBaseOnly()) || journalRecord.isDeleted()) + if ((mIgnoreBaseRecords && journalRecord.mState == CSMWorld::RecordBase::State_BaseOnly) || journalRecord.isDeleted()) return; const ESM::Dialogue &journal = journalRecord.get(); @@ -51,7 +51,7 @@ void CSMTools::JournalCheckStage::perform(int stage, CSMDoc::Messages& messages) } // Skip "Base" records (setting!) - if (mIgnoreBaseRecords && infoRecord.isBaseOnly()) + if (mIgnoreBaseRecords && infoRecord.mState == CSMWorld::RecordBase::State_BaseOnly) continue; if (journalInfo.mResponse.empty()) diff --git a/apps/opencs/model/tools/magiceffectcheck.cpp b/apps/opencs/model/tools/magiceffectcheck.cpp index f9e83aa23..531bd9e1d 100644 --- a/apps/opencs/model/tools/magiceffectcheck.cpp +++ b/apps/opencs/model/tools/magiceffectcheck.cpp @@ -80,7 +80,7 @@ CSMTools::MagicEffectCheckStage::MagicEffectCheckStage(const CSMWorld::IdCollect mIcons(icons), mTextures(textures) { - mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + mIgnoreBaseRecords = false; } int CSMTools::MagicEffectCheckStage::setup() @@ -95,7 +95,7 @@ void CSMTools::MagicEffectCheckStage::perform(int stage, CSMDoc::Messages &messa const CSMWorld::Record &record = mMagicEffects.getRecord(stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted()) + if ((mIgnoreBaseRecords && record.mState == CSMWorld::RecordBase::State_BaseOnly) || record.isDeleted()) return; ESM::MagicEffect effect = record.get(); diff --git a/apps/opencs/model/tools/pathgridcheck.cpp b/apps/opencs/model/tools/pathgridcheck.cpp index 53293fa79..6427bb119 100644 --- a/apps/opencs/model/tools/pathgridcheck.cpp +++ b/apps/opencs/model/tools/pathgridcheck.cpp @@ -13,7 +13,7 @@ CSMTools::PathgridCheckStage::PathgridCheckStage (const CSMWorld::SubCellCollection& pathgrids) : mPathgrids (pathgrids) { - mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + mIgnoreBaseRecords = false; } int CSMTools::PathgridCheckStage::setup() @@ -28,7 +28,7 @@ void CSMTools::PathgridCheckStage::perform (int stage, CSMDoc::Messages& message const CSMWorld::Record& record = mPathgrids.getRecord (stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted()) + if ((mIgnoreBaseRecords && record.mState == CSMWorld::RecordBase::State_BaseOnly) || record.isDeleted()) return; const CSMWorld::Pathgrid& pathgrid = record.get(); diff --git a/apps/opencs/model/tools/racecheck.cpp b/apps/opencs/model/tools/racecheck.cpp index c7fd83224..38abfef18 100644 --- a/apps/opencs/model/tools/racecheck.cpp +++ b/apps/opencs/model/tools/racecheck.cpp @@ -22,7 +22,7 @@ void CSMTools::RaceCheckStage::performPerRecord (int stage, CSMDoc::Messages& me mPlayable = true; // Skip "Base" records (setting!) - if (mIgnoreBaseRecords && record.isBaseOnly()) + if (mIgnoreBaseRecords && record.mState == CSMWorld::RecordBase::State_BaseOnly) return; CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Race, race.mId); @@ -62,7 +62,7 @@ void CSMTools::RaceCheckStage::performFinal (CSMDoc::Messages& messages) CSMTools::RaceCheckStage::RaceCheckStage (const CSMWorld::IdCollection& races) : mRaces (races), mPlayable (false) { - mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + mIgnoreBaseRecords = false; } int CSMTools::RaceCheckStage::setup() diff --git a/apps/opencs/model/tools/referenceablecheck.cpp b/apps/opencs/model/tools/referenceablecheck.cpp index 0c9a32b5c..3e8dc1188 100644 --- a/apps/opencs/model/tools/referenceablecheck.cpp +++ b/apps/opencs/model/tools/referenceablecheck.cpp @@ -20,7 +20,7 @@ CSMTools::ReferenceableCheckStage::ReferenceableCheckStage( mScripts(scripts), mPlayerPresent(false) { - mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + mIgnoreBaseRecords = false; } void CSMTools::ReferenceableCheckStage::perform (int stage, CSMDoc::Messages& messages) @@ -244,7 +244,7 @@ void CSMTools::ReferenceableCheckStage::bookCheck( const CSMWorld::RecordBase& baseRecord = records.getRecord(stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) + if ((mIgnoreBaseRecords && baseRecord.mState == CSMWorld::RecordBase::State_BaseOnly) || baseRecord.isDeleted()) return; const ESM::Book& book = (dynamic_cast& >(baseRecord)).get(); @@ -264,7 +264,7 @@ void CSMTools::ReferenceableCheckStage::activatorCheck( const CSMWorld::RecordBase& baseRecord = records.getRecord(stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) + if ((mIgnoreBaseRecords && baseRecord.mState == CSMWorld::RecordBase::State_BaseOnly) || baseRecord.isDeleted()) return; const ESM::Activator& activator = (dynamic_cast& >(baseRecord)).get(); @@ -286,7 +286,7 @@ void CSMTools::ReferenceableCheckStage::potionCheck( const CSMWorld::RecordBase& baseRecord = records.getRecord(stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) + if ((mIgnoreBaseRecords && baseRecord.mState == CSMWorld::RecordBase::State_BaseOnly) || baseRecord.isDeleted()) return; const ESM::Potion& potion = (dynamic_cast& >(baseRecord)).get(); @@ -308,7 +308,7 @@ void CSMTools::ReferenceableCheckStage::apparatusCheck( const CSMWorld::RecordBase& baseRecord = records.getRecord(stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) + if ((mIgnoreBaseRecords && baseRecord.mState == CSMWorld::RecordBase::State_BaseOnly) || baseRecord.isDeleted()) return; const ESM::Apparatus& apparatus = (dynamic_cast& >(baseRecord)).get(); @@ -330,7 +330,7 @@ void CSMTools::ReferenceableCheckStage::armorCheck( const CSMWorld::RecordBase& baseRecord = records.getRecord(stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) + if ((mIgnoreBaseRecords && baseRecord.mState == CSMWorld::RecordBase::State_BaseOnly) || baseRecord.isDeleted()) return; const ESM::Armor& armor = (dynamic_cast& >(baseRecord)).get(); @@ -358,7 +358,7 @@ void CSMTools::ReferenceableCheckStage::clothingCheck( const CSMWorld::RecordBase& baseRecord = records.getRecord(stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) + if ((mIgnoreBaseRecords && baseRecord.mState == CSMWorld::RecordBase::State_BaseOnly) || baseRecord.isDeleted()) return; const ESM::Clothing& clothing = (dynamic_cast& >(baseRecord)).get(); @@ -377,7 +377,7 @@ void CSMTools::ReferenceableCheckStage::containerCheck( const CSMWorld::RecordBase& baseRecord = records.getRecord(stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) + if ((mIgnoreBaseRecords && baseRecord.mState == CSMWorld::RecordBase::State_BaseOnly) || baseRecord.isDeleted()) return; const ESM::Container& container = (dynamic_cast& >(baseRecord)).get(); @@ -410,7 +410,7 @@ void CSMTools::ReferenceableCheckStage::creatureCheck ( const CSMWorld::RecordBase& baseRecord = records.getRecord(stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) + if ((mIgnoreBaseRecords && baseRecord.mState == CSMWorld::RecordBase::State_BaseOnly) || baseRecord.isDeleted()) return; const ESM::Creature& creature = (dynamic_cast&>(baseRecord)).get(); @@ -487,7 +487,7 @@ void CSMTools::ReferenceableCheckStage::doorCheck( const CSMWorld::RecordBase& baseRecord = records.getRecord(stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) + if ((mIgnoreBaseRecords && baseRecord.mState == CSMWorld::RecordBase::State_BaseOnly) || baseRecord.isDeleted()) return; const ESM::Door& door = (dynamic_cast&>(baseRecord)).get(); @@ -512,7 +512,7 @@ void CSMTools::ReferenceableCheckStage::ingredientCheck( const CSMWorld::RecordBase& baseRecord = records.getRecord(stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) + if ((mIgnoreBaseRecords && baseRecord.mState == CSMWorld::RecordBase::State_BaseOnly) || baseRecord.isDeleted()) return; const ESM::Ingredient& ingredient = (dynamic_cast& >(baseRecord)).get(); @@ -532,7 +532,7 @@ void CSMTools::ReferenceableCheckStage::creaturesLevListCheck( const CSMWorld::RecordBase& baseRecord = records.getRecord(stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) + if ((mIgnoreBaseRecords && baseRecord.mState == CSMWorld::RecordBase::State_BaseOnly) || baseRecord.isDeleted()) return; const ESM::CreatureLevList& CreatureLevList = (dynamic_cast& >(baseRecord)).get(); @@ -549,7 +549,7 @@ void CSMTools::ReferenceableCheckStage::itemLevelledListCheck( const CSMWorld::RecordBase& baseRecord = records.getRecord(stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) + if ((mIgnoreBaseRecords && baseRecord.mState == CSMWorld::RecordBase::State_BaseOnly) || baseRecord.isDeleted()) return; const ESM::ItemLevList& ItemLevList = (dynamic_cast& >(baseRecord)).get(); @@ -565,7 +565,7 @@ void CSMTools::ReferenceableCheckStage::lightCheck( const CSMWorld::RecordBase& baseRecord = records.getRecord(stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) + if ((mIgnoreBaseRecords && baseRecord.mState == CSMWorld::RecordBase::State_BaseOnly) || baseRecord.isDeleted()) return; const ESM::Light& light = (dynamic_cast& >(baseRecord)).get(); @@ -589,7 +589,7 @@ void CSMTools::ReferenceableCheckStage::lockpickCheck( const CSMWorld::RecordBase& baseRecord = records.getRecord(stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) + if ((mIgnoreBaseRecords && baseRecord.mState == CSMWorld::RecordBase::State_BaseOnly) || baseRecord.isDeleted()) return; const ESM::Lockpick& lockpick = (dynamic_cast& >(baseRecord)).get(); @@ -611,7 +611,7 @@ void CSMTools::ReferenceableCheckStage::miscCheck( const CSMWorld::RecordBase& baseRecord = records.getRecord(stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) + if ((mIgnoreBaseRecords && baseRecord.mState == CSMWorld::RecordBase::State_BaseOnly) || baseRecord.isDeleted()) return; const ESM::Miscellaneous& miscellaneous = (dynamic_cast& >(baseRecord)).get(); @@ -640,7 +640,7 @@ void CSMTools::ReferenceableCheckStage::npcCheck ( mPlayerPresent = true; // Skip "Base" records (setting!) - if (mIgnoreBaseRecords && baseRecord.isBaseOnly()) + if (mIgnoreBaseRecords && baseRecord.mState == CSMWorld::RecordBase::State_BaseOnly) return; short level(npc.mNpdt.mLevel); @@ -749,7 +749,7 @@ void CSMTools::ReferenceableCheckStage::weaponCheck( const CSMWorld::RecordBase& baseRecord = records.getRecord (stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) + if ((mIgnoreBaseRecords && baseRecord.mState == CSMWorld::RecordBase::State_BaseOnly) || baseRecord.isDeleted()) return; const ESM::Weapon& weapon = (dynamic_cast& >(baseRecord)).get(); @@ -830,7 +830,7 @@ void CSMTools::ReferenceableCheckStage::probeCheck( const CSMWorld::RecordBase& baseRecord = records.getRecord(stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) + if ((mIgnoreBaseRecords && baseRecord.mState == CSMWorld::RecordBase::State_BaseOnly) || baseRecord.isDeleted()) return; const ESM::Probe& probe = (dynamic_cast& >(baseRecord)).get(); @@ -850,7 +850,7 @@ void CSMTools::ReferenceableCheckStage::repairCheck ( const CSMWorld::RecordBase& baseRecord = records.getRecord (stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) + if ((mIgnoreBaseRecords && baseRecord.mState == CSMWorld::RecordBase::State_BaseOnly) || baseRecord.isDeleted()) return; const ESM::Repair& repair = (dynamic_cast& >(baseRecord)).get(); @@ -870,7 +870,7 @@ void CSMTools::ReferenceableCheckStage::staticCheck ( const CSMWorld::RecordBase& baseRecord = records.getRecord (stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted()) + if ((mIgnoreBaseRecords && baseRecord.mState == CSMWorld::RecordBase::State_BaseOnly) || baseRecord.isDeleted()) return; const ESM::Static& staticElement = (dynamic_cast& >(baseRecord)).get(); diff --git a/apps/opencs/model/tools/referencecheck.cpp b/apps/opencs/model/tools/referencecheck.cpp index 347a8a399..447238be4 100644 --- a/apps/opencs/model/tools/referencecheck.cpp +++ b/apps/opencs/model/tools/referencecheck.cpp @@ -14,7 +14,7 @@ CSMTools::ReferenceCheckStage::ReferenceCheckStage( mCells(cells), mFactions(factions) { - mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + mIgnoreBaseRecords = false; } void CSMTools::ReferenceCheckStage::perform(int stage, CSMDoc::Messages &messages) @@ -22,7 +22,7 @@ void CSMTools::ReferenceCheckStage::perform(int stage, CSMDoc::Messages &message const CSMWorld::Record& record = mReferences.getRecord(stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted()) + if ((mIgnoreBaseRecords && record.mState == CSMWorld::RecordBase::State_BaseOnly) || record.isDeleted()) return; const CSMWorld::CellRef& cellRef = record.get(); diff --git a/apps/opencs/model/tools/regioncheck.cpp b/apps/opencs/model/tools/regioncheck.cpp index 45b311414..f21253090 100644 --- a/apps/opencs/model/tools/regioncheck.cpp +++ b/apps/opencs/model/tools/regioncheck.cpp @@ -12,7 +12,7 @@ CSMTools::RegionCheckStage::RegionCheckStage (const CSMWorld::IdCollection& regions) : mRegions (regions) { - mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + mIgnoreBaseRecords = false; } int CSMTools::RegionCheckStage::setup() @@ -27,7 +27,7 @@ void CSMTools::RegionCheckStage::perform (int stage, CSMDoc::Messages& messages) const CSMWorld::Record& record = mRegions.getRecord (stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted()) + if ((mIgnoreBaseRecords && record.mState == CSMWorld::RecordBase::State_BaseOnly) || record.isDeleted()) return; const ESM::Region& region = record.get(); diff --git a/apps/opencs/model/tools/scriptcheck.cpp b/apps/opencs/model/tools/scriptcheck.cpp index bf5d48f65..d3c6221cd 100644 --- a/apps/opencs/model/tools/scriptcheck.cpp +++ b/apps/opencs/model/tools/scriptcheck.cpp @@ -61,7 +61,7 @@ CSMTools::ScriptCheckStage::ScriptCheckStage (const CSMDoc::Document& document) Compiler::registerExtensions (mExtensions); mContext.setExtensions (&mExtensions); - mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + mIgnoreBaseRecords = false; } int CSMTools::ScriptCheckStage::setup() @@ -96,7 +96,7 @@ void CSMTools::ScriptCheckStage::perform (int stage, CSMDoc::Messages& messages) return; // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted()) + if ((mIgnoreBaseRecords && record.mState == CSMWorld::RecordBase::State_BaseOnly) || record.isDeleted()) return; mMessages = &messages; diff --git a/apps/opencs/model/tools/skillcheck.cpp b/apps/opencs/model/tools/skillcheck.cpp index 2214ec11a..b34d18e2a 100644 --- a/apps/opencs/model/tools/skillcheck.cpp +++ b/apps/opencs/model/tools/skillcheck.cpp @@ -11,7 +11,7 @@ CSMTools::SkillCheckStage::SkillCheckStage (const CSMWorld::IdCollection& skills) : mSkills (skills) { - mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + mIgnoreBaseRecords = false; } int CSMTools::SkillCheckStage::setup() @@ -26,7 +26,7 @@ void CSMTools::SkillCheckStage::perform (int stage, CSMDoc::Messages& messages) const CSMWorld::Record& record = mSkills.getRecord (stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted()) + if ((mIgnoreBaseRecords && record.mState == CSMWorld::RecordBase::State_BaseOnly) || record.isDeleted()) return; const ESM::Skill& skill = record.get(); diff --git a/apps/opencs/model/tools/soundcheck.cpp b/apps/opencs/model/tools/soundcheck.cpp index b21341333..b84453b5c 100644 --- a/apps/opencs/model/tools/soundcheck.cpp +++ b/apps/opencs/model/tools/soundcheck.cpp @@ -11,7 +11,7 @@ CSMTools::SoundCheckStage::SoundCheckStage (const CSMWorld::IdCollection& sounds) : mSounds (sounds) { - mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + mIgnoreBaseRecords = false; } int CSMTools::SoundCheckStage::setup() @@ -26,7 +26,7 @@ void CSMTools::SoundCheckStage::perform (int stage, CSMDoc::Messages& messages) const CSMWorld::Record& record = mSounds.getRecord (stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted()) + if ((mIgnoreBaseRecords && record.mState == CSMWorld::RecordBase::State_BaseOnly) || record.isDeleted()) return; const ESM::Sound& sound = record.get(); diff --git a/apps/opencs/model/tools/soundgencheck.cpp b/apps/opencs/model/tools/soundgencheck.cpp index acd245016..3692259ce 100644 --- a/apps/opencs/model/tools/soundgencheck.cpp +++ b/apps/opencs/model/tools/soundgencheck.cpp @@ -14,7 +14,7 @@ CSMTools::SoundGenCheckStage::SoundGenCheckStage(const CSMWorld::IdCollection &record = mSoundGens.getRecord(stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted()) + if ((mIgnoreBaseRecords && record.mState == CSMWorld::RecordBase::State_BaseOnly) || record.isDeleted()) return; const ESM::SoundGenerator& soundGen = record.get(); diff --git a/apps/opencs/model/tools/spellcheck.cpp b/apps/opencs/model/tools/spellcheck.cpp index 6fb38138b..3e59f0d9a 100644 --- a/apps/opencs/model/tools/spellcheck.cpp +++ b/apps/opencs/model/tools/spellcheck.cpp @@ -12,7 +12,7 @@ CSMTools::SpellCheckStage::SpellCheckStage (const CSMWorld::IdCollection& spells) : mSpells (spells) { - mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + mIgnoreBaseRecords = false; } int CSMTools::SpellCheckStage::setup() @@ -27,7 +27,7 @@ void CSMTools::SpellCheckStage::perform (int stage, CSMDoc::Messages& messages) const CSMWorld::Record& record = mSpells.getRecord (stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted()) + if ((mIgnoreBaseRecords && record.mState == CSMWorld::RecordBase::State_BaseOnly) || record.isDeleted()) return; const ESM::Spell& spell = record.get(); diff --git a/apps/opencs/model/tools/startscriptcheck.cpp b/apps/opencs/model/tools/startscriptcheck.cpp index 64c1c9209..b1d92380b 100644 --- a/apps/opencs/model/tools/startscriptcheck.cpp +++ b/apps/opencs/model/tools/startscriptcheck.cpp @@ -9,7 +9,7 @@ CSMTools::StartScriptCheckStage::StartScriptCheckStage ( const CSMWorld::IdCollection& scripts) : mStartScripts (startScripts), mScripts (scripts) { - mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + mIgnoreBaseRecords = false; } void CSMTools::StartScriptCheckStage::perform(int stage, CSMDoc::Messages& messages) @@ -17,7 +17,7 @@ void CSMTools::StartScriptCheckStage::perform(int stage, CSMDoc::Messages& messa const CSMWorld::Record& record = mStartScripts.getRecord (stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted()) + if ((mIgnoreBaseRecords && record.mState == CSMWorld::RecordBase::State_BaseOnly) || record.isDeleted()) return; std::string scriptId = record.get().mId; diff --git a/apps/opencs/model/tools/topicinfocheck.cpp b/apps/opencs/model/tools/topicinfocheck.cpp index 69ebec96b..ac1f596ae 100644 --- a/apps/opencs/model/tools/topicinfocheck.cpp +++ b/apps/opencs/model/tools/topicinfocheck.cpp @@ -32,7 +32,7 @@ CSMTools::TopicInfoCheckStage::TopicInfoCheckStage( mReferencables(referencables), mSoundFiles(soundFiles) { - mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue(); + mIgnoreBaseRecords = false; } int CSMTools::TopicInfoCheckStage::setup() @@ -81,7 +81,7 @@ void CSMTools::TopicInfoCheckStage::perform(int stage, CSMDoc::Messages& message const CSMWorld::Record& infoRecord = mTopicInfos.getRecord(stage); // Skip "Base" records (setting!) and "Deleted" records - if ((mIgnoreBaseRecords && infoRecord.isBaseOnly()) || infoRecord.isDeleted()) + if ((mIgnoreBaseRecords && infoRecord.mState == CSMWorld::RecordBase::State_BaseOnly) || infoRecord.isDeleted()) return; const CSMWorld::Info& topicInfo = infoRecord.get(); diff --git a/apps/opencs/model/world/record.cpp b/apps/opencs/model/world/record.cpp index 3291b0462..da1651f2b 100644 --- a/apps/opencs/model/world/record.cpp +++ b/apps/opencs/model/world/record.cpp @@ -2,11 +2,6 @@ CSMWorld::RecordBase::~RecordBase() {} -bool CSMWorld::RecordBase::isBaseOnly() const -{ - return mState == State_BaseOnly; -} - bool CSMWorld::RecordBase::isDeleted() const { return mState==State_Deleted || mState==State_Erased; @@ -22,4 +17,4 @@ bool CSMWorld::RecordBase::isErased() const bool CSMWorld::RecordBase::isModified() const { return mState==State_Modified || mState==State_ModifiedOnly; -} +} \ No newline at end of file diff --git a/apps/opencs/model/world/record.hpp b/apps/opencs/model/world/record.hpp index 0468bf8e7..0313f2e41 100644 --- a/apps/opencs/model/world/record.hpp +++ b/apps/opencs/model/world/record.hpp @@ -27,8 +27,6 @@ namespace CSMWorld virtual void assign (const RecordBase& record) = 0; ///< Will throw an exception if the types don't match. - bool isBaseOnly() const; - bool isDeleted() const; bool isErased() const; @@ -158,4 +156,4 @@ namespace CSMWorld } } -#endif +#endif \ No newline at end of file From c195144b17d1e9c55de0bc90eeff116b8c4292ba Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Wed, 20 Jun 2018 14:24:32 +0400 Subject: [PATCH 14/18] Take transformation from first node with given name in file (bug #4469) --- CHANGELOG.md | 1 + apps/openmw/mwrender/animation.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa680a09e..558a94cfb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ Bug #4458: AiWander console command handles idle chances incorrectly Bug #4459: NotCell dialogue condition doesn't support partial matches Bug #4461: "Open" spell from non-player caster isn't a crime + Bug #4469: Abot Silt Striders – Model turn 90 degrees on horizontal Feature #4256: Implement ToggleBorders (TB) console command Feature #3276: Editor: Search- Show number of (remaining) search results and indicate a search without any results Feature #4222: 360° screenshots diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index d96b9f809..0d740b2f6 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -100,7 +100,13 @@ namespace void apply(osg::MatrixTransform& trans) { - mMap[Misc::StringUtils::lowerCase(trans.getName())] = &trans; + // Take transformation for first found node in file + const std::string nodeName = Misc::StringUtils::lowerCase(trans.getName()); + if (mMap.find(nodeName) == mMap.end()) + { + mMap[nodeName] = &trans; + } + traverse(trans); } From 65ec58a669cc0eb511edd84bb30e82a24a13838c Mon Sep 17 00:00:00 2001 From: Nikolay Kasyanov Date: Wed, 20 Jun 2018 15:43:55 +0200 Subject: [PATCH 15/18] Move the changelog entry to 0.44.0 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6210f3f11..471df4f53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,6 @@ Bug #4433: Guard behaviour is incorrect with Alarm = 0 Bug #4443: Goodbye option and dialogue choices are not mutually exclusive Feature #4444: Per-group KF-animation files support - Bug #4424: [macOS] Cursor is either empty or garbage when compiled against macOS 10.13 SDK 0.44.0 ------ @@ -109,6 +108,7 @@ Feature #4423: Rebalance soul gem values Task #4015: Use AppVeyor build artifact features to make continuous builds available Editor: New (and more complete) icon set + Bug #4424: [macOS] Cursor is either empty or garbage when compiled against macOS 10.13 SDK 0.43.0 ------ From 4e121a74347e570517ca226121c1aab129962f63 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Wed, 20 Jun 2018 16:17:47 +0200 Subject: [PATCH 16/18] updated credits file --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index b13953824..415b87b4e 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -173,6 +173,7 @@ Programmers Documentation ------------- + Adam Bowen (adamnbowen) Alejandro Sanchez (HiPhish) Bodillium Bret Curtis (psi29a) From 9cf815505bcad7203a966f95bb8a0059fee5e4f3 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Wed, 20 Jun 2018 16:21:23 +0200 Subject: [PATCH 17/18] formatting --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 471df4f53..789aea001 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -94,6 +94,7 @@ Bug #4412: openmw-iniimporter ignores data paths from config Bug #4413: Moving with 0 strength uses all of your fatigue Bug #4420: Camera flickering when I open up and close menus while sneaking + Bug #4424: [macOS] Cursor is either empty or garbage when compiled against macOS 10.13 SDK Bug #4435: Item health is considered a signed integer Bug #4441: Adding items to currently disabled weapon-wielding creatures crashes the game Feature #1786: Round up encumbrance value in the encumbrance bar @@ -108,7 +109,6 @@ Feature #4423: Rebalance soul gem values Task #4015: Use AppVeyor build artifact features to make continuous builds available Editor: New (and more complete) icon set - Bug #4424: [macOS] Cursor is either empty or garbage when compiled against macOS 10.13 SDK 0.43.0 ------ From d1736ad0c8f10cea05baec60bede218e4fd1f6b0 Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Thu, 21 Jun 2018 14:23:30 +0000 Subject: [PATCH 18/18] Update .editorconfig to include GLSL --- .editorconfig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index 25cc3fffc..307f5e58f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,4 +8,9 @@ insert_final_newline = true [*.hpp] indent_style = space indent_size = 4 -insert_final_newline = true \ No newline at end of file +insert_final_newline = true + +[*.glsl] +indent_style = space +indent_size = 4 +insert_final_newline = false \ No newline at end of file