_ZNK4Ogre10ConfigFile20getSettingsBySectionEv:
   97|  1.07k|        const SettingsBySection_& getSettingsBySection() const {
   98|  1.07k|            return mSettings;
   99|  1.07k|        }

_ZN4Ogre28DefaultHardwareBufferManagerC2Ev:
   88|      1|        DefaultHardwareBufferManager() : mImpl(new DefaultHardwareBufferManagerBase()) {}
_ZN4Ogre28DefaultHardwareBufferManager18createVertexBufferEmmhb:
   99|  9.78k|        {
  100|  9.78k|            return mImpl->createVertexBuffer(vertexSize, numVerts, usage, useShadowBuffer);
  101|  9.78k|        }
_ZN4Ogre28DefaultHardwareBufferManager17createIndexBufferENS_19HardwareIndexBuffer9IndexTypeEmhb:
  106|   143k|        {
  107|   143k|            return mImpl->createIndexBuffer(itype, numIndexes, usage, useShadowBuffer);
  108|   143k|        }

_ZN4Ogre8EdgeData8TriangleC2Ev:
   71|  2.52k|            Triangle() :indexSet(0), vertexSet(0) {}

_ZN4Ogre8KeyFrameD2Ev:
   62|  5.04k|        virtual ~KeyFrame() {}
_ZNK4Ogre8KeyFrame7getTimeEv:
   65|  40.5k|        Real getTime(void) const { return mTime; }
_ZN4Ogre19VertexMorphKeyFrameD2Ev:
  158|  1.69k|        ~VertexMorphKeyFrame() {}
_ZN4Ogre18VertexPoseKeyFrameD2Ev:
  187|  2.38k|        ~VertexPoseKeyFrame() {}
_ZN4Ogre18VertexPoseKeyFrame7PoseRefC2Etf:
  208|  2.60k|            PoseRef(ushort p, float i) : poseIndex(p), influence(i) {}

_ZNK4Ogre11LodStrategy7getNameEv:
  103|      8|        const String& getName() const { return mName; }

_ZN4Ogre13OptimisedUtilC2Ev:
   64|      2|        OptimisedUtil(void) {}

_ZNK4Ogre9SharedPtrINS_4MeshEEptEv:
   63|  5.12k|        T* operator->() const { return shared_ptr<T>::operator->(); }
_ZN4Ogre9SharedPtrINS_10DataStreamEEC2INS_16MemoryDataStreamEEEPT_:
   50|  7.95k|        explicit SharedPtr(Y* ptr) : shared_ptr<T>(ptr) {}
_ZN4Ogre9SharedPtrINS_8ResourceEEC2INS_4MeshEEERKNS0_IT_EE:
   55|  5.12k|        SharedPtr(const SharedPtr<Y>& r) : shared_ptr<T>(r) {}
_ZNK4Ogre9SharedPtrINS_8SkeletonEEptEv:
   63|  1.33k|        T* operator->() const { return shared_ptr<T>::operator->(); }
_ZN4Ogre9SharedPtrINS_8ResourceEEC2INS_8SkeletonEEERKNS0_IT_EE:
   55|  1.33k|        SharedPtr(const SharedPtr<Y>& r) : shared_ptr<T>(r) {}

_ZN4Ogre16StreamSerialiser5ChunkC2Ev:
  105|  1.36k|            Chunk() : id(0), version(1), length(0), offset(0) {}
_ZN4Ogre16StreamSerialiser4readIjEEvPT_m:
  301|  4.57k|        {
  302|  4.57k|            readData(pT, sizeof(T), count);
  303|  4.57k|        }
_ZN4Ogre16StreamSerialiser4readItEEvPT_m:
  301|  1.23k|        {
  302|  1.23k|            readData(pT, sizeof(T), count);
  303|  1.23k|        }
_ZN4Ogre16StreamSerialiser4readIcEEvPT_m:
  301|    300|        {
  302|    300|            readData(pT, sizeof(T), count);
  303|    300|        }
_ZN4Ogre16StreamSerialiser13readConvertedIfdEEvPT_T0_m:
  372|    669|        {
  373|    669|            std::vector<U> tmp(count);
  374|    669|            readData(tmp.data(), sizeof(U), count);
  375|    669|            for (auto& e : tmp)
  ------------------
  |  Branch (375:26): [True: 1.58k, False: 669]
  ------------------
  376|  1.58k|                *dst++ = static_cast<T>(e);
  377|    669|        }

_ZN4Ogre6VectorILi3EfEC2Ev:
  285|    827|        Vector() {}
_ZN4Ogre10VectorBaseILi3EfEC2Ev:
  130|    827|        VectorBase() {}
_ZN4Ogre6VectorILi4EfEC2Ev:
  285|    827|        Vector() {}
_ZN4Ogre10VectorBaseILi4EfEC2Ev:
  259|    827|        VectorBase() {}

_ZN4Ogre13AlignedMemory8allocateEmm:
   59|   155k|    {
   60|   155k|        assert(0 < alignment && alignment <= 128 && Bitwise::isPO2(alignment));
   61|       |
   62|   155k|        unsigned char* p = new unsigned char[size + alignment];
   63|   155k|        size_t offset = alignment - (size_t(p) & (alignment-1));
   64|       |
   65|   155k|        unsigned char* result = p + offset;
   66|   155k|        result[-1] = (unsigned char)offset;
   67|       |
   68|   155k|        return result;
   69|   155k|    }
_ZN4Ogre13AlignedMemory8allocateEm:
   72|   154k|    {
   73|       |        return allocate(size, OGRE_SIMD_ALIGNMENT);
   74|   154k|    }
_ZN4Ogre13AlignedMemory10deallocateEPv:
   77|   155k|    {
   78|   155k|        if (p)
  ------------------
  |  Branch (78:13): [True: 155k, False: 0]
  ------------------
   79|   155k|        {
   80|   155k|            unsigned char* mem = (unsigned char*)p;
   81|   155k|            mem = mem - mem[-1];
   82|   155k|            delete [] mem;
   83|   155k|        }
   84|   155k|    }

_ZN4Ogre9AnimationC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEf:
   39|  4.11k|        : mName(name)
   40|  4.11k|        , mLength(length)
   41|  4.11k|        , mInterpolationMode(msDefaultInterpolationMode)
   42|  4.11k|        , mRotationInterpolationMode(msDefaultRotationInterpolationMode)
   43|  4.11k|        , mKeyFrameTimesDirty(false)
   44|  4.11k|        , mUseBaseKeyFrame(false)
   45|  4.11k|        , mBaseKeyFrameTime(0.0f)
   46|  4.11k|        , mBaseKeyFrameAnimationName(BLANKSTRING)
   47|  4.11k|        , mContainer(0)
   48|  4.11k|    {
   49|  4.11k|    }
_ZN4Ogre9AnimationD2Ev:
   52|  4.11k|    {
   53|  4.11k|        destroyAllTracks();
   54|  4.11k|    }
_ZN4Ogre9Animation15createNodeTrackEt:
   67|    201|    {
   68|    201|        if (hasNodeTrack(handle))
  ------------------
  |  Branch (68:13): [True: 4, False: 197]
  ------------------
   69|      4|        {
   70|      4|            OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM,
   71|      4|                "Node track with the specified handle " +
   72|      4|                StringConverter::toString(handle) + " already exists",
   73|      4|                "Animation::createNodeTrack");
   74|      4|        }
   75|       |
   76|    197|        NodeAnimationTrack* ret = OGRE_NEW NodeAnimationTrack(this, handle);
   77|       |
   78|    197|        mNodeTrackList[handle] = ret;
   79|    197|        return ret;
   80|    201|    }
_ZN4Ogre9Animation15createNodeTrackEtPNS_4NodeE:
   83|    201|    {
   84|    201|        NodeAnimationTrack* ret = createNodeTrack(handle);
   85|       |
   86|    201|        ret->setAssociatedNode(node);
   87|       |
   88|    201|        return ret;
   89|    201|    }
_ZNK4Ogre9Animation12hasNodeTrackEt:
   97|    201|    {
   98|    201|        return (mNodeTrackList.find(handle) != mNodeTrackList.end());
   99|    201|    }
_ZN4Ogre9Animation20destroyAllNodeTracksEv:
  130|  4.11k|    {
  131|  4.11k|        for (auto& t : mNodeTrackList)
  ------------------
  |  Branch (131:22): [True: 197, False: 4.11k]
  ------------------
  132|    197|        {
  133|       |            OGRE_DELETE t.second;
  134|    197|        }
  135|  4.11k|        mNodeTrackList.clear();
  136|  4.11k|        _keyFrameListChanged();
  137|  4.11k|    }
_ZN4Ogre9Animation23destroyAllNumericTracksEv:
  194|  4.11k|    {
  195|  4.11k|        for (auto& t : mNumericTrackList)
  ------------------
  |  Branch (195:22): [True: 0, False: 4.11k]
  ------------------
  196|      0|        {
  197|       |            OGRE_DELETE t.second;
  198|      0|        }
  199|  4.11k|        mNumericTrackList.clear();
  200|  4.11k|        _keyFrameListChanged();
  201|  4.11k|    }
_ZN4Ogre9Animation17createVertexTrackEtNS_19VertexAnimationTypeE:
  205|  1.27k|    {
  206|  1.27k|        if (hasVertexTrack(handle))
  ------------------
  |  Branch (206:13): [True: 7, False: 1.27k]
  ------------------
  207|      7|        {
  208|      7|            OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM,
  209|      7|                "Vertex track with the specified handle " +
  210|      7|                StringConverter::toString(handle) + " already exists",
  211|      7|                "Animation::createVertexTrack");
  212|      7|        }
  213|       |
  214|  1.27k|        VertexAnimationTrack* ret = OGRE_NEW VertexAnimationTrack(this, handle, animType);
  215|       |
  216|  1.27k|        mVertexTrackList[handle] = ret;
  217|  1.27k|        return ret;
  218|       |
  219|  1.27k|    }
_ZN4Ogre9Animation17createVertexTrackEtPNS_10VertexDataENS_19VertexAnimationTypeE:
  223|  1.27k|    {
  224|  1.27k|        OgreAssert(data, "VertexData must not be null");
  ------------------
  |  Branch (224:9): [True: 0, False: 1.27k]
  ------------------
  225|  1.27k|        VertexAnimationTrack* ret = createVertexTrack(handle, animType);
  226|       |
  227|  1.27k|        ret->setAssociatedVertexData(data);
  228|       |
  229|  1.27k|        return ret;
  230|  1.27k|    }
_ZNK4Ogre9Animation14hasVertexTrackEt:
  238|  1.27k|    {
  239|  1.27k|        return (mVertexTrackList.find(handle) != mVertexTrackList.end());
  240|  1.27k|    }
_ZN4Ogre9Animation22destroyAllVertexTracksEv:
  271|  4.11k|    {
  272|  4.11k|        for (auto& v : mVertexTrackList)
  ------------------
  |  Branch (272:22): [True: 1.27k, False: 4.11k]
  ------------------
  273|  1.27k|        {
  274|       |            OGRE_DELETE  v.second;
  275|  1.27k|        }
  276|  4.11k|        mVertexTrackList.clear();
  277|  4.11k|        _keyFrameListChanged();
  278|  4.11k|    }
_ZN4Ogre9Animation16destroyAllTracksEv:
  281|  4.11k|    {
  282|  4.11k|        destroyAllNodeTracks();
  283|  4.11k|        destroyAllNumericTracks();
  284|  4.11k|        destroyAllVertexTracks();
  285|  4.11k|    }
_ZN4Ogre9Animation18setUseBaseKeyFrameEbfRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  658|    217|    {
  659|    217|        if (useBaseKeyFrame != mUseBaseKeyFrame ||
  ------------------
  |  Branch (659:13): [True: 217, False: 0]
  ------------------
  660|      0|            keyframeTime != mBaseKeyFrameTime ||
  ------------------
  |  Branch (660:13): [True: 0, False: 0]
  ------------------
  661|      0|            baseAnimName != mBaseKeyFrameAnimationName)
  ------------------
  |  Branch (661:13): [True: 0, False: 0]
  ------------------
  662|    217|        {
  663|    217|            mUseBaseKeyFrame = useBaseKeyFrame;
  664|    217|            mBaseKeyFrameTime = keyframeTime;
  665|    217|            mBaseKeyFrameAnimationName = baseAnimName;
  666|    217|        }
  667|    217|    }
_ZN4Ogre9Animation16_notifyContainerEPNS_18AnimationContainerE:
  737|  4.11k|    {
  738|  4.11k|        mContainer = c;
  739|  4.11k|    }

_ZN4Ogre14AnimationTrackC2EPNS_9AnimationEt:
   48|  1.46k|        mParent(parent), mListener(0), mHandle(handle)
   49|  1.46k|    {
   50|  1.46k|    }
_ZN4Ogre14AnimationTrackD2Ev:
   53|  1.46k|    {
   54|  1.46k|        removeAllKeyFrames();
   55|  1.46k|    }
_ZN4Ogre14AnimationTrack14createKeyFrameEf:
  129|  5.04k|    {
  130|  5.04k|        KeyFrame* kf = createKeyFrameImpl(timePos);
  131|       |
  132|       |        // Insert just before upper bound
  133|  5.04k|        KeyFrameList::iterator i =
  134|  5.04k|            std::upper_bound(mKeyFrames.begin(), mKeyFrames.end(), kf, KeyFrameTimeLess());
  135|  5.04k|        mKeyFrames.insert(i, kf);
  136|       |
  137|  5.04k|        _keyFrameDataChanged();
  138|  5.04k|        mParent->_keyFrameListChanged();
  139|       |
  140|  5.04k|        return kf;
  141|       |
  142|  5.04k|    }
_ZN4Ogre14AnimationTrack18removeAllKeyFramesEv:
  164|  1.46k|    {
  165|  1.46k|        for (auto *f : mKeyFrames)
  ------------------
  |  Branch (165:22): [True: 5.04k, False: 1.46k]
  ------------------
  166|  5.04k|            OGRE_DELETE f;
  167|       |
  168|  1.46k|        _keyFrameDataChanged();
  169|  1.46k|        mParent->_keyFrameListChanged();
  170|       |
  171|  1.46k|        mKeyFrames.clear();
  172|       |
  173|  1.46k|    }
_ZN4Ogre18NodeAnimationTrackC2EPNS_9AnimationEt:
  357|    197|        : NodeAnimationTrack(parent, handle, 0)
  358|    197|    {
  359|    197|    }
_ZN4Ogre18NodeAnimationTrackC2EPNS_9AnimationEtPNS_4NodeE:
  362|    197|        : AnimationTrack(parent, handle), mSplineBuildNeeded(false), mUseShortestRotationPath(true),
  363|    197|          mTargetNode(targetNode), mSplines(0)
  364|       |
  365|    197|    {
  366|    197|    }
_ZN4Ogre18NodeAnimationTrackD2Ev:
  369|    197|    {
  370|       |        OGRE_DELETE_T(mSplines, Splines, MEMCATEGORY_ANIMATION);
  371|    197|    }
_ZN4Ogre18NodeAnimationTrack17setAssociatedNodeEPNS_4NodeE:
  469|    197|    {
  470|    197|        mTargetNode = node;
  471|    197|    }
_ZNK4Ogre18NodeAnimationTrack20_keyFrameDataChangedEv:
  564|  3.15k|    {
  565|  3.15k|        mSplineBuildNeeded = true;
  566|  3.15k|    }
_ZN4Ogre18NodeAnimationTrack18createKeyFrameImplEf:
  648|    962|    {
  649|       |        return OGRE_NEW TransformKeyFrame(this, time);
  650|    962|    }
_ZN4Ogre18NodeAnimationTrack18createNodeKeyFrameEf:
  653|    962|    {
  654|    962|        return static_cast<TransformKeyFrame*>(createKeyFrame(timePos));
  655|    962|    }
_ZN4Ogre20VertexAnimationTrackC2EPNS_9AnimationEtNS_19VertexAnimationTypeE:
  687|  1.27k|        : AnimationTrack(parent, handle)
  688|  1.27k|        , mAnimationType(animType)
  689|  1.27k|    {
  690|  1.27k|    }
_ZN4Ogre20VertexAnimationTrack25createVertexMorphKeyFrameEf:
  702|  1.69k|    {
  703|  1.69k|        OgreAssert(mAnimationType == VAT_MORPH, "Type mismatch");
  ------------------
  |  Branch (703:9): [True: 3, False: 1.69k]
  ------------------
  704|  1.69k|        return static_cast<VertexMorphKeyFrame*>(createKeyFrame(timePos));
  705|  1.69k|    }
_ZN4Ogre20VertexAnimationTrack24createVertexPoseKeyFrameEf:
  708|  2.39k|    {
  709|  2.39k|        OgreAssert(mAnimationType == VAT_POSE, "Type mismatch");
  ------------------
  |  Branch (709:9): [True: 8, False: 2.38k]
  ------------------
  710|  2.38k|        return static_cast<VertexPoseKeyFrame*>(createKeyFrame(timePos));
  711|  2.39k|    }
_ZN4Ogre20VertexAnimationTrack18createKeyFrameImplEf:
  960|  4.07k|    {
  961|  4.07k|        switch(mAnimationType)
  962|  4.07k|        {
  963|      0|        default:
  ------------------
  |  Branch (963:9): [True: 0, False: 4.07k]
  ------------------
  964|  1.69k|        case VAT_MORPH:
  ------------------
  |  Branch (964:9): [True: 1.69k, False: 2.38k]
  ------------------
  965|  1.69k|            return OGRE_NEW VertexMorphKeyFrame(this, time);
  966|  2.38k|        case VAT_POSE:
  ------------------
  |  Branch (966:9): [True: 2.38k, False: 1.69k]
  ------------------
  967|  2.38k|            return OGRE_NEW VertexPoseKeyFrame(this, time);
  968|  4.07k|        };
  969|       |
  970|      0|    }
OgreAnimationTrack.cpp:_ZNK4Ogre12_GLOBAL__N_116KeyFrameTimeLessclEPKNS_8KeyFrameES4_:
   40|  20.2k|            {
   41|  20.2k|                return kf->getTime() < kf2->getTime();
   42|  20.2k|            }

_ZN4Ogre4BoneC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEtPNS_8SkeletonE:
   39|    814|        : Node(name), mCreator(creator), mHandle(handle), mManuallyControlled(false)
   40|    814|    {
   41|    814|    }
_ZN4Ogre4BoneD2Ev:
   44|    814|    {
   45|    814|    }
_ZN4Ogre4Bone14setBindingPoseEv:
   68|    667|    {
   69|    667|        setInitialState();
   70|       |
   71|       |        // Save inverse derived position/scale/orientation, used for calculate offset transform later
   72|    667|        mBindDerivedInversePosition = - _getDerivedPosition();
   73|    667|        mBindDerivedInverseScale = Vector3::UNIT_SCALE / _getDerivedScale();
   74|    667|        mBindDerivedInverseOrientation = _getDerivedOrientation().Inverse();
   75|    667|    }
_ZN4Ogre4Bone10needUpdateEb:
  108|  1.66k|    {
  109|  1.66k|        Node::needUpdate(forceParentUpdate);
  110|       |
  111|  1.66k|        if (isManuallyControlled())
  ------------------
  |  Branch (111:13): [True: 0, False: 1.66k]
  ------------------
  112|      0|        {
  113|       |            // Dirty the skeleton if manually controlled so animation can be updated
  114|      0|            mCreator->_notifyManualBonesDirty();
  115|      0|        }
  116|       |
  117|  1.66k|    }

_ZN4Ogre5Codec13registerCodecEPS0_:
   62|      1|    {
   63|      1|        auto ret = msMapCodecs.emplace(pCodec->getType(), pCodec);
   64|      1|        if (!ret.second)
  ------------------
  |  Branch (64:13): [True: 0, False: 1]
  ------------------
   65|       |            OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM, pCodec->getType() + " already has a registered codec");
   66|      1|    }

_ZN4Ogre19logMaterialNotFoundERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_S8_S8_NS_15LogMessageLevelE:
   67|   152k|    {
   68|   152k|        LogManager::getSingleton().logMessage(
   69|   152k|            StringUtil::format("Can't assign material to %s '%s'. Material '%s' not found in group '%s'. Have you "
   70|   152k|                               "forgotten to define it in a .material script?",
   71|   152k|                               destType.c_str(), destName.c_str(), name.c_str(), groupName.c_str()),
   72|   152k|            lml);
   73|   152k|    }

_ZN4Ogre10ConfigFileC2Ev:
   38|  1.07k|    {
   39|  1.07k|    }
_ZN4Ogre10ConfigFile5clearEv:
   42|  1.07k|    {
   43|  1.07k|        mSettings.clear();
   44|  1.07k|        mSettingsPtr.clear();
   45|  1.07k|    }
_ZN4Ogre10ConfigFile4loadERKNS_9SharedPtrINS_10DataStreamEEERKNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEb:
   74|  1.07k|    {
   75|       |        /* Clear current settings map */
   76|  1.07k|        clear();
   77|       |
   78|  1.07k|        String currentSection = BLANKSTRING;
   79|  1.07k|        SettingsMultiMap* currentSettings = &mSettings[currentSection];
   80|  1.07k|        mSettingsPtr[currentSection] = currentSettings;
   81|       |
   82|       |
   83|       |        /* Process the file line for line */
   84|  1.07k|        String line, optName, optVal;
   85|  32.8k|        while (!stream->eof())
  ------------------
  |  Branch (85:16): [True: 31.8k, False: 1.07k]
  ------------------
   86|  31.8k|        {
   87|  31.8k|            line = stream->getLine();
   88|       |            /* Ignore comments & blanks */
   89|  31.8k|            if (line.length() > 0 && line.at(0) != '#' && line.at(0) != '@')
  ------------------
  |  Branch (89:17): [True: 30.3k, False: 1.47k]
  |  Branch (89:38): [True: 30.1k, False: 217]
  |  Branch (89:59): [True: 29.8k, False: 289]
  ------------------
   90|  29.8k|            {
   91|  29.8k|                if (line.at(0) == '[' && line.at(line.length()-1) == ']')
  ------------------
  |  Branch (91:21): [True: 9.36k, False: 20.4k]
  |  Branch (91:42): [True: 8.13k, False: 1.23k]
  ------------------
   92|  8.13k|                {
   93|       |                    // Section
   94|  8.13k|                    currentSection = line.substr(1, line.length() - 2);
   95|  8.13k|                    currentSettings = &mSettings[currentSection];
   96|  8.13k|                    mSettingsPtr[currentSection] = currentSettings;
   97|  8.13k|                }
   98|  21.6k|                else
   99|  21.6k|                {
  100|       |                    /* Find the first separator character and split the string there */
  101|  21.6k|                    Ogre::String::size_type separator_pos = line.find_first_of(separators, 0);
  102|  21.6k|                    if (separator_pos != Ogre::String::npos)
  ------------------
  |  Branch (102:25): [True: 18.9k, False: 2.78k]
  ------------------
  103|  18.9k|                    {
  104|  18.9k|                        optName = line.substr(0, separator_pos);
  105|       |                        /* Find the first non-separator character following the name */
  106|  18.9k|                        Ogre::String::size_type nonseparator_pos = line.find_first_not_of(separators, separator_pos);
  107|       |                        /* ... and extract the value */
  108|       |                        /* Make sure we don't crash on an empty setting (it might be a valid value) */
  109|  18.9k|                        optVal = (nonseparator_pos == Ogre::String::npos) ? "" : line.substr(nonseparator_pos);
  ------------------
  |  Branch (109:34): [True: 16.5k, False: 2.39k]
  ------------------
  110|  18.9k|                        if (trimWhitespace)
  ------------------
  |  Branch (110:29): [True: 18.9k, False: 0]
  ------------------
  111|  18.9k|                        {
  112|  18.9k|                            StringUtil::trim(optVal);
  113|  18.9k|                            StringUtil::trim(optName);
  114|  18.9k|                        }
  115|  18.9k|                        currentSettings->emplace(optName, optVal);
  116|  18.9k|                    }
  117|  21.6k|                }
  118|  29.8k|            }
  119|  31.8k|        }
  120|  1.07k|    }

_ZN4Ogre10DataStream7getLineEb:
   41|   258k|    {
   42|   258k|        char tmpBuf[OGRE_STREAM_TEMP_SIZE];
   43|   258k|        String retString;
   44|   258k|        size_t readCount;
   45|       |        // Keep looping while not hitting delimiter
   46|   847k|        while ((readCount = read(tmpBuf, OGRE_STREAM_TEMP_SIZE-1)) != 0)
  ------------------
  |  Branch (46:16): [True: 844k, False: 2.50k]
  ------------------
   47|   844k|        {
   48|   844k|            const char* p = static_cast<const char*>(memchr(tmpBuf, '\n', readCount));
   49|   844k|            size_t appendCount = readCount;
   50|   844k|            if (p != 0)
  ------------------
  |  Branch (50:17): [True: 256k, False: 588k]
  ------------------
   51|   256k|            {
   52|   256k|                appendCount = static_cast<size_t>(p - tmpBuf);
   53|       |                // Reposition backwards
   54|   256k|                skip(static_cast<long>(appendCount + 1 - readCount));
   55|   256k|            }
   56|       |
   57|   844k|            retString.append(tmpBuf, appendCount);
   58|       |
   59|   844k|            if (p != 0)
  ------------------
  |  Branch (59:17): [True: 256k, False: 588k]
  ------------------
   60|   256k|            {
   61|       |                // Trim off trailing CR if this was a CR/LF entry
   62|   256k|                if (retString.length() && retString[retString.length()-1] == '\r')
  ------------------
  |  Branch (62:21): [True: 248k, False: 7.55k]
  |  Branch (62:43): [True: 1.26k, False: 247k]
  ------------------
   63|  1.26k|                {
   64|  1.26k|                    retString.erase(retString.length()-1, 1);
   65|  1.26k|                }
   66|       |
   67|       |                // Found terminator, break out
   68|   256k|                break;
   69|   256k|            }
   70|   844k|        }
   71|       |
   72|   258k|        if (trimAfter)
  ------------------
  |  Branch (72:13): [True: 31.8k, False: 226k]
  ------------------
   73|  31.8k|        {
   74|  31.8k|            StringUtil::trim(retString);
   75|  31.8k|        }
   76|       |
   77|   258k|        return retString;
   78|   258k|    }
_ZN4Ogre16MemoryDataStreamC2EPvmbb:
  188|  6.88k|        : DataStream(static_cast<uint16>(readOnly ? READ : (READ | WRITE)))
  ------------------
  |  Branch (188:42): [True: 6.88k, False: 0]
  ------------------
  189|  6.88k|    {
  190|  6.88k|        mData = mPos = static_cast<uchar*>(pMem);
  191|  6.88k|        mSize = inSize;
  192|  6.88k|        mEnd = mData + mSize;
  193|  6.88k|        mFreeOnClose = freeOnClose;
  194|       |        assert(mEnd >= mPos);
  195|  6.88k|    }
_ZN4Ogre16MemoryDataStreamC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPvmbb:
  199|  1.07k|        : DataStream(name, static_cast<uint16>(readOnly ? READ : (READ | WRITE)))
  ------------------
  |  Branch (199:48): [True: 1.07k, False: 0]
  ------------------
  200|  1.07k|    {
  201|  1.07k|        mData = mPos = static_cast<uchar*>(pMem);
  202|  1.07k|        mSize = inSize;
  203|  1.07k|        mEnd = mData + mSize;
  204|  1.07k|        mFreeOnClose = freeOnClose;
  205|       |        assert(mEnd >= mPos);
  206|  1.07k|    }
_ZN4Ogre16MemoryDataStreamD2Ev:
  336|  7.95k|    {
  337|  7.95k|        close();
  338|  7.95k|    }
_ZN4Ogre16MemoryDataStream4readEPvm:
  341|  3.80M|    {
  342|       |        // Read over end of memory?
  343|  3.80M|        if (mPos >= mEnd)
  ------------------
  |  Branch (343:13): [True: 77.0k, False: 3.72M]
  ------------------
  344|  77.0k|            return 0;
  345|  3.72M|        size_t cnt = std::min(count, static_cast<size_t>(mEnd - mPos));
  346|  3.72M|        if (cnt == 0)
  ------------------
  |  Branch (346:13): [True: 3.68k, False: 3.72M]
  ------------------
  347|  3.68k|            return 0;
  348|       |
  349|  3.72M|        assert (cnt<=count);
  350|       |
  351|  3.72M|        memcpy(buf, mPos, cnt);
  352|  3.72M|        mPos += cnt;
  353|  3.72M|        return cnt;
  354|  3.72M|    }
_ZN4Ogre16MemoryDataStream4skipEl:
  433|   639k|    {
  434|       |        // will underflow to size_t max if we skip below 0
  435|   639k|        size_t newpos = (size_t)( ( mPos - mData ) + count );
  436|       |
  437|   639k|        if (mData + newpos > mEnd)
  ------------------
  |  Branch (437:13): [True: 351, False: 639k]
  ------------------
  438|    351|            newpos = static_cast<size_t>(mEnd - mData); // will trigger eof
  439|   639k|        mPos = mData + newpos;
  440|   639k|    }
_ZN4Ogre16MemoryDataStream4seekEm:
  443|  5.21k|    {
  444|  5.21k|        if (mData + pos > mEnd)
  ------------------
  |  Branch (444:13): [True: 21, False: 5.19k]
  ------------------
  445|     21|            pos = static_cast<size_t>(mEnd - mData); // will trigger eof
  446|  5.21k|        mPos = mData + pos;
  447|  5.21k|    }
_ZNK4Ogre16MemoryDataStream4tellEv:
  450|   886k|    {
  451|       |        //mData is start, mPos is current location
  452|   886k|        return mPos - mData;
  453|   886k|    }
_ZNK4Ogre16MemoryDataStream3eofEv:
  456|  3.08M|    {
  457|  3.08M|        return mPos >= mEnd;
  458|  3.08M|    }
_ZN4Ogre16MemoryDataStream5closeEv:
  461|  7.95k|    {
  462|  7.95k|        mAccess = 0;
  463|  7.95k|        if (mFreeOnClose && mData)
  ------------------
  |  Branch (463:13): [True: 0, False: 7.95k]
  |  Branch (463:29): [True: 0, False: 0]
  ------------------
  464|      0|        {
  465|       |            OGRE_FREE(mData, MEMCATEGORY_GENERAL);
  466|      0|            mData = 0;
  467|      0|        }
  468|  7.95k|    }

_ZN4Ogre21DefaultHardwareBufferC2Em:
   34|   154k|    : HardwareBuffer(HBU_CPU_ONLY, false) // always software, never shadowed
   35|   154k|    {
   36|   154k|        mSizeInBytes = sizeInBytes;
   37|       |        // Allocate aligned memory for better SIMD processing friendly.
   38|   154k|        mData = (uchar*)AlignedMemory::allocate(mSizeInBytes);
   39|   154k|    }
_ZN4Ogre21DefaultHardwareBufferD2Ev:
   42|   154k|    {
   43|   154k|        AlignedMemory::deallocate(mData);
   44|   154k|    }
_ZN4Ogre21DefaultHardwareBuffer8lockImplEmmNS_14HardwareBuffer11LockOptionsE:
   47|   158k|    {
   48|       |        // Only for use internally, no 'locking' as such
   49|   158k|        return mData + offset;
   50|   158k|    }
_ZN4Ogre21DefaultHardwareBuffer10unlockImplEv:
   53|   158k|    {
   54|       |        // Nothing to do
   55|   158k|    }
_ZN4Ogre32DefaultHardwareBufferManagerBaseC2Ev:
   72|      1|    {
   73|      1|    }
_ZN4Ogre32DefaultHardwareBufferManagerBase18createVertexBufferEmmhb:
   84|  11.5k|    {
   85|  11.5k|        return std::make_shared<HardwareVertexBuffer>(this, vertexSize, numVerts,
   86|  11.5k|                                                      new DefaultHardwareBuffer(vertexSize * numVerts));
   87|  11.5k|    }
_ZN4Ogre32DefaultHardwareBufferManagerBase17createIndexBufferENS_19HardwareIndexBuffer9IndexTypeEmhb:
   92|   143k|    {
   93|   143k|        return std::make_shared<HardwareIndexBuffer>(
   94|   143k|            this, itype, numIndexes,
   95|   143k|            new DefaultHardwareBuffer(HardwareIndexBuffer::indexSize(itype) * numIndexes));
   96|   143k|    }

_ZN4Ogre23DistanceLodStrategyBaseC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   37|      2|        : LodStrategy(name)
   38|      2|        , mReferenceViewEnabled(false)
   39|      2|        , mReferenceViewValue(-1)
   40|      2|    { }
_ZNK4Ogre23DistanceLodStrategyBase12getBaseValueEv:
   76|  14.6k|    {
   77|  14.6k|        return Real(0);
   78|  14.6k|    }
_ZNK4Ogre23DistanceLodStrategyBase18transformUserValueEf:
   87|  9.56k|    {
   88|       |        // Square user-supplied distance
   89|  9.56k|        return Math::Sqr(userValue);
   90|  9.56k|    }
_ZN4Ogre25DistanceLodSphereStrategyC2Ev:
  161|      1|        : DistanceLodStrategyBase("distance_sphere")
  162|      1|    { }
_ZN4Ogre22DistanceLodBoxStrategyC2Ev:
  192|      1|        : DistanceLodStrategyBase("distance_box")
  193|      1|    { }

_ZN4Ogre8EdgeDataC2Ev:
   44|    359|    EdgeData::EdgeData() : isClosed(false){}

_ZN4Ogre9ExceptionC2EiRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_PKcSB_l:
   43|  25.0k|        line( lin ),
   44|  25.0k|        typeName(typ),
   45|  25.0k|        description( desc ),
   46|  25.0k|        source( src ),
   47|  25.0k|        file( fil )
   48|  25.0k|    {
   49|  25.0k|        StringStream ss;
   50|       |
   51|  25.0k|        ss << typeName << ": "
   52|  25.0k|           << description
   53|  25.0k|           << " in " << source;
   54|       |
   55|  25.0k|        if( line > 0 )
  ------------------
  |  Branch (55:13): [True: 25.0k, False: 0]
  ------------------
   56|  25.0k|        {
   57|  25.0k|            ss << " at " << file << " (line " << line << ")";
   58|  25.0k|        }
   59|       |
   60|  25.0k|        fullDesc = ss.str();
   61|  25.0k|    }

_ZN4Ogre21HardwareBufferManager15getSingletonPtrEv:
   36|   306k|    {
   37|   306k|        return msSingleton;
   38|   306k|    }
_ZN4Ogre21HardwareBufferManagerC2Ev:
   45|      1|    {
   46|      1|    }
_ZN4Ogre25HardwareBufferManagerBaseC2Ev:
   58|      2|        : mUnderUsedFrameCount(0)
   59|      2|    {
   60|      2|    }
_ZN4Ogre25HardwareBufferManagerBase23createVertexDeclarationEv:
   73|   147k|    {
   74|   147k|        VertexDeclaration* decl = createVertexDeclarationImpl();
   75|   147k|        OGRE_LOCK_MUTEX(mVertexDeclarationsMutex);
   76|   147k|        mVertexDeclarations.insert(decl);
   77|   147k|        return decl;
   78|   147k|    }
_ZN4Ogre25HardwareBufferManagerBase24destroyVertexDeclarationEPNS_17VertexDeclarationE:
   81|   147k|    {
   82|   147k|        OGRE_LOCK_MUTEX(mVertexDeclarationsMutex);
   83|   147k|        OgreAssertDbg(mVertexDeclarations.find(decl) != mVertexDeclarations.end(), "unknown decl");
   84|   147k|        mVertexDeclarations.erase(decl);
   85|   147k|        destroyVertexDeclarationImpl(decl);
   86|   147k|    }
_ZN4Ogre25HardwareBufferManagerBase25createVertexBufferBindingEv:
   89|   147k|    {
   90|   147k|        VertexBufferBinding* ret = createVertexBufferBindingImpl();
   91|   147k|        OGRE_LOCK_MUTEX(mVertexBufferBindingsMutex);
   92|   147k|        mVertexBufferBindings.insert(ret);
   93|   147k|        return ret;
   94|   147k|    }
_ZN4Ogre25HardwareBufferManagerBase26destroyVertexBufferBindingEPNS_19VertexBufferBindingE:
   97|   147k|    {
   98|   147k|        OGRE_LOCK_MUTEX(mVertexBufferBindingsMutex);
   99|   147k|        OgreAssertDbg(mVertexBufferBindings.find(binding) != mVertexBufferBindings.end(),
  100|   147k|                      "unknown binding");
  101|   147k|        mVertexBufferBindings.erase(binding);
  102|   147k|        destroyVertexBufferBindingImpl(binding);
  103|   147k|    }
_ZN4Ogre25HardwareBufferManagerBase27createVertexDeclarationImplEv:
  106|   147k|    {
  107|       |        return OGRE_NEW VertexDeclaration();
  108|   147k|    }
_ZN4Ogre25HardwareBufferManagerBase28destroyVertexDeclarationImplEPNS_17VertexDeclarationE:
  111|   147k|    {
  112|       |        OGRE_DELETE decl;
  113|   147k|    }
_ZN4Ogre25HardwareBufferManagerBase29createVertexBufferBindingImplEv:
  116|   147k|    {
  117|       |        return OGRE_NEW VertexBufferBinding();
  118|   147k|    }
_ZN4Ogre25HardwareBufferManagerBase30destroyVertexBufferBindingImplEPNS_19VertexBufferBindingE:
  121|   147k|    {
  122|       |        OGRE_DELETE binding;
  123|   147k|    }
_ZN4Ogre25HardwareBufferManagerBase28_notifyVertexBufferDestroyedEPNS_20HardwareVertexBufferE:
  361|  11.5k|    {
  362|  11.5k|        OGRE_LOCK_MUTEX(mVertexBuffersMutex);
  363|  11.5k|        VertexBufferList::iterator i = mVertexBuffers.find(buf);
  364|  11.5k|        if (i != mVertexBuffers.end())
  ------------------
  |  Branch (364:13): [True: 0, False: 11.5k]
  ------------------
  365|      0|        {
  366|       |            // release vertex buffer copies
  367|      0|            mVertexBuffers.erase(i);
  368|      0|            _forceReleaseBufferCopies(buf);
  369|      0|        }
  370|  11.5k|    }

_ZN4Ogre19HardwareIndexBufferC2EPNS_25HardwareBufferManagerBaseENS0_9IndexTypeEmhb:
   40|   143k|        : HardwareBuffer(usage, useShadowBuffer)
   41|   143k|        , mIndexType(idxType)
   42|   143k|        , mMgr(mgr)
   43|   143k|        , mNumIndexes(numIndexes)
   44|   143k|    {
   45|       |        // Calculate the size of the indexes
   46|   143k|        mIndexSize = indexSize(idxType);
   47|   143k|        mSizeInBytes = mIndexSize * mNumIndexes;
   48|       |
   49|   143k|        if (idxType == IT_32BIT && Root::getSingletonPtr() && Root::getSingleton().getRenderSystem())
  ------------------
  |  Branch (49:13): [True: 3.94k, False: 139k]
  |  Branch (49:36): [True: 0, False: 3.94k]
  |  Branch (49:63): [True: 0, False: 0]
  ------------------
   50|      0|        {
   51|      0|            if (!Root::getSingleton().getRenderSystem()->getCapabilities()->hasCapability(RSC_32BIT_INDEX))
  ------------------
  |  Branch (51:17): [True: 0, False: 0]
  ------------------
   52|      0|            {
   53|      0|                OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "32 bit index buffers are not supported");
   54|      0|            }
   55|      0|        }
   56|       |
   57|       |        // Create a shadow buffer if required
   58|   143k|        if (useShadowBuffer)
  ------------------
  |  Branch (58:13): [True: 0, False: 143k]
  ------------------
   59|      0|        {
   60|      0|            mShadowBuffer = std::make_unique<DefaultHardwareBuffer>(mSizeInBytes);
   61|      0|        }
   62|   143k|    }
_ZN4Ogre19HardwareIndexBufferC2EPNS_25HardwareBufferManagerBaseENS0_9IndexTypeEmPNS_14HardwareBufferE:
   66|   143k|        : HardwareIndexBuffer(mgr, idxType, numIndexes, delegate->getUsage(), false)
   67|   143k|    {
   68|   143k|        mDelegate.reset(delegate);
   69|   143k|    }
_ZN4Ogre19HardwareIndexBufferD2Ev:
   73|   143k|    {
   74|   143k|    }

_ZN4Ogre20HardwareVertexBufferC2EPNS_25HardwareBufferManagerBaseEmmhb:
   39|  11.5k|        : HardwareBuffer(usage, useShadowBuffer),
   40|  11.5k|          mIsInstanceData(false),
   41|  11.5k|          mMgr(mgr),
   42|  11.5k|          mNumVertices(numVertices),
   43|  11.5k|          mVertexSize(vertexSize),
   44|  11.5k|          mInstanceDataStepRate(1)
   45|  11.5k|    {
   46|       |        // Calculate the size of the vertices
   47|  11.5k|        mSizeInBytes = mVertexSize * numVertices;
   48|       |
   49|       |        // Create a shadow buffer if required
   50|  11.5k|        if (useShadowBuffer)
  ------------------
  |  Branch (50:13): [True: 0, False: 11.5k]
  ------------------
   51|      0|        {
   52|      0|            mShadowBuffer = std::make_unique<DefaultHardwareBuffer>(mSizeInBytes);
   53|      0|        }
   54|       |
   55|  11.5k|    }
_ZN4Ogre20HardwareVertexBufferC2EPNS_25HardwareBufferManagerBaseEmmPNS_14HardwareBufferE:
   58|  11.5k|        : HardwareVertexBuffer(mgr, vertexSize, numVertices, delegate->getUsage(), false)
   59|  11.5k|    {
   60|  11.5k|        mDelegate.reset(delegate);
   61|  11.5k|    }
_ZN4Ogre20HardwareVertexBufferD2Ev:
   64|  11.5k|    {
   65|  11.5k|        if (mMgr)
  ------------------
  |  Branch (65:13): [True: 11.5k, False: 0]
  ------------------
   66|  11.5k|        {
   67|  11.5k|            mMgr->_notifyVertexBufferDestroyed(this);
   68|  11.5k|        }
   69|  11.5k|    }
_ZN4Ogre13VertexElementC2EtmNS_17VertexElementTypeENS_21VertexElementSemanticEt:
  104|  37.9k|        : mOffset(offset), mSource(source), mIndex(index), mType(theType), mSemantic(semantic)
  105|  37.9k|    {
  106|  37.9k|    }
_ZNK4Ogre13VertexElement7getSizeEv:
  109|  44.9k|    {
  110|  44.9k|        return getTypeSize(mType);
  111|  44.9k|    }
_ZN4Ogre13VertexElement11getTypeSizeENS_17VertexElementTypeE:
  114|  48.4k|    {
  115|  48.4k|        switch(etype)
  ------------------
  |  Branch (115:16): [True: 47.7k, False: 693]
  ------------------
  116|  48.4k|        {
  117|    857|        case VET_FLOAT1:
  ------------------
  |  Branch (117:9): [True: 857, False: 47.5k]
  ------------------
  118|    857|            return sizeof(float);
  119|  4.20k|        case VET_FLOAT2:
  ------------------
  |  Branch (119:9): [True: 4.20k, False: 44.2k]
  ------------------
  120|  4.20k|            return sizeof(float)*2;
  121|  1.70k|        case VET_FLOAT3:
  ------------------
  |  Branch (121:9): [True: 1.70k, False: 46.7k]
  ------------------
  122|  1.70k|            return sizeof(float)*3;
  123|  2.07k|        case VET_FLOAT4:
  ------------------
  |  Branch (123:9): [True: 2.07k, False: 46.3k]
  ------------------
  124|  2.07k|            return sizeof(float)*4;
  125|     48|        case VET_DOUBLE1:
  ------------------
  |  Branch (125:9): [True: 48, False: 48.3k]
  ------------------
  126|     48|            return sizeof(double);
  127|     40|        case VET_DOUBLE2:
  ------------------
  |  Branch (127:9): [True: 40, False: 48.3k]
  ------------------
  128|     40|            return sizeof(double)*2;
  129|    424|        case VET_DOUBLE3:
  ------------------
  |  Branch (129:9): [True: 424, False: 48.0k]
  ------------------
  130|    424|            return sizeof(double)*3;
  131|     34|        case VET_DOUBLE4:
  ------------------
  |  Branch (131:9): [True: 34, False: 48.3k]
  ------------------
  132|     34|            return sizeof(double)*4;
  133|    142|        case VET_SHORT1:
  ------------------
  |  Branch (133:9): [True: 142, False: 48.2k]
  ------------------
  134|    206|        case VET_USHORT1:
  ------------------
  |  Branch (134:9): [True: 64, False: 48.3k]
  ------------------
  135|    236|        case VET_HALF1:
  ------------------
  |  Branch (135:9): [True: 30, False: 48.3k]
  ------------------
  136|    236|            return sizeof( short );
  137|    925|        case VET_SHORT2:
  ------------------
  |  Branch (137:9): [True: 925, False: 47.4k]
  ------------------
  138|  1.51k|        case VET_SHORT2_NORM:
  ------------------
  |  Branch (138:9): [True: 593, False: 47.8k]
  ------------------
  139|  2.17k|        case VET_USHORT2:
  ------------------
  |  Branch (139:9): [True: 658, False: 47.7k]
  ------------------
  140|  2.22k|        case VET_USHORT2_NORM:
  ------------------
  |  Branch (140:9): [True: 45, False: 48.3k]
  ------------------
  141|  2.99k|        case VET_HALF2:
  ------------------
  |  Branch (141:9): [True: 776, False: 47.6k]
  ------------------
  142|  2.99k|            return sizeof( short ) * 2;
  143|      1|        case VET_SHORT3:
  ------------------
  |  Branch (143:9): [True: 1, False: 48.4k]
  ------------------
  144|     33|        case VET_USHORT3:
  ------------------
  |  Branch (144:9): [True: 32, False: 48.3k]
  ------------------
  145|    198|        case VET_HALF3:
  ------------------
  |  Branch (145:9): [True: 165, False: 48.2k]
  ------------------
  146|    198|            return sizeof( short ) * 3;
  147|     57|        case VET_SHORT4:
  ------------------
  |  Branch (147:9): [True: 57, False: 48.3k]
  ------------------
  148|    121|        case VET_SHORT4_NORM:
  ------------------
  |  Branch (148:9): [True: 64, False: 48.3k]
  ------------------
  149|    164|        case VET_USHORT4:
  ------------------
  |  Branch (149:9): [True: 43, False: 48.3k]
  ------------------
  150|  3.36k|        case VET_USHORT4_NORM:
  ------------------
  |  Branch (150:9): [True: 3.20k, False: 45.2k]
  ------------------
  151|  5.73k|        case VET_HALF4:
  ------------------
  |  Branch (151:9): [True: 2.36k, False: 46.0k]
  ------------------
  152|  5.73k|            return sizeof( short ) * 4;
  153|    274|        case VET_INT1:
  ------------------
  |  Branch (153:9): [True: 274, False: 48.1k]
  ------------------
  154|    593|        case VET_UINT1:
  ------------------
  |  Branch (154:9): [True: 319, False: 48.1k]
  ------------------
  155|    593|            return sizeof( int );
  156|     48|        case VET_INT2:
  ------------------
  |  Branch (156:9): [True: 48, False: 48.3k]
  ------------------
  157|    204|        case VET_UINT2:
  ------------------
  |  Branch (157:9): [True: 156, False: 48.2k]
  ------------------
  158|    204|            return sizeof( int ) * 2;
  159|    599|        case VET_INT3:
  ------------------
  |  Branch (159:9): [True: 599, False: 47.8k]
  ------------------
  160|    687|        case VET_UINT3:
  ------------------
  |  Branch (160:9): [True: 88, False: 48.3k]
  ------------------
  161|    687|            return sizeof( int ) * 3;
  162|     26|        case VET_INT4:
  ------------------
  |  Branch (162:9): [True: 26, False: 48.3k]
  ------------------
  163|     94|        case VET_UINT4:
  ------------------
  |  Branch (163:9): [True: 68, False: 48.3k]
  ------------------
  164|     94|            return sizeof( int ) * 4;
  165|  6.04k|        case VET_BYTE4:
  ------------------
  |  Branch (165:9): [True: 6.04k, False: 42.3k]
  ------------------
  166|  6.76k|        case VET_BYTE4_NORM:
  ------------------
  |  Branch (166:9): [True: 724, False: 47.7k]
  ------------------
  167|  7.51k|        case VET_UBYTE4:
  ------------------
  |  Branch (167:9): [True: 747, False: 47.6k]
  ------------------
  168|  7.59k|        case VET_UBYTE4_NORM:
  ------------------
  |  Branch (168:9): [True: 82, False: 48.3k]
  ------------------
  169|  12.8k|        case _DETAIL_SWAP_RB:
  ------------------
  |  Branch (169:9): [True: 5.27k, False: 43.1k]
  ------------------
  170|  12.8k|            return sizeof(char)*4;
  171|  14.7k|        case VET_INT_10_10_10_2_NORM:
  ------------------
  |  Branch (171:9): [True: 14.7k, False: 33.6k]
  ------------------
  172|  14.7k|            return 4;
  173|  48.4k|        }
  174|    693|        return 0;
  175|  48.4k|    }
_ZN4Ogre13VertexElement12getTypeCountENS_17VertexElementTypeE:
  178|  29.7k|    {
  179|  29.7k|        switch (etype)
  ------------------
  |  Branch (179:17): [True: 29.7k, False: 0]
  ------------------
  180|  29.7k|        {
  181|    738|        case VET_FLOAT1:
  ------------------
  |  Branch (181:9): [True: 738, False: 29.0k]
  ------------------
  182|    950|        case VET_SHORT1:
  ------------------
  |  Branch (182:9): [True: 212, False: 29.5k]
  ------------------
  183|  1.19k|        case VET_USHORT1:
  ------------------
  |  Branch (183:9): [True: 247, False: 29.5k]
  ------------------
  184|  1.68k|        case VET_UINT1:
  ------------------
  |  Branch (184:9): [True: 485, False: 29.3k]
  ------------------
  185|  1.97k|        case VET_INT1:
  ------------------
  |  Branch (185:9): [True: 293, False: 29.5k]
  ------------------
  186|  2.37k|        case VET_DOUBLE1:
  ------------------
  |  Branch (186:9): [True: 404, False: 29.3k]
  ------------------
  187|  2.71k|        case VET_HALF1:
  ------------------
  |  Branch (187:9): [True: 338, False: 29.4k]
  ------------------
  188|  2.71k|            return 1;
  189|  1.56k|        case VET_FLOAT2:
  ------------------
  |  Branch (189:9): [True: 1.56k, False: 28.2k]
  ------------------
  190|  1.87k|        case VET_SHORT2:
  ------------------
  |  Branch (190:9): [True: 309, False: 29.4k]
  ------------------
  191|  2.24k|        case VET_SHORT2_NORM:
  ------------------
  |  Branch (191:9): [True: 377, False: 29.4k]
  ------------------
  192|  2.60k|        case VET_USHORT2:
  ------------------
  |  Branch (192:9): [True: 361, False: 29.4k]
  ------------------
  193|  2.70k|        case VET_USHORT2_NORM:
  ------------------
  |  Branch (193:9): [True: 93, False: 29.7k]
  ------------------
  194|  3.13k|        case VET_UINT2:
  ------------------
  |  Branch (194:9): [True: 431, False: 29.3k]
  ------------------
  195|  3.38k|        case VET_INT2:
  ------------------
  |  Branch (195:9): [True: 252, False: 29.5k]
  ------------------
  196|  3.49k|        case VET_DOUBLE2:
  ------------------
  |  Branch (196:9): [True: 113, False: 29.6k]
  ------------------
  197|  3.71k|        case VET_HALF2:
  ------------------
  |  Branch (197:9): [True: 220, False: 29.5k]
  ------------------
  198|  3.71k|            return 2;
  199|    177|        case VET_FLOAT3:
  ------------------
  |  Branch (199:9): [True: 177, False: 29.6k]
  ------------------
  200|    177|        case VET_SHORT3:
  ------------------
  |  Branch (200:9): [True: 0, False: 29.7k]
  ------------------
  201|    204|        case VET_USHORT3:
  ------------------
  |  Branch (201:9): [True: 27, False: 29.7k]
  ------------------
  202|    728|        case VET_UINT3:
  ------------------
  |  Branch (202:9): [True: 524, False: 29.2k]
  ------------------
  203|  1.07k|        case VET_INT3:
  ------------------
  |  Branch (203:9): [True: 347, False: 29.4k]
  ------------------
  204|  1.49k|        case VET_DOUBLE3:
  ------------------
  |  Branch (204:9): [True: 422, False: 29.3k]
  ------------------
  205|  1.66k|        case VET_HALF3:
  ------------------
  |  Branch (205:9): [True: 165, False: 29.6k]
  ------------------
  206|  1.66k|            return 3;
  207|    227|        case VET_FLOAT4:
  ------------------
  |  Branch (207:9): [True: 227, False: 29.5k]
  ------------------
  208|    524|        case VET_SHORT4:
  ------------------
  |  Branch (208:9): [True: 297, False: 29.4k]
  ------------------
  209|    647|        case VET_SHORT4_NORM:
  ------------------
  |  Branch (209:9): [True: 123, False: 29.6k]
  ------------------
  210|    798|        case VET_USHORT4:
  ------------------
  |  Branch (210:9): [True: 151, False: 29.6k]
  ------------------
  211|  1.86k|        case VET_USHORT4_NORM:
  ------------------
  |  Branch (211:9): [True: 1.06k, False: 28.7k]
  ------------------
  212|  1.97k|        case VET_UINT4:
  ------------------
  |  Branch (212:9): [True: 111, False: 29.6k]
  ------------------
  213|  1.99k|        case VET_INT4:
  ------------------
  |  Branch (213:9): [True: 16, False: 29.7k]
  ------------------
  214|  2.11k|        case VET_DOUBLE4:
  ------------------
  |  Branch (214:9): [True: 121, False: 29.6k]
  ------------------
  215|  2.86k|        case VET_BYTE4:
  ------------------
  |  Branch (215:9): [True: 756, False: 29.0k]
  ------------------
  216|  3.09k|        case VET_UBYTE4:
  ------------------
  |  Branch (216:9): [True: 222, False: 29.5k]
  ------------------
  217|  4.20k|        case VET_BYTE4_NORM:
  ------------------
  |  Branch (217:9): [True: 1.11k, False: 28.6k]
  ------------------
  218|  4.38k|        case VET_UBYTE4_NORM:
  ------------------
  |  Branch (218:9): [True: 185, False: 29.6k]
  ------------------
  219|  11.8k|        case _DETAIL_SWAP_RB:
  ------------------
  |  Branch (219:9): [True: 7.49k, False: 22.3k]
  ------------------
  220|  21.0k|        case VET_INT_10_10_10_2_NORM:
  ------------------
  |  Branch (220:9): [True: 9.13k, False: 20.6k]
  ------------------
  221|  21.6k|        case VET_HALF4:
  ------------------
  |  Branch (221:9): [True: 681, False: 29.1k]
  ------------------
  222|  21.6k|            return 4;
  223|  29.7k|        }
  224|  29.7k|        OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Invalid type", 
  225|  29.7k|            "VertexElement::getTypeCount");
  226|  29.7k|    }
_ZN4Ogre13VertexElement11getBaseTypeENS_17VertexElementTypeE:
  296|  32.2k|    {
  297|  32.2k|        switch (multiType)
  ------------------
  |  Branch (297:17): [True: 31.9k, False: 344]
  ------------------
  298|  32.2k|        {
  299|    739|            case VET_FLOAT1:
  ------------------
  |  Branch (299:13): [True: 739, False: 31.5k]
  ------------------
  300|  2.30k|            case VET_FLOAT2:
  ------------------
  |  Branch (300:13): [True: 1.56k, False: 30.6k]
  ------------------
  301|  2.72k|            case VET_FLOAT3:
  ------------------
  |  Branch (301:13): [True: 426, False: 31.8k]
  ------------------
  302|  3.05k|            case VET_FLOAT4:
  ------------------
  |  Branch (302:13): [True: 324, False: 31.9k]
  ------------------
  303|  3.05k|                return VET_FLOAT1;
  304|    338|            case VET_HALF1:
  ------------------
  |  Branch (304:13): [True: 338, False: 31.9k]
  ------------------
  305|    559|            case VET_HALF2:
  ------------------
  |  Branch (305:13): [True: 221, False: 32.0k]
  ------------------
  306|    724|            case VET_HALF3:
  ------------------
  |  Branch (306:13): [True: 165, False: 32.0k]
  ------------------
  307|  1.40k|            case VET_HALF4:
  ------------------
  |  Branch (307:13): [True: 682, False: 31.5k]
  ------------------
  308|  1.40k|                return VET_HALF1;
  309|    405|            case VET_DOUBLE1:
  ------------------
  |  Branch (309:13): [True: 405, False: 31.8k]
  ------------------
  310|    520|            case VET_DOUBLE2:
  ------------------
  |  Branch (310:13): [True: 115, False: 32.1k]
  ------------------
  311|    942|            case VET_DOUBLE3:
  ------------------
  |  Branch (311:13): [True: 422, False: 31.8k]
  ------------------
  312|  1.06k|            case VET_DOUBLE4:
  ------------------
  |  Branch (312:13): [True: 123, False: 32.1k]
  ------------------
  313|  1.06k|                return VET_DOUBLE1;
  314|    295|            case VET_INT1:
  ------------------
  |  Branch (314:13): [True: 295, False: 31.9k]
  ------------------
  315|    548|            case VET_INT2:
  ------------------
  |  Branch (315:13): [True: 253, False: 32.0k]
  ------------------
  316|    898|            case VET_INT3:
  ------------------
  |  Branch (316:13): [True: 350, False: 31.9k]
  ------------------
  317|    914|            case VET_INT4:
  ------------------
  |  Branch (317:13): [True: 16, False: 32.2k]
  ------------------
  318|    914|                return VET_INT1;
  319|    485|            case VET_UINT1:
  ------------------
  |  Branch (319:13): [True: 485, False: 31.7k]
  ------------------
  320|    918|            case VET_UINT2:
  ------------------
  |  Branch (320:13): [True: 433, False: 31.8k]
  ------------------
  321|  1.44k|            case VET_UINT3:
  ------------------
  |  Branch (321:13): [True: 529, False: 31.7k]
  ------------------
  322|  1.56k|            case VET_UINT4:
  ------------------
  |  Branch (322:13): [True: 116, False: 32.1k]
  ------------------
  323|  1.56k|                return VET_UINT1;
  324|    213|            case VET_SHORT1:
  ------------------
  |  Branch (324:13): [True: 213, False: 32.0k]
  ------------------
  325|    523|            case VET_SHORT2:
  ------------------
  |  Branch (325:13): [True: 310, False: 31.9k]
  ------------------
  326|    524|            case VET_SHORT3:
  ------------------
  |  Branch (326:13): [True: 1, False: 32.2k]
  ------------------
  327|    822|            case VET_SHORT4:
  ------------------
  |  Branch (327:13): [True: 298, False: 31.9k]
  ------------------
  328|    822|                return VET_SHORT1;
  329|    247|            case VET_USHORT1:
  ------------------
  |  Branch (329:13): [True: 247, False: 32.0k]
  ------------------
  330|    609|            case VET_USHORT2:
  ------------------
  |  Branch (330:13): [True: 362, False: 31.9k]
  ------------------
  331|    637|            case VET_USHORT3:
  ------------------
  |  Branch (331:13): [True: 28, False: 32.2k]
  ------------------
  332|    790|            case VET_USHORT4:
  ------------------
  |  Branch (332:13): [True: 153, False: 32.1k]
  ------------------
  333|    790|                return VET_USHORT1;
  334|    377|            case VET_SHORT2_NORM:
  ------------------
  |  Branch (334:13): [True: 377, False: 31.8k]
  ------------------
  335|    502|            case VET_SHORT4_NORM:
  ------------------
  |  Branch (335:13): [True: 125, False: 32.1k]
  ------------------
  336|    502|                return VET_SHORT2_NORM;
  337|     96|            case VET_USHORT2_NORM:
  ------------------
  |  Branch (337:13): [True: 96, False: 32.1k]
  ------------------
  338|  1.16k|            case VET_USHORT4_NORM:
  ------------------
  |  Branch (338:13): [True: 1.06k, False: 31.1k]
  ------------------
  339|  1.16k|                return VET_USHORT2_NORM;
  340|    758|            case VET_BYTE4:
  ------------------
  |  Branch (340:13): [True: 758, False: 31.5k]
  ------------------
  341|    758|                return VET_BYTE4;
  342|  1.11k|            case VET_BYTE4_NORM:
  ------------------
  |  Branch (342:13): [True: 1.11k, False: 31.1k]
  ------------------
  343|  1.11k|                return VET_BYTE4_NORM;
  344|    223|            case VET_UBYTE4:
  ------------------
  |  Branch (344:13): [True: 223, False: 32.0k]
  ------------------
  345|    223|                return VET_UBYTE4;
  346|    195|            case VET_UBYTE4_NORM:
  ------------------
  |  Branch (346:13): [True: 195, False: 32.0k]
  ------------------
  347|  7.68k|            case _DETAIL_SWAP_RB:
  ------------------
  |  Branch (347:13): [True: 7.49k, False: 24.7k]
  ------------------
  348|  7.68k|                return VET_UBYTE4_NORM;
  349|  10.8k|            case VET_INT_10_10_10_2_NORM:
  ------------------
  |  Branch (349:13): [True: 10.8k, False: 21.4k]
  ------------------
  350|  10.8k|                return VET_INT_10_10_10_2_NORM;
  351|  32.2k|        };
  352|       |        // To keep compiler happy
  353|    344|        return VET_FLOAT1;
  354|  32.2k|    }
_ZN4Ogre17VertexDeclarationC2Ev:
  357|   147k|    {
  358|   147k|    }
_ZN4Ogre17VertexDeclarationD2Ev:
  361|   147k|    {
  362|   147k|    }
_ZNK4Ogre17VertexDeclaration11getElementsEv:
  365|  3.23k|    {
  366|  3.23k|        return mElementList;
  367|  3.23k|    }
_ZN4Ogre17VertexDeclaration10addElementEtmNS_17VertexElementTypeENS_21VertexElementSemanticEt:
  372|  33.3k|    {
  373|  33.3k|        mElementList.push_back(VertexElement(source, offset, theType, semantic, index));
  374|  33.3k|        notifyChanged();
  375|  33.3k|        return mElementList.back();
  376|  33.3k|    }
_ZN4Ogre17VertexDeclaration13modifyElementEttmNS_17VertexElementTypeENS_21VertexElementSemanticEt:
  444|  4.56k|    {
  445|       |        assert(elem_index < mElementList.size() && "Index out of bounds");
  446|  4.56k|        VertexElementList::iterator i = mElementList.begin();
  447|  4.56k|        std::advance(i, elem_index);
  448|  4.56k|        (*i) = VertexElement(source, offset, theType, semantic, index);
  449|  4.56k|        notifyChanged();
  450|  4.56k|    }
_ZNK4Ogre17VertexDeclaration21findElementBySemanticENS_21VertexElementSemanticEt:
  454|   104k|    {
  455|   104k|        for (auto& e : mElementList)
  ------------------
  |  Branch (455:22): [True: 12.2k, False: 102k]
  ------------------
  456|  12.2k|        {
  457|  12.2k|            if (e.getSemantic() == sem && e.getIndex() == index)
  ------------------
  |  Branch (457:17): [True: 2.84k, False: 9.36k]
  |  Branch (457:43): [True: 2.12k, False: 724]
  ------------------
  458|  2.12k|            {
  459|  2.12k|                return &e;
  460|  2.12k|            }
  461|  12.2k|        }
  462|       |
  463|   102k|        return NULL;
  464|   104k|    }
_ZNK4Ogre17VertexDeclaration20findElementsBySourceEt:
  468|  15.1k|    {
  469|  15.1k|        VertexElementList retList;
  470|  15.1k|        for (auto& e : mElementList)
  ------------------
  |  Branch (470:22): [True: 57.6k, False: 15.1k]
  ------------------
  471|  57.6k|        {
  472|  57.6k|            if (e.getSource() == source)
  ------------------
  |  Branch (472:17): [True: 24.5k, False: 33.0k]
  ------------------
  473|  24.5k|            {
  474|  24.5k|                retList.push_back(e);
  475|  24.5k|            }
  476|  57.6k|        }
  477|  15.1k|        return retList;
  478|  15.1k|    }
_ZNK4Ogre17VertexDeclaration13getVertexSizeEt:
  482|  9.31k|    {
  483|  9.31k|        size_t sz = 0;
  484|  9.31k|        for (auto& e : mElementList)
  ------------------
  |  Branch (484:22): [True: 32.1k, False: 9.31k]
  ------------------
  485|  32.1k|        {
  486|  32.1k|            if (e.getSource() == source)
  ------------------
  |  Branch (486:17): [True: 14.6k, False: 17.4k]
  ------------------
  487|  14.6k|            {
  488|  14.6k|                sz += e.getSize();
  489|       |
  490|  14.6k|            }
  491|  32.1k|        }
  492|  9.31k|        return sz;
  493|  9.31k|    }
_ZN4Ogre19VertexBufferBindingC2Ev:
  676|   147k|    VertexBufferBinding::VertexBufferBinding() : mHighIndex(0)
  677|   147k|    {
  678|   147k|    }
_ZN4Ogre19VertexBufferBindingD2Ev:
  681|   147k|    {
  682|   147k|        unsetAllBindings();
  683|   147k|    }
_ZN4Ogre19VertexBufferBinding10setBindingEtRKNS_9SharedPtrINS_20HardwareVertexBufferEEE:
  686|  9.29k|    {
  687|       |        // NB will replace any existing buffer ptr at this index, and will thus cause
  688|       |        // reference count to decrement on that buffer (possibly destroying it)
  689|  9.29k|        mBindingMap[index] = buffer;
  690|  9.29k|        mHighIndex = std::max(mHighIndex, (unsigned short)(index+1));
  691|  9.29k|    }
_ZN4Ogre19VertexBufferBinding16unsetAllBindingsEv:
  706|   147k|    {
  707|   147k|        mBindingMap.clear();
  708|   147k|        mHighIndex = 0;
  709|   147k|    }
_ZNK4Ogre19VertexBufferBinding11getBindingsEv:
  713|   143k|    {
  714|   143k|        return mBindingMap;
  715|   143k|    }
_ZNK4Ogre19VertexBufferBinding9getBufferEt:
  718|  1.77k|    {
  719|  1.77k|        VertexBufferBindingMap::const_iterator i = mBindingMap.find(index);
  720|  1.77k|        if (i == mBindingMap.end())
  ------------------
  |  Branch (720:13): [True: 32, False: 1.74k]
  ------------------
  721|     32|        {
  722|     32|            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "No buffer is bound to that index.",
  723|     32|                "VertexBufferBinding::getBuffer");
  724|     32|        }
  725|  1.74k|        return i->second;
  726|  1.77k|    }
_ZNK4Ogre19VertexBufferBinding13isBufferBoundEt:
  729|  43.4k|    {
  730|  43.4k|        return mBindingMap.find(index) != mBindingMap.end();
  731|  43.4k|    }

_ZN4Ogre8KeyFrameC2EPKNS_14AnimationTrackEf:
   37|  5.04k|        : mTime(time), mParentTrack(parent)
   38|  5.04k|    {
   39|  5.04k|    }
_ZN4Ogre17TransformKeyFrameC2EPKNS_14AnimationTrackEf:
   59|    962|        :KeyFrame(parent, time), mTranslate(Vector3::ZERO), 
   60|    962|        mScale(Vector3::UNIT_SCALE), mRotate(Quaternion::IDENTITY) 
   61|    962|    {
   62|    962|    }
_ZN4Ogre17TransformKeyFrame12setTranslateERKNS_6VectorILi3EfEE:
   65|    962|    {
   66|    962|        mTranslate = trans;
   67|    962|        if (mParentTrack)
  ------------------
  |  Branch (67:13): [True: 962, False: 0]
  ------------------
   68|    962|            mParentTrack->_keyFrameDataChanged();
   69|    962|    }
_ZN4Ogre17TransformKeyFrame8setScaleERKNS_6VectorILi3EfEE:
   77|    266|    {
   78|    266|        mScale = scale;
   79|    266|        if (mParentTrack)
  ------------------
  |  Branch (79:13): [True: 266, False: 0]
  ------------------
   80|    266|            mParentTrack->_keyFrameDataChanged();
   81|    266|    }
_ZN4Ogre17TransformKeyFrame11setRotationERKNS_10QuaternionE:
   89|    962|    {
   90|    962|        mRotate = rot;
   91|    962|        if (mParentTrack)
  ------------------
  |  Branch (91:13): [True: 962, False: 0]
  ------------------
   92|    962|            mParentTrack->_keyFrameDataChanged();
   93|    962|    }
_ZN4Ogre19VertexMorphKeyFrameC2EPKNS_14AnimationTrackEf:
  110|  1.69k|        : KeyFrame(parent, time)
  111|  1.69k|    {
  112|  1.69k|    }
_ZN4Ogre19VertexMorphKeyFrame15setVertexBufferERKNS_9SharedPtrINS_20HardwareVertexBufferEEE:
  115|  1.69k|    {
  116|  1.69k|        mBuffer = buf;
  117|  1.69k|    }
_ZN4Ogre18VertexPoseKeyFrameC2EPKNS_14AnimationTrackEf:
  133|  2.38k|        :KeyFrame(parent, time)
  134|  2.38k|    {
  135|  2.38k|    }
_ZN4Ogre18VertexPoseKeyFrame16addPoseReferenceEtf:
  138|  2.60k|    {
  139|  2.60k|        mPoseRefs.push_back(PoseRef(poseIndex, influence));
  140|  2.60k|    }

_ZN4Ogre11LodStrategyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   35|      4|        : mName(name)
   36|      4|    { }
_ZNK4Ogre11LodStrategy18transformUserValueEf:
   42|    313|    {
   43|       |        // No transformation by default
   44|    313|        return userValue;
   45|    313|    }

_ZN4Ogre18LodStrategyManager12getSingletonEv:
   43|  15.8k|    {
   44|       |        assert( msSingleton );  return ( *msSingleton );
   45|  15.8k|    }
_ZN4Ogre18LodStrategyManagerC2Ev:
   48|      1|    {
   49|       |        // Add distance strategies for bounding box and bounding sphere
   50|      1|        LodStrategy *strategy = OGRE_NEW DistanceLodBoxStrategy();
   51|      1|        addStrategy(strategy);
   52|      1|        strategy = OGRE_NEW DistanceLodSphereStrategy();
   53|      1|        addStrategy(strategy);
   54|       |
   55|       |        // Set the default strategy to distance_sphere
   56|      1|        setDefaultStrategy(strategy);
   57|       |
   58|       |        // Add pixel-count strategies (internally based on bounding sphere)
   59|      1|        strategy = OGRE_NEW AbsolutePixelCountLodStrategy();
   60|      1|        addStrategy(strategy);
   61|       |        strategy = OGRE_NEW ScreenRatioPixelCountLodStrategy();
   62|      1|        addStrategy(strategy);
   63|      1|    }
_ZN4Ogre18LodStrategyManager11addStrategyEPNS_11LodStrategyE:
   72|      4|    {
   73|       |        // Check for invalid strategy name
   74|      4|        if (strategy->getName() == "default")
  ------------------
  |  Branch (74:13): [True: 0, False: 4]
  ------------------
   75|      4|            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Lod strategy name must not be \"default\".", "LodStrategyManager::addStrategy");
   76|       |
   77|       |        // Insert the strategy into the map with its name as the key
   78|      4|        mStrategies.insert(std::make_pair(strategy->getName(), strategy));
   79|      4|    }
_ZN4Ogre18LodStrategyManager11getStrategyERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  110|  8.16k|    {
  111|       |        // If name is "default", return the default strategy instead of performing a lookup
  112|  8.16k|        if (name == "default") {
  ------------------
  |  Branch (112:13): [True: 449, False: 7.71k]
  ------------------
  113|    449|            return getDefaultStrategy();
  114|  7.71k|        } else if (name == "Distance") {
  ------------------
  |  Branch (114:20): [True: 576, False: 7.14k]
  ------------------
  115|    576|            return getStrategy("distance_box"); // Backward compatibility for loading old meshes.
  116|  7.14k|        } else if (name == "PixelCount") {
  ------------------
  |  Branch (116:20): [True: 246, False: 6.89k]
  ------------------
  117|    246|            return getStrategy("pixel_count"); // Backward compatibility for loading old meshes.
  118|    246|        }
  119|       |        // Find strategy with specified name
  120|  6.89k|        StrategyMap::iterator it = mStrategies.find(name);
  121|       |
  122|       |        // If not found, return null
  123|  6.89k|        if (it == mStrategies.end())
  ------------------
  |  Branch (123:13): [True: 6.00k, False: 887]
  ------------------
  124|  6.00k|            return 0;
  125|       |
  126|       |        // Otherwise, return the strategy
  127|    887|        return it->second;
  128|  6.89k|    }
_ZN4Ogre18LodStrategyManager18setDefaultStrategyEPNS_11LodStrategyE:
  131|      1|    {
  132|      1|        mDefaultStrategy = strategy;
  133|      1|    }
_ZN4Ogre18LodStrategyManager18getDefaultStrategyEv:
  142|  8.96k|    {
  143|  8.96k|        return mDefaultStrategy;
  144|  8.96k|    }

_ZN4Ogre3LogC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbb:
   52|      1|        mLogLevel(LML_NORMAL), mDebugOut(debuggerOutput),
   53|      1|        mSuppressFile(suppressFile), mTimeStamp(true), mLogName(name), mTermHasColours(false)
   54|      1|    {
   55|      1|        if (!mSuppressFile)
  ------------------
  |  Branch (55:13): [True: 0, False: 1]
  ------------------
   56|      0|        {
   57|      0|            mLog.open(name.c_str());
   58|       |
   59|       |#if (OGRE_PLATFORM == OGRE_PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_WINRT) && _WIN32_WINNT >= _WIN32_WINNT_VISTA
   60|       |            // Register log file to be collected by Windows Error Reporting
   61|       |            const int utf16Length = ::MultiByteToWideChar(CP_ACP, 0, name.c_str(), (int)name.size(), NULL, 0);
   62|       |            if(utf16Length > 0)
   63|       |            {
   64|       |                std::wstring wname;
   65|       |                wname.resize(utf16Length);
   66|       |                if (0 != ::MultiByteToWideChar(CP_ACP, 0, name.c_str(), (int)name.size(), &wname[0], (int)wname.size()))
   67|       |                    WerRegisterFile(wname.c_str(), WerRegFileTypeOther, WER_FILE_ANONYMOUS_DATA);
   68|       |            }
   69|       |#endif
   70|      0|        }
   71|       |
   72|      1|#if OGRE_PLATFORM != OGRE_PLATFORM_WINRT
   73|      1|        char* val = getenv("OGRE_MIN_LOGLEVEL");
   74|      1|        int min_lml;
   75|      1|        if(val && StringConverter::parse(val, min_lml))
  ------------------
  |  Branch (75:12): [True: 0, False: 1]
  |  Branch (75:12): [True: 0, False: 1]
  |  Branch (75:19): [True: 0, False: 0]
  ------------------
   76|      0|            setMinLogLevel(LogMessageLevel(min_lml));
   77|       |
   78|      1|        if(mDebugOut)
  ------------------
  |  Branch (78:12): [True: 0, False: 1]
  ------------------
   79|      0|        {
   80|      0|            val = getenv("TERM");
   81|      0|            mTermHasColours = val && String(val).find("xterm") != String::npos;
  ------------------
  |  Branch (81:31): [True: 0, False: 0]
  |  Branch (81:38): [True: 0, False: 0]
  ------------------
   82|      0|        }
   83|      1|#endif
   84|      1|    }
_ZN4Ogre3Log10logMessageERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_15LogMessageLevelEb:
   97|   197k|    {
   98|   197k|        OGRE_LOCK_AUTO_MUTEX;
   99|   197k|        if (lml >= mLogLevel)
  ------------------
  |  Branch (99:13): [True: 16.8k, False: 180k]
  ------------------
  100|  16.8k|        {
  101|  16.8k|            bool skipThisMessage = false;
  102|  16.8k|            for(auto & l : mListeners)
  ------------------
  |  Branch (102:26): [True: 0, False: 16.8k]
  ------------------
  103|      0|                l->messageLogged( message, lml, maskDebug, mLogName, skipThisMessage);
  104|       |            
  105|  16.8k|            if (!skipThisMessage)
  ------------------
  |  Branch (105:17): [True: 16.8k, False: 0]
  ------------------
  106|  16.8k|            {
  107|  16.8k|                if (mDebugOut && !maskDebug)
  ------------------
  |  Branch (107:21): [True: 0, False: 16.8k]
  |  Branch (107:34): [True: 0, False: 0]
  ------------------
  108|      0|                {
  109|       |#    if (OGRE_PLATFORM == OGRE_PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_WINRT) && OGRE_DEBUG_MODE
  110|       |                    OutputDebugStringA("Ogre: ");
  111|       |                    OutputDebugStringA(message.c_str());
  112|       |                    OutputDebugStringA("\n");
  113|       |#    endif
  114|       |
  115|      0|                    std::ostream& os = int(lml) >= int(LML_WARNING) ? std::cerr : std::cout;
  ------------------
  |  Branch (115:40): [True: 0, False: 0]
  ------------------
  116|       |
  117|      0|                    if(mTermHasColours) {
  ------------------
  |  Branch (117:24): [True: 0, False: 0]
  ------------------
  118|      0|                        if(lml == LML_WARNING)
  ------------------
  |  Branch (118:28): [True: 0, False: 0]
  ------------------
  119|      0|                            os << YELLOW;
  120|      0|                        if(lml == LML_CRITICAL)
  ------------------
  |  Branch (120:28): [True: 0, False: 0]
  ------------------
  121|      0|                            os << RED;
  122|      0|                    }
  123|       |
  124|      0|                    os << message;
  125|       |
  126|      0|                    if(mTermHasColours) {
  ------------------
  |  Branch (126:24): [True: 0, False: 0]
  ------------------
  127|      0|                        os << RESET;
  128|      0|                    }
  129|       |
  130|      0|                    os << std::endl;
  131|      0|                }
  132|       |
  133|       |                // Write time into log
  134|  16.8k|                if (!mSuppressFile)
  ------------------
  |  Branch (134:21): [True: 0, False: 16.8k]
  ------------------
  135|      0|                {
  136|      0|                    if (mTimeStamp)
  ------------------
  |  Branch (136:25): [True: 0, False: 0]
  ------------------
  137|      0|                    {
  138|      0|                        auto t = std::time(nullptr);
  139|      0|                        auto pTime = std::localtime(&t);
  140|      0|                        mLog << std::put_time(pTime, "%H:%M:%S: ");
  141|      0|                    }
  142|      0|                    mLog << message << std::endl;
  143|       |
  144|       |                    // Flush stcmdream to ensure it is written (incase of a crash, we need log to be up to date)
  145|      0|                    mLog.flush();
  146|      0|                }
  147|  16.8k|            }
  148|  16.8k|        }
  149|   197k|    }
_ZN4Ogre3Log14setMinLogLevelENS_15LogMessageLevelE:
  173|      1|    {
  174|      1|        OGRE_LOCK_AUTO_MUTEX;
  175|      1|        mLogLevel = lml;
  176|      1|    }
_ZN4Ogre3Log6streamENS_15LogMessageLevelEb:
  196|  44.6k|    {
  197|  44.6k|        return Stream(this, lml, maskDebug);
  198|       |
  199|  44.6k|    }

_ZN4Ogre10LogManager12getSingletonEv:
   39|   197k|    {  
   40|       |        assert( msSingleton );  return ( *msSingleton );  
   41|   197k|    }
_ZN4Ogre10LogManagerC2Ev:
   44|      1|    {
   45|       |        mDefaultLog = NULL;
   46|      1|    }
_ZN4Ogre10LogManager9createLogERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbbb:
   61|      1|    {
   62|      1|        OGRE_LOCK_AUTO_MUTEX;
   63|       |
   64|      1|        Log* newLog = OGRE_NEW Log(name, debuggerOutput, suppressFileOutput);
   65|       |
   66|      1|        if( !mDefaultLog || defaultLog )
  ------------------
  |  Branch (66:13): [True: 1, False: 0]
  |  Branch (66:29): [True: 0, False: 0]
  ------------------
   67|      1|        {
   68|      1|            mDefaultLog = newLog;
   69|      1|        }
   70|       |
   71|      1|        mLogs.emplace(name, newLog);
   72|       |
   73|      1|        return newLog;
   74|      1|    }
_ZN4Ogre10LogManager10logMessageERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_15LogMessageLevelEb:
  125|   152k|    {
  126|   152k|        OGRE_LOCK_AUTO_MUTEX;
  127|   152k|        if (mDefaultLog)
  ------------------
  |  Branch (127:13): [True: 152k, False: 0]
  ------------------
  128|   152k|        {
  129|   152k|            mDefaultLog->logMessage(message, lml, maskDebug);
  130|   152k|        }
  131|   152k|    }
_ZN4Ogre10LogManager8logErrorERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEb:
  134|  16.8k|    {
  135|  16.8k|        stream(LML_CRITICAL, maskDebug) << "Error: " << message;
  136|  16.8k|    }
_ZN4Ogre10LogManager10logWarningERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEb:
  139|  1.16k|    {
  140|  1.16k|        stream(LML_WARNING, maskDebug) << "Warning: " << message;
  141|  1.16k|    }
_ZN4Ogre10LogManager14setMinLogLevelENS_15LogMessageLevelE:
  155|      1|    {
  156|      1|        OGRE_LOCK_AUTO_MUTEX;
  157|      1|        if (mDefaultLog)
  ------------------
  |  Branch (157:13): [True: 1, False: 0]
  ------------------
  158|      1|        {
  159|      1|            mDefaultLog->setMinLogLevel(lml);
  160|      1|        }
  161|      1|    }
_ZN4Ogre10LogManager6streamENS_15LogMessageLevelEb:
  164|  44.6k|    {
  165|  44.6k|            OGRE_LOCK_AUTO_MUTEX;
  166|  44.6k|        OgreAssert(mDefaultLog, "Default log not found");
  ------------------
  |  Branch (166:9): [True: 0, False: 44.6k]
  ------------------
  167|  44.6k|        return mDefaultLog->stream(lml, maskDebug);
  168|  44.6k|    }

_ZN4Ogre8MaterialC2EPNS_15ResourceManagerERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEmSB_bPNS_20ManualResourceLoaderE:
   39|      3|        :Resource(creator, name, handle, group, false, NULL),
   40|      3|         mReceiveShadows(true),
   41|      3|         mTransparencyCastsShadows(false),
   42|      3|         mCompilationRequired(true)
   43|      3|    {
   44|       |        // Override isManual, not applicable for Material (we always want to call loadImpl)
   45|      3|        if(isManual)
  ------------------
  |  Branch (45:12): [True: 0, False: 3]
  ------------------
   46|      0|        {
   47|      0|            LogManager::getSingleton().logWarning("Material " + name +
   48|      0|                " was requested with isManual=true, but this is not applicable " 
   49|      0|                "for materials; the flag has been reset to false");
   50|      0|        }
   51|       |
   52|       |        // Initialise to default strategy
   53|      3|        mLodStrategy = LodStrategyManager::getSingleton().getDefaultStrategy();
   54|       |
   55|      3|        mLodValues.push_back(0.0f);
   56|       |
   57|      3|        applyDefaults();
   58|       |
   59|       |        /* For consistency with StringInterface, but we don't add any parameters here
   60|       |        That's because the Resource implementation of StringInterface is to
   61|       |        list all the options that need to be set before loading, of which 
   62|       |        we have none as such. Full details can be set through scripts.
   63|       |        */ 
   64|      3|        createParamDictionary("Material");
   65|      3|    }
_ZN4Ogre8MaterialaSERKS0_:
   76|      2|    {
   77|      2|        if (this == &rhs)
  ------------------
  |  Branch (77:13): [True: 0, False: 2]
  ------------------
   78|      0|            return *this;
   79|       |
   80|      2|        Resource::operator=(rhs);
   81|      2|        mReceiveShadows = rhs.mReceiveShadows;
   82|      2|        mTransparencyCastsShadows = rhs.mTransparencyCastsShadows;
   83|       |
   84|       |        // Copy Techniques
   85|      2|        this->removeAllTechniques();
   86|      2|        for(auto *t : rhs.mTechniques)
  ------------------
  |  Branch (86:21): [True: 2, False: 2]
  ------------------
   87|      2|        {
   88|      2|            Technique* tech = this->createTechnique();
   89|      2|            *tech = *t;
   90|      2|            if (t->isSupported())
  ------------------
  |  Branch (90:17): [True: 0, False: 2]
  ------------------
   91|      0|            {
   92|      0|                insertSupportedTechnique(tech);
   93|      0|            }
   94|      2|        }
   95|       |
   96|       |        // Also copy LOD information
   97|      2|        mUserLodValues = rhs.mUserLodValues;
   98|      2|        mLodValues = rhs.mLodValues;
   99|      2|        mLodStrategy = rhs.mLodStrategy;
  100|      2|        mCompilationRequired = rhs.mCompilationRequired;
  101|       |
  102|       |        // creating techniques moves us into unloaded state
  103|       |        // insertSupportedTechnique is equivalent to prepare
  104|      2|        if(rhs.isLoaded())
  ------------------
  |  Branch (104:12): [True: 0, False: 2]
  ------------------
  105|      0|            load();
  106|       |
  107|      2|        return *this;
  108|      2|    }
_ZN4Ogre8Material13applyDefaultsEv:
  217|      3|    {
  218|      3|        MaterialPtr defaults = MaterialManager::getSingleton().getDefaultSettings();
  219|       |
  220|      3|        if (defaults)
  ------------------
  |  Branch (220:13): [True: 2, False: 1]
  ------------------
  221|      2|        {
  222|       |            // save name & handle
  223|      2|            String savedName = mName;
  224|      2|            String savedGroup = mGroup;
  225|      2|            ResourceHandle savedHandle = mHandle;
  226|      2|            *this = *defaults;
  227|       |            // restore name & handle
  228|      2|            mName = savedName;
  229|      2|            mHandle = savedHandle;
  230|      2|            mGroup = savedGroup;
  231|      2|        }
  232|      3|        _notifyNeedsRecompile();
  233|       |
  234|      3|    }
_ZN4Ogre8Material15createTechniqueEv:
  237|      3|    {
  238|       |        Technique *t = OGRE_NEW Technique(this);
  239|      3|        mTechniques.push_back(t);
  240|      3|        _notifyNeedsRecompile();
  241|      3|        return t;
  242|      3|    }
_ZN4Ogre8Material19removeAllTechniquesEv:
  367|      2|    {
  368|      2|        for (auto *t : mTechniques)
  ------------------
  |  Branch (368:22): [True: 0, False: 2]
  ------------------
  369|      0|        {
  370|       |            OGRE_DELETE t;
  371|      0|        }
  372|      2|        mTechniques.clear();
  373|      2|        clearBestTechniqueList();
  374|      2|    }
_ZN4Ogre8Material22clearBestTechniqueListEv:
  437|      2|    {
  438|      2|        mSupportedTechniques.clear();
  439|      2|        mBestTechniquesBySchemeList.clear();
  440|      2|        _notifyNeedsRecompile();
  441|      2|    }
_ZN4Ogre8Material18setLightingEnabledEb:
  493|      1|    void Material::setLightingEnabled(bool enabled) { ALL_TECHNIQUES(setLightingEnabled(enabled)); }
  ------------------
  |  |  443|      1|    #define ALL_TECHNIQUES(fncall) for(auto t : mTechniques) t->fncall
  |  |  ------------------
  |  |  |  Branch (443:47): [True: 1, False: 1]
  |  |  ------------------
  ------------------
_ZN4Ogre8Material21_notifyNeedsRecompileEv:
  534|      8|    {
  535|      8|        mCompilationRequired = true;
  536|       |        // Also need to unload to ensure we loaded any new items
  537|      8|        if (isLoaded()) // needed to stop this being called in 'loading' state
  ------------------
  |  Branch (537:13): [True: 0, False: 8]
  ------------------
  538|      0|            unload();
  539|      8|    }
_ZN4Ogre8Material14setLodStrategyEPNS_11LodStrategyE:
  579|      1|    {
  580|      1|        mLodStrategy = lodStrategy;
  581|       |
  582|      1|        assert(mLodValues.size());
  583|      1|        mLodValues[0] = mLodStrategy->getBaseValue();
  584|       |
  585|       |        // Re-transform all user LOD values (starting at index 1, no need to transform base value)
  586|      1|        for (size_t i = 1; i < mUserLodValues.size(); ++i)
  ------------------
  |  Branch (586:28): [True: 0, False: 1]
  ------------------
  587|      0|            mLodValues[i] = mLodStrategy->transformUserValue(mUserLodValues[i]);
  588|      1|    }

_ZN4Ogre15MaterialManager15getSingletonPtrEv:
   40|      2|    {
   41|      2|        return msSingleton;
   42|      2|    }
_ZN4Ogre15MaterialManager12getSingletonEv:
   44|   152k|    {
   45|       |        assert( msSingleton );  return ( *msSingleton );
   46|   152k|    }
_ZN4Ogre15MaterialManagerC2Ev:
   50|      1|    {
   51|       |        // Loading order
   52|      1|        mLoadOrder = 100.0f;
   53|       |        // Scripting is supported by this manager
   54|       |
   55|       |        // Resource type
   56|      1|        mResourceType = "Material";
   57|       |
   58|       |        // Register with resource group manager
   59|      1|        ResourceGroupManager::getSingleton()._registerResourceManager(mResourceType, this);
   60|       |
   61|       |        // Default scheme
   62|      1|        mActiveSchemeIndex = 0;
   63|      1|        mActiveSchemeName = MSN_DEFAULT;
   64|      1|        mSchemes[mActiveSchemeName] = 0;
   65|       |
   66|      1|    }
_ZN4Ogre15MaterialManager10createImplERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEmS9_bPNS_20ManualResourceLoaderEPKNS1_3mapIS7_S7_NS1_4lessIS7_EENS5_INS1_4pairIS8_S7_EEEEEE:
   83|      3|    {
   84|       |        return OGRE_NEW Material(this, name, handle, group, isManual, loader);
   85|      3|    }
_ZN4Ogre15MaterialManager6createERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_bPNS_20ManualResourceLoaderEPKNS1_3mapIS7_S7_NS1_4lessIS7_EENS5_INS1_4pairIS8_S7_EEEEEE:
   90|      3|    {
   91|      3|        return static_pointer_cast<Material>(createResource(name,group,isManual,loader,createParams));
   92|      3|    }
_ZNK4Ogre15MaterialManager9getByNameERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
   95|   152k|    {
   96|   152k|        return static_pointer_cast<Material>(getResourceByName(name, groupName));
   97|   152k|    }
_ZN4Ogre15MaterialManager10initialiseEv:
  111|      1|    {
  112|       |        // Set up default material - don't use name constructor as we want to avoid applying defaults
  113|      1|        mDefaultSettings = create("DefaultSettings", ResourceGroupManager::INTERNAL_RESOURCE_GROUP_NAME);
  114|       |        // Add a single technique and pass, non-programmable
  115|      1|        mDefaultSettings->createTechnique()->createPass();
  116|       |
  117|       |        // Set the default LOD strategy
  118|      1|        mDefaultSettings->setLodStrategy(LodStrategyManager::getSingleton().getDefaultStrategy());
  119|       |
  120|       |        // Set up a lit base white material
  121|      1|        create("BaseWhite", ResourceGroupManager::INTERNAL_RESOURCE_GROUP_NAME);
  122|       |        // Set up an unlit base white material
  123|      1|        MaterialPtr baseWhiteNoLighting = create("BaseWhiteNoLighting",
  124|      1|        ResourceGroupManager::INTERNAL_RESOURCE_GROUP_NAME);
  125|      1|        baseWhiteNoLighting->setLightingEnabled(false);
  126|       |
  127|      1|    }
_ZN4Ogre15MaterialManager38_notifyBeforeIlluminationPassesClearedEPNS_9TechniqueE:
  273|      2|	{
  274|       |		// First, check the scheme specific listeners
  275|      2|		ListenerMap::iterator it = mListenerMap.find(mActiveSchemeName);
  276|      2|		if(it != mListenerMap.end())
  ------------------
  |  Branch (276:6): [True: 0, False: 2]
  ------------------
  277|      0|		{
  278|      0|			ListenerList& listenerList = it->second;
  279|      0|			for(auto & i : listenerList)
  ------------------
  |  Branch (279:17): [True: 0, False: 0]
  ------------------
  280|      0|			{
  281|      0|				bool handled = i->beforeIlluminationPassesCleared(tech);
  282|      0|				if(handled)
  ------------------
  |  Branch (282:8): [True: 0, False: 0]
  ------------------
  283|      0|					return;
  284|      0|			}
  285|      0|		}
  286|       |
  287|       |		//If no success, check generic listeners
  288|      2|		it = mListenerMap.find(BLANKSTRING);
  289|      2|		if(it != mListenerMap.end())
  ------------------
  |  Branch (289:6): [True: 0, False: 2]
  ------------------
  290|      0|		{
  291|      0|			ListenerList& listenerList = it->second;
  292|      0|			for(auto & i : listenerList)
  ------------------
  |  Branch (292:17): [True: 0, False: 0]
  ------------------
  293|      0|			{
  294|      0|				bool handled = i->beforeIlluminationPassesCleared(tech);
  295|      0|				if(handled)
  ------------------
  |  Branch (295:8): [True: 0, False: 0]
  ------------------
  296|      0|					return;
  297|      0|			}
  298|      0|		}
  299|      2|	}

_ZN4Ogre4Math22boundingRadiusFromAABBERKNS_14AxisAlignedBoxE:
  762|  3.76k|    {
  763|  3.76k|        const Vector3& max = aabb.getMaximum();
  764|  3.76k|        const Vector3& min = aabb.getMinimum();
  765|       |
  766|  3.76k|        Vector3 magnitude = max;
  767|  3.76k|        magnitude.makeCeil(-max);
  768|  3.76k|        magnitude.makeCeil(min);
  769|  3.76k|        magnitude.makeCeil(-min);
  770|       |
  771|  3.76k|        return magnitude.length();
  772|  3.76k|    }

_ZN4Ogre4MeshC2EPNS_15ResourceManagerERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEmSB_bPNS_20ManualResourceLoaderE:
   45|  5.12k|        : Resource(creator, name, handle, group, isManual, loader),
   46|  5.12k|        mBoundRadius(0.0f),
   47|  5.12k|        mBoneBoundingRadius(0.0f),
   48|  5.12k|        mBoneAssignmentsOutOfDate(false),
   49|  5.12k|        mHasManualLodLevel(false),
   50|  5.12k|        mLodStrategy(LodStrategyManager::getSingleton().getDefaultStrategy()),
   51|  5.12k|        mBufferManager(0),
   52|  5.12k|        mVertexBufferUsage(HBU_GPU_ONLY),
   53|  5.12k|        mIndexBufferUsage(HBU_GPU_ONLY),
   54|  5.12k|        mVertexBufferShadowBuffer(false),
   55|  5.12k|        mIndexBufferShadowBuffer(false),
   56|  5.12k|        mPreparedForShadowVolumes(false),
   57|  5.12k|        mEdgeListsBuilt(false),
   58|  5.12k|        mAutoBuildEdgeLists(false), // will be set to true by serializers of 1.20 and below
   59|  5.12k|        mSharedVertexDataAnimationType(VAT_NONE),
   60|  5.12k|        mSharedVertexDataAnimationIncludesNormals(false),
   61|  5.12k|        mAnimationTypesDirty(true),
   62|  5.12k|        mPosesIncludeNormals(false),
   63|  5.12k|        sharedVertexData(0)
   64|  5.12k|    {
   65|       |        // Init first (manual) lod
   66|  5.12k|        MeshLodUsage lod;
   67|  5.12k|        lod.userValue = 0; // User value not used for base LOD level
   68|  5.12k|        lod.value = getLodStrategy()->getBaseValue();
   69|  5.12k|        mMeshLodUsageList.push_back(lod);
   70|  5.12k|    }
_ZN4Ogre4MeshD2Ev:
   73|  5.12k|    {
   74|  5.12k|        if (!HardwareBufferManager::getSingletonPtr()) // LogManager might be also gone already
  ------------------
  |  Branch (74:13): [True: 0, False: 5.12k]
  ------------------
   75|      0|        {
   76|      0|            printf("ERROR: '%s' is being destroyed after HardwareBufferManager. This is a bug in user code.\n", mName.c_str());
   77|      0|            OgreAssertDbg(false,  "Mesh destroyed after HardwareBufferManager"); // assert in debug mode
   78|      0|            return; // try not to crash
   79|      0|        }
   80|       |        // have to call this here reather than in Resource destructor
   81|       |        // since calling virtual methods in base destructors causes crash
   82|  5.12k|        unload();
   83|  5.12k|    }
_ZN4Ogre4Mesh24getHardwareBufferManagerEv:
   86|   153k|    {
   87|   153k|        return mBufferManager ? mBufferManager : HardwareBufferManager::getSingletonPtr();
  ------------------
  |  Branch (87:16): [True: 0, False: 153k]
  ------------------
   88|   153k|    }
_ZN4Ogre4Mesh13createSubMeshEv:
   91|   152k|    {
   92|   152k|        SubMesh* sub = OGRE_NEW SubMesh();
   93|   152k|        sub->parent = this;
   94|       |
   95|   152k|        mSubMeshList.push_back(sub);
   96|       |
   97|   152k|        if (isLoaded())
  ------------------
  |  Branch (97:13): [True: 152k, False: 0]
  ------------------
   98|   152k|            _dirtyState();
   99|       |
  100|   152k|        return sub;
  101|   152k|    }
_ZN4Ogre4Mesh11nameSubMeshERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEt:
  155|  9.50k|    {
  156|  9.50k|        mSubMeshNameMap[name] = index ;
  157|  9.50k|    }
_ZN4Ogre4Mesh12postLoadImplEv:
  174|  5.12k|    {
  175|       |        // Prepare for shadow volumes?
  176|  5.12k|        if (MeshManager::getSingleton().getPrepareAllMeshesForShadowVolumes())
  ------------------
  |  Branch (176:13): [True: 0, False: 5.12k]
  ------------------
  177|      0|        {
  178|      0|            if (mEdgeListsBuilt || mAutoBuildEdgeLists)
  ------------------
  |  Branch (178:17): [True: 0, False: 0]
  |  Branch (178:36): [True: 0, False: 0]
  ------------------
  179|      0|            {
  180|      0|                prepareForShadowVolume();
  181|      0|            }
  182|       |
  183|      0|            if (!mEdgeListsBuilt && mAutoBuildEdgeLists)
  ------------------
  |  Branch (183:17): [True: 0, False: 0]
  |  Branch (183:37): [True: 0, False: 0]
  ------------------
  184|      0|            {
  185|      0|                buildEdgeList();
  186|      0|            }
  187|      0|        }
  188|  5.12k|#if !OGRE_NO_MESHLOD
  189|       |        // The loading process accesses LOD usages directly, so
  190|       |        // transformation of user values must occur after loading is complete.
  191|       |
  192|       |        // Transform user LOD values (starting at index 1, no need to transform base value)
  193|  5.12k|        for (auto& m : mMeshLodUsageList)
  ------------------
  |  Branch (193:22): [True: 5.12k, False: 5.12k]
  ------------------
  194|  5.12k|            m.value = mLodStrategy->transformUserValue(m.userValue);
  195|       |        // Rewrite first value
  196|  5.12k|        mMeshLodUsageList[0].value = mLodStrategy->getBaseValue();
  197|  5.12k|#endif
  198|  5.12k|    }
_ZN4Ogre4Mesh10unloadImplEv:
  241|  5.12k|    {
  242|       |        // Teardown submeshes
  243|  5.12k|        for (auto & i : mSubMeshList)
  ------------------
  |  Branch (243:23): [True: 152k, False: 5.12k]
  ------------------
  244|   152k|        {
  245|   152k|            OGRE_DELETE i;
  246|   152k|        }
  247|  5.12k|        if (sharedVertexData)
  ------------------
  |  Branch (247:13): [True: 1.12k, False: 4.00k]
  ------------------
  248|  1.12k|        {
  249|  1.12k|            resetVertexData();
  250|  1.12k|        }
  251|       |        // Clear SubMesh lists
  252|  5.12k|        mSubMeshList.clear();
  253|  5.12k|        mSubMeshNameMap.clear();
  254|       |
  255|  5.12k|        freeEdgeList();
  256|  5.12k|#if !OGRE_NO_MESHLOD
  257|       |        // Removes all LOD data
  258|  5.12k|        removeLodLevels();
  259|  5.12k|#endif
  260|  5.12k|        mPreparedForShadowVolumes = false;
  261|       |
  262|       |        // remove all poses & animations
  263|  5.12k|        removeAllAnimations();
  264|  5.12k|        removeAllPoses();
  265|       |
  266|       |        // Clear bone assignments
  267|  5.12k|        mBoneAssignments.clear();
  268|  5.12k|        mBoneAssignmentsOutOfDate = false;
  269|       |
  270|       |        // Removes reference to skeleton
  271|  5.12k|        mSkeleton.reset();
  272|  5.12k|    }
_ZN4Ogre4Mesh10_setBoundsERKNS_14AxisAlignedBoxEb:
  388|  3.76k|    {
  389|  3.76k|        mAABB = bounds;
  390|  3.76k|        mBoundRadius = Math::boundingRadiusFromAABB(mAABB);
  391|       |
  392|  3.76k|        if( mAABB.isFinite() )
  ------------------
  |  Branch (392:13): [True: 3.76k, False: 0]
  ------------------
  393|  3.76k|        {
  394|  3.76k|            Vector3 max = mAABB.getMaximum();
  395|  3.76k|            Vector3 min = mAABB.getMinimum();
  396|       |
  397|  3.76k|            if (pad)
  ------------------
  |  Branch (397:17): [True: 0, False: 3.76k]
  ------------------
  398|      0|            {
  399|       |                // Pad out the AABB a little, helps with most bounds tests
  400|      0|                Vector3 scaler = (max - min) * MeshManager::getSingleton().getBoundsPaddingFactor();
  401|      0|                mAABB.setExtents(min  - scaler, max + scaler);
  402|       |                // Pad out the sphere a little too
  403|      0|                mBoundRadius = mBoundRadius + (mBoundRadius * MeshManager::getSingleton().getBoundsPaddingFactor());
  404|      0|            }
  405|  3.76k|        }
  406|  3.76k|    }
_ZN4Ogre4Mesh24_setBoundingSphereRadiusEf:
  409|  3.76k|    {
  410|  3.76k|        mBoundRadius = radius;
  411|  3.76k|    }
_ZN4Ogre4Mesh15setSkeletonNameERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  480|  16.4k|    {
  481|  16.4k|        if (skelName != getSkeletonName())
  ------------------
  |  Branch (481:13): [True: 16.0k, False: 472]
  ------------------
  482|  16.0k|        {
  483|  16.0k|            if (skelName.empty())
  ------------------
  |  Branch (483:17): [True: 0, False: 16.0k]
  ------------------
  484|      0|            {
  485|       |                // No skeleton
  486|      0|                mSkeleton.reset();
  487|      0|            }
  488|  16.0k|            else
  489|  16.0k|            {
  490|       |                // Load skeleton
  491|  16.0k|                try {
  492|  16.0k|                    mSkeleton = static_pointer_cast<Skeleton>(SkeletonManager::getSingleton().load(skelName, mGroup));
  493|  16.0k|                }
  494|  16.0k|                catch (...)
  495|  16.0k|                {
  496|  16.0k|                    mSkeleton.reset();
  497|       |                    // Log this error
  498|  16.0k|                    String msg = "Unable to load skeleton '";
  499|  16.0k|                    msg += skelName + "' for Mesh '" + mName + "'. This Mesh will not be animated.";
  500|  16.0k|                    LogManager::getSingleton().logError(msg);
  501|       |
  502|  16.0k|                }
  503|       |
  504|       |
  505|  16.0k|            }
  506|  16.0k|            if (isLoaded())
  ------------------
  |  Branch (506:17): [True: 16.0k, False: 0]
  ------------------
  507|  16.0k|                _dirtyState();
  508|  16.0k|        }
  509|  16.4k|    }
_ZN4Ogre4Mesh17addBoneAssignmentERKNS_20VertexBoneAssignmentE:
  512|  2.76k|    {
  513|  2.76k|        mBoneAssignments.emplace(vertBoneAssign.vertexIndex, vertBoneAssign);
  514|  2.76k|        mBoneAssignmentsOutOfDate = true;
  515|  2.76k|    }
_ZNK4Ogre4Mesh15getSkeletonNameEv:
 1078|  16.4k|    {
 1079|  16.4k|        return mSkeleton ? mSkeleton->getName() : BLANKSTRING;
  ------------------
  |  Branch (1079:16): [True: 0, False: 16.4k]
  ------------------
 1080|  16.4k|    }
_ZN4Ogre4Mesh11_setLodInfoEt:
 1144|  3.74k|    {
 1145|  3.74k|        assert(!mEdgeListsBuilt && "Can't modify LOD after edge lists built");
 1146|       |
 1147|       |        // Basic prerequisites
 1148|  3.74k|        OgreAssert(numLevels > 0,  "Must be at least one level (full detail level must exist)");
  ------------------
  |  Branch (1148:9): [True: 0, False: 3.74k]
  ------------------
 1149|       |
 1150|  3.74k|        mMeshLodUsageList.resize(numLevels);
 1151|       |        // Resize submesh face data lists too
 1152|  3.74k|        for (auto & i : mSubMeshList)
  ------------------
  |  Branch (1152:23): [True: 12.4k, False: 3.74k]
  ------------------
 1153|  12.4k|        {
 1154|  12.4k|            i->mLodFaceList.resize(numLevels - 1);
 1155|  12.4k|        }
 1156|  3.74k|    }
_ZN4Ogre4Mesh15removeLodLevelsEv:
 1208|  5.12k|    {
 1209|  5.12k|#if !OGRE_NO_MESHLOD
 1210|       |        // Remove data from SubMeshes
 1211|  5.12k|        for (auto *isub : mSubMeshList)
  ------------------
  |  Branch (1211:25): [True: 0, False: 5.12k]
  ------------------
 1212|      0|        {
 1213|      0|            isub->removeLodLevels();
 1214|      0|        }
 1215|       |
 1216|  5.12k|        bool edgeListWasBuilt = isEdgeListBuilt();
 1217|  5.12k|        freeEdgeList();
 1218|       |
 1219|       |        // Reinitialise
 1220|  5.12k|        mMeshLodUsageList.resize(1);
 1221|  5.12k|        mMeshLodUsageList[0].edgeData = NULL;
 1222|       |
 1223|  5.12k|        if(edgeListWasBuilt)
  ------------------
  |  Branch (1223:12): [True: 0, False: 5.12k]
  ------------------
 1224|      0|            buildEdgeList();
 1225|  5.12k|#endif
 1226|  5.12k|    }
_ZN4Ogre4Mesh12freeEdgeListEv:
 1711|  10.2k|    {
 1712|  10.2k|        if (!mEdgeListsBuilt)
  ------------------
  |  Branch (1712:13): [True: 9.79k, False: 461]
  ------------------
 1713|  9.79k|            return;
 1714|    461|#if !OGRE_NO_MESHLOD
 1715|       |        // Loop over LODs
 1716|    461|        unsigned short index = 0;
 1717|    461|        for (auto& usage : mMeshLodUsageList)
  ------------------
  |  Branch (1717:26): [True: 43.1k, False: 461]
  ------------------
 1718|  43.1k|        {
 1719|  43.1k|            if (usage.manualName.empty() || index == 0)
  ------------------
  |  Branch (1719:17): [True: 43.1k, False: 83]
  |  Branch (1719:45): [True: 0, False: 83]
  ------------------
 1720|  43.1k|            {
 1721|       |                // Only delete if we own this data
 1722|       |                // Manual LODs > 0 own their own
 1723|  43.1k|                OGRE_DELETE usage.edgeData;
 1724|  43.1k|            }
 1725|  43.1k|            usage.edgeData = NULL;
 1726|  43.1k|            ++index;
 1727|  43.1k|        }
 1728|       |#else
 1729|       |        OGRE_DELETE mMeshLodUsageList[0].edgeData;
 1730|       |        mMeshLodUsageList[0].edgeData = NULL;
 1731|       |#endif
 1732|    461|        mEdgeListsBuilt = false;
 1733|    461|    }
_ZNK4Ogre4Mesh13calculateSizeEv:
 2010|  5.12k|    {
 2011|       |        // calculate GPU size
 2012|  5.12k|        size_t ret = 0;
 2013|  5.12k|        unsigned short i;
 2014|       |        // Shared vertices
 2015|  5.12k|        if (sharedVertexData)
  ------------------
  |  Branch (2015:13): [True: 0, False: 5.12k]
  ------------------
 2016|      0|        {
 2017|      0|            for (i = 0;
 2018|      0|                i < sharedVertexData->vertexBufferBinding->getBufferCount();
  ------------------
  |  Branch (2018:17): [True: 0, False: 0]
  ------------------
 2019|      0|                ++i)
 2020|      0|            {
 2021|      0|                ret += sharedVertexData->vertexBufferBinding
 2022|      0|                    ->getBuffer(i)->getSizeInBytes();
 2023|      0|            }
 2024|      0|        }
 2025|       |
 2026|  5.12k|        for (auto *s : mSubMeshList)
  ------------------
  |  Branch (2026:22): [True: 0, False: 5.12k]
  ------------------
 2027|      0|        {
 2028|       |            // Dedicated vertices
 2029|      0|            if (!s->useSharedVertices)
  ------------------
  |  Branch (2029:17): [True: 0, False: 0]
  ------------------
 2030|      0|            {
 2031|      0|                for (i = 0;
 2032|      0|                    i < s->vertexData->vertexBufferBinding->getBufferCount();
  ------------------
  |  Branch (2032:21): [True: 0, False: 0]
  ------------------
 2033|      0|                    ++i)
 2034|      0|                {
 2035|      0|                    ret += s->vertexData->vertexBufferBinding
 2036|      0|                        ->getBuffer(i)->getSizeInBytes();
 2037|      0|                }
 2038|      0|            }
 2039|      0|            if (s->indexData->indexBuffer)
  ------------------
  |  Branch (2039:17): [True: 0, False: 0]
  ------------------
 2040|      0|            {
 2041|       |                // Index data
 2042|      0|                ret += s->indexData->indexBuffer->getSizeInBytes();
 2043|      0|            }
 2044|       |
 2045|      0|        }
 2046|  5.12k|        return ret;
 2047|  5.12k|    }
_ZN4Ogre4Mesh15createAnimationERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEf:
 2143|  1.48k|    {
 2144|       |        // Check name not used
 2145|  1.48k|        if (mAnimationsList.find(name) != mAnimationsList.end())
  ------------------
  |  Branch (2145:13): [True: 2, False: 1.48k]
  ------------------
 2146|      2|        {
 2147|      2|            OGRE_EXCEPT(
 2148|      2|                Exception::ERR_DUPLICATE_ITEM,
 2149|      2|                "An animation with the name " + name + " already exists");
 2150|      2|        }
 2151|       |
 2152|  1.48k|        Animation* ret = OGRE_NEW Animation(name, length);
 2153|  1.48k|        ret->_notifyContainer(this);
 2154|       |
 2155|       |        // Add to list
 2156|  1.48k|        mAnimationsList[name] = ret;
 2157|       |
 2158|       |        // Mark animation types dirty
 2159|  1.48k|        mAnimationTypesDirty = true;
 2160|       |
 2161|  1.48k|        return ret;
 2162|       |
 2163|  1.48k|    }
_ZN4Ogre4Mesh19removeAllAnimationsEv:
 2231|  5.12k|    {
 2232|  5.12k|        for (auto& a : mAnimationsList)
  ------------------
  |  Branch (2232:22): [True: 1.48k, False: 5.12k]
  ------------------
 2233|  1.48k|        {
 2234|       |            OGRE_DELETE a.second;
 2235|  1.48k|        }
 2236|  5.12k|        mAnimationsList.clear();
 2237|  5.12k|        mAnimationTypesDirty = true;
 2238|  5.12k|    }
_ZN4Ogre4Mesh26getVertexDataByTrackHandleEt:
 2241|  1.27k|    {
 2242|  1.27k|        if (handle == 0)
  ------------------
  |  Branch (2242:13): [True: 583, False: 696]
  ------------------
 2243|    583|        {
 2244|    583|            return sharedVertexData;
 2245|    583|        }
 2246|    696|        else
 2247|    696|        {
 2248|    696|            return getSubMesh(handle-1)->vertexData;
 2249|    696|        }
 2250|  1.27k|    }
_ZN4Ogre4Mesh10createPoseEtRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 2253|  19.4k|    {
 2254|       |        Pose* retPose = OGRE_NEW Pose(target, name);
 2255|  19.4k|        mPoseList.push_back(retPose);
 2256|  19.4k|        return retPose;
 2257|  19.4k|    }
_ZN4Ogre4Mesh14removeAllPosesEv:
 2318|  5.12k|    {
 2319|  5.12k|        for (auto & i : mPoseList)
  ------------------
  |  Branch (2319:23): [True: 19.4k, False: 5.12k]
  ------------------
 2320|  19.4k|        {
 2321|       |            OGRE_DELETE i;
 2322|  19.4k|        }
 2323|  5.12k|        mPoseList.clear();
 2324|  5.12k|    }
_ZNK4Ogre4Mesh14getLodStrategyEv:
 2342|  5.12k|    {
 2343|  5.12k|        return mLodStrategy;
 2344|  5.12k|    }
_ZN4Ogre4Mesh14setLodStrategyEPNS_11LodStrategyE:
 2348|  4.71k|    {
 2349|  4.71k|        mLodStrategy = lodStrategy;
 2350|       |
 2351|  4.71k|        assert(mMeshLodUsageList.size());
 2352|       |
 2353|       |        // Re-transform user LOD values (starting at index 1, no need to transform base value)
 2354|  4.71k|        for (auto& m : mMeshLodUsageList)
  ------------------
  |  Branch (2354:22): [True: 4.75k, False: 4.71k]
  ------------------
 2355|  4.75k|            m.value = mLodStrategy->transformUserValue(m.userValue);
 2356|       |
 2357|       |        // Rewrite first value
 2358|  4.71k|        mMeshLodUsageList[0].value = mLodStrategy->getBaseValue();
 2359|  4.71k|    }
_ZN4Ogre4Mesh21_convertVertexElementENS_21VertexElementSemanticENS_17VertexElementTypeE:
 2363|  5.03k|    {
 2364|  5.03k|        if (sharedVertexData)
  ------------------
  |  Branch (2364:13): [True: 916, False: 4.12k]
  ------------------
 2365|    916|            sharedVertexData->convertVertexElement(semantic, dstType);
 2366|       |
 2367|  5.03k|        for (auto s : getSubMeshes())
  ------------------
  |  Branch (2367:21): [True: 121k, False: 5.03k]
  ------------------
 2368|   121k|            if (s->vertexData)
  ------------------
  |  Branch (2368:17): [True: 103k, False: 17.6k]
  ------------------
 2369|   103k|                s->vertexData->convertVertexElement(semantic, dstType);
 2370|  5.03k|    }

_ZN4Ogre11MeshManager12getSingletonEv:
   58|  15.3k|    {  
   59|       |        assert( msSingleton );  return ( *msSingleton );  
   60|  15.3k|    }
_ZN4Ogre11MeshManagerC2Ev:
   63|      1|    mBoundsPaddingFactor(0.01), mListener(0)
   64|      1|    {
   65|      1|        mBlendWeightsBaseElementType = VET_FLOAT1;
   66|      1|        mPrepAllMeshesForShadowVolumes = false;
   67|       |
   68|      1|        mLoadOrder = 350.0f;
   69|      1|        mResourceType = "Mesh";
   70|       |
   71|      1|        mMeshCodec = std::make_unique<MeshCodec>();
   72|      1|        Codec::registerCodec(mMeshCodec.get());
   73|       |
   74|      1|        ResourceGroupManager::getSingleton()._registerResourceManager(mResourceType, this);
   75|       |
   76|      1|        mPrefabLoader = std::make_unique<PrefabFactory>();
   77|      1|    }
_ZN4Ogre11MeshManager6createERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_bPNS_20ManualResourceLoaderEPKNS1_3mapIS7_S7_NS1_4lessIS7_EENS5_INS1_4pairIS8_S7_EEEEEE:
  147|  5.12k|    {
  148|  5.12k|        return static_pointer_cast<Mesh>(createResource(name,group,isManual,loader,createParams));
  149|  5.12k|    }
_ZN4Ogre11MeshManager35getPrepareAllMeshesForShadowVolumesEv:
  326|  5.12k|    {
  327|  5.12k|        return mPrepAllMeshesForShadowVolumes;
  328|  5.12k|    }
_ZN4Ogre11MeshManager10createImplERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEmS9_bPNS_20ManualResourceLoaderEPKNS1_3mapIS7_S7_NS1_4lessIS7_EENS5_INS1_4pairIS8_S7_EEEEEE:
  363|  5.12k|    {
  364|       |        // no use for createParams here
  365|       |        return OGRE_NEW Mesh(this, name, handle, group, isManual, loader);
  366|  5.12k|    }
_ZNK4Ogre9MeshCodec7getTypeEv:
   39|      1|        String getType() const override { return "mesh"; }

_ZN4Ogre14MeshSerializerC2Ev:
   47|  5.12k|        :mListener(0)
   48|  5.12k|    {
   49|       |        // Init implementations
   50|       |        // String identifiers have not always been 100% unified with OGRE version
   51|       |        
   52|       |        // Note MUST be added in reverse order so latest is first in the list
   53|       |
   54|       |        // This one is a little ugly, 1.10 is used for version 1.1 legacy meshes.
   55|       |        // So bump up to 1.100
   56|  5.12k|        mVersionData.push_back(OGRE_NEW MeshVersionData(
   57|  5.12k|            MESH_VERSION_1_10, "[MeshSerializer_v1.100]", 
   58|  5.12k|            OGRE_NEW MeshSerializerImpl()));
   59|       |
   60|  5.12k|        mVersionData.push_back(OGRE_NEW MeshVersionData(
   61|  5.12k|            MESH_VERSION_1_8, "[MeshSerializer_v1.8]", 
   62|  5.12k|            OGRE_NEW MeshSerializerImpl_v1_8()));
   63|       |
   64|  5.12k|        if(!mSupportLegacyFormats)
  ------------------
  |  Branch (64:12): [True: 5.12k, False: 0]
  ------------------
   65|  5.12k|            return;
   66|       |
   67|      0|        mVersionData.push_back(OGRE_NEW MeshVersionData(
   68|      0|            MESH_VERSION_1_7, "[MeshSerializer_v1.41]", 
   69|      0|            OGRE_NEW MeshSerializerImpl_v1_41()));
   70|       |
   71|      0|        mVersionData.push_back(OGRE_NEW MeshVersionData(
   72|      0|            MESH_VERSION_1_4, "[MeshSerializer_v1.40]", 
   73|      0|            OGRE_NEW MeshSerializerImpl_v1_4()));
   74|       |
   75|      0|        mVersionData.push_back(OGRE_NEW MeshVersionData(
   76|      0|            MESH_VERSION_1_0, "[MeshSerializer_v1.30]", 
   77|      0|            OGRE_NEW MeshSerializerImpl_v1_3()));
   78|      0|        mVersionData.push_back(OGRE_NEW MeshVersionData(
   79|      0|            MESH_VERSION_LEGACY, "[MeshSerializer_v1.20]", 
   80|      0|            OGRE_NEW MeshSerializerImpl_v1_2()));
   81|       |
   82|      0|        mVersionData.push_back(OGRE_NEW MeshVersionData(
   83|      0|            MESH_VERSION_LEGACY, "[MeshSerializer_v1.10]", 
   84|      0|            OGRE_NEW MeshSerializerImpl_v1_1()));
   85|       |        
   86|      0|    }
_ZN4Ogre14MeshSerializerD2Ev:
   89|  5.12k|    {
   90|       |        // delete map
   91|  5.12k|        for (auto & i : mVersionData)
  ------------------
  |  Branch (91:23): [True: 10.2k, False: 5.12k]
  ------------------
   92|  10.2k|        {
   93|  10.2k|            OGRE_DELETE i;
   94|  10.2k|        }
   95|  5.12k|        mVersionData.clear();
   96|       |
   97|  5.12k|    }
_ZN4Ogre14MeshSerializer10importMeshERKNS_9SharedPtrINS_10DataStreamEEEPNS_4MeshE:
  141|  5.12k|    {
  142|  5.12k|        determineEndianness(stream);
  143|       |
  144|       |        // Read header and determine the version
  145|  5.12k|        unsigned short headerID;
  146|       |        
  147|       |        // Read header ID
  148|  5.12k|        readShorts(stream, &headerID, 1);
  149|       |        
  150|  5.12k|        if (headerID != HEADER_CHUNK_ID)
  ------------------
  |  Branch (150:13): [True: 0, False: 5.12k]
  ------------------
  151|      0|        {
  152|      0|            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "File header not found",
  153|      0|                "MeshSerializer::importMesh");
  154|      0|        }
  155|       |        // Read version
  156|  5.12k|        String ver = readString(stream);
  157|       |        // Jump back to start
  158|  5.12k|        stream->seek(0);
  159|       |
  160|       |        // Find the implementation to use
  161|  5.12k|        MeshSerializerImpl* impl = 0;
  162|  5.12k|        for (auto & i : mVersionData)
  ------------------
  |  Branch (162:23): [True: 7.58k, False: 108]
  ------------------
  163|  7.58k|        {
  164|  7.58k|            if (i->versionString == ver)
  ------------------
  |  Branch (164:17): [True: 5.02k, False: 2.56k]
  ------------------
  165|  5.02k|            {
  166|  5.02k|                impl = i->impl.get();
  167|  5.02k|                break;
  168|  5.02k|            }
  169|  7.58k|        }           
  170|  5.12k|        if (!impl)
  ------------------
  |  Branch (170:13): [True: 82, False: 5.04k]
  ------------------
  171|  5.12k|            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "Cannot find serializer implementation for "
  172|  5.04k|                        "mesh version " + ver, "MeshSerializer::importMesh");
  173|       |        
  174|       |        // Call implementation
  175|  5.04k|        impl->importMesh(stream, pDest, mListener);
  176|       |        // Warn on old version of mesh
  177|  5.04k|        if (ver != mVersionData[0]->versionString)
  ------------------
  |  Branch (177:13): [True: 1.16k, False: 3.88k]
  ------------------
  178|  1.16k|        {
  179|  1.16k|            LogManager::getSingleton().logWarning(pDest->getName() + " uses an old format " + ver +
  180|  1.16k|                                                  "; upgrade with the OgreMeshUpgrader tool");
  181|  1.16k|        }
  182|       |
  183|  5.04k|        if(mListener)
  ------------------
  |  Branch (183:12): [True: 0, False: 5.04k]
  ------------------
  184|      0|            mListener->processMeshCompleted(pDest);
  185|       |
  186|  5.04k|        auto rs = Root::getSingletonPtr() ? Root::getSingleton().getRenderSystem() : NULL;
  ------------------
  |  Branch (186:19): [True: 0, False: 5.04k]
  ------------------
  187|  5.04k|        if (!rs || !rs->getCapabilities()->hasCapability(RSC_VERTEX_FORMAT_INT_10_10_10_2))
  ------------------
  |  Branch (187:13): [True: 5.04k, False: 0]
  |  Branch (187:20): [True: 0, False: 0]
  ------------------
  188|  2.53k|        {
  189|       |            // unpacks to floats, if packed
  190|  2.53k|            pDest->_convertVertexElement(VES_NORMAL, VET_FLOAT3);
  191|  2.53k|            pDest->_convertVertexElement(VES_TANGENT, VET_FLOAT4);
  192|  2.53k|        }
  193|  5.04k|    }
_ZN4Ogre15MeshVersionDataC2ENS_11MeshVersionERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEPNS_18MeshSerializerImplE:
   41|  10.2k|        : version(_ver), versionString(_string), impl(_impl) {}

_ZN4Ogre18MeshSerializerImplC2Ev:
   63|  10.2k|    {
   64|       |        // Version number
   65|  10.2k|        mVersion = "[MeshSerializer_v1.100]";
   66|  10.2k|        exportedLodCount = 0;
   67|  10.2k|    }
_ZN4Ogre18MeshSerializerImplD2Ev:
   70|  10.2k|    {
   71|  10.2k|    }
_ZN4Ogre18MeshSerializerImpl10importMeshERKNS_9SharedPtrINS_10DataStreamEEEPNS_4MeshEPNS_22MeshSerializerListenerE:
  110|  5.02k|    {
  111|       |        // Determine endianness (must be the first thing we do!)
  112|  5.02k|        determineEndianness(stream);
  113|       |
  114|       |#if OGRE_SERIALIZER_VALIDATE_CHUNKSIZE
  115|       |        enableValidation();
  116|       |#endif
  117|       |        // Check header
  118|  5.02k|        readFileHeader(stream);
  119|  5.02k|        pushInnerChunk(stream);
  120|  5.02k|        unsigned short streamID = readChunk(stream);
  121|       |
  122|  27.0k|        while(!stream->eof())
  ------------------
  |  Branch (122:15): [True: 24.2k, False: 2.85k]
  ------------------
  123|  24.2k|        {
  124|  24.2k|            switch (streamID)
  ------------------
  |  Branch (124:21): [True: 22.2k, False: 2.01k]
  ------------------
  125|  24.2k|            {
  126|  22.2k|            case M_MESH:
  ------------------
  |  Branch (126:13): [True: 22.2k, False: 2.01k]
  ------------------
  127|  22.2k|                readMesh(stream, pMesh, listener);
  128|  22.2k|                break;
  129|  24.2k|            }
  130|       |
  131|  22.0k|            streamID = readChunk(stream);
  132|  22.0k|        }
  133|  2.85k|        popInnerChunk(stream);
  134|  2.85k|    }
_ZN4Ogre18MeshSerializerImpl12readGeometryERKNS_9SharedPtrINS_10DataStreamEEEPNS_4MeshEPNS_10VertexDataE:
  601|   147k|    {
  602|       |
  603|   147k|        dest->vertexStart = 0;
  604|       |
  605|   147k|        unsigned int vertexCount = 0;
  606|   147k|        readInts(stream, &vertexCount, 1);
  607|   147k|        if (!checkChunkRemainingSize(mCurrentstreamLen, vertexCount, 1))
  ------------------
  |  Branch (607:13): [True: 1.43k, False: 146k]
  ------------------
  608|   147k|            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "Vertex count exceeds remaining chunk data");
  609|   146k|        dest->vertexCount = vertexCount;
  610|       |        // Find optional geometry streams
  611|   146k|        if (!stream->eof())
  ------------------
  |  Branch (611:13): [True: 146k, False: 23]
  ------------------
  612|   146k|        {
  613|   146k|            pushInnerChunk(stream);
  614|   146k|            unsigned short streamID = readChunk(stream);
  615|   174k|            while(!stream->eof() &&
  ------------------
  |  Branch (615:19): [True: 173k, False: 733]
  ------------------
  616|   173k|                (streamID == M_GEOMETRY_VERTEX_DECLARATION ||
  ------------------
  |  Branch (616:18): [True: 20.5k, False: 153k]
  ------------------
  617|   153k|                 streamID == M_GEOMETRY_VERTEX_BUFFER ))
  ------------------
  |  Branch (617:18): [True: 9.96k, False: 143k]
  ------------------
  618|  30.5k|            {
  619|  30.5k|                switch (streamID)
  ------------------
  |  Branch (619:25): [True: 30.5k, False: 0]
  ------------------
  620|  30.5k|                {
  621|  20.5k|                case M_GEOMETRY_VERTEX_DECLARATION:
  ------------------
  |  Branch (621:17): [True: 20.5k, False: 9.96k]
  ------------------
  622|  20.5k|                    readGeometryVertexDeclaration(stream, pMesh, dest);
  623|  20.5k|                    break;
  624|  9.96k|                case M_GEOMETRY_VERTEX_BUFFER:
  ------------------
  |  Branch (624:17): [True: 9.96k, False: 20.5k]
  ------------------
  625|  9.96k|                    readGeometryVertexBuffer(stream, pMesh, dest);
  626|  9.96k|                    break;
  627|  30.5k|                }
  628|       |                // Get next stream
  629|  27.8k|                if (!stream->eof())
  ------------------
  |  Branch (629:21): [True: 27.6k, False: 188]
  ------------------
  630|  27.6k|                {
  631|  27.6k|                    streamID = readChunk(stream);
  632|  27.6k|                }
  633|  27.8k|            }
  634|   143k|            if (!stream->eof())
  ------------------
  |  Branch (634:17): [True: 143k, False: 733]
  ------------------
  635|   143k|            {
  636|       |                // Backpedal back to start of non-submesh stream
  637|   143k|                backpedalChunkHeader(stream);
  638|   143k|            }
  639|   143k|            popInnerChunk(stream);
  640|   143k|        }
  641|       |
  642|       |        // Perform any necessary colour conversions from ARGB to ABGR (UBYTE4)
  643|   143k|        dest->convertPackedColour(_DETAIL_SWAP_RB, VET_UBYTE4_NORM);
  644|       |
  645|   143k|        auto rs = Root::getSingletonPtr() ? Root::getSingleton().getRenderSystem() : NULL;
  ------------------
  |  Branch (645:19): [True: 0, False: 143k]
  ------------------
  646|   143k|        if(!rs || rs->getCapabilities()->hasCapability(RSC_VERTEX_FORMAT_16X3))
  ------------------
  |  Branch (646:12): [True: 143k, False: 0]
  |  Branch (646:19): [True: 0, False: 0]
  ------------------
  647|   143k|            return;
  648|       |
  649|    506|        for(auto& elem : dest->vertexDeclaration->getElements())
  ------------------
  |  Branch (649:24): [True: 0, False: 506]
  ------------------
  650|      0|        {
  651|      0|            if (elem.getType() == VET_HALF3 || elem.getType() == VET_SHORT3 || elem.getType() == VET_USHORT3)
  ------------------
  |  Branch (651:17): [True: 0, False: 0]
  |  Branch (651:48): [True: 0, False: 0]
  |  Branch (651:80): [True: 0, False: 0]
  ------------------
  652|      0|            {
  653|      0|                auto dstType = VertexElement::multiplyTypeCount(VertexElement::getBaseType(elem.getType()), 4);
  654|      0|                dest->convertVertexElement(elem.getSemantic(), dstType, elem.getIndex());
  655|      0|            }
  656|      0|        }
  657|    506|    }
_ZN4Ogre18MeshSerializerImpl29readGeometryVertexDeclarationERKNS_9SharedPtrINS_10DataStreamEEEPNS_4MeshEPNS_10VertexDataE:
  661|  20.5k|    {
  662|       |        // Find optional geometry streams
  663|  20.5k|        if (!stream->eof())
  ------------------
  |  Branch (663:13): [True: 20.5k, False: 0]
  ------------------
  664|  20.5k|        {
  665|  20.5k|            pushInnerChunk(stream);
  666|  20.5k|            unsigned short streamID = readChunk(stream);
  667|  53.9k|            while(!stream->eof() &&
  ------------------
  |  Branch (667:19): [True: 53.6k, False: 242]
  ------------------
  668|  53.6k|                (streamID == M_GEOMETRY_VERTEX_ELEMENT ))
  ------------------
  |  Branch (668:17): [True: 33.5k, False: 20.1k]
  ------------------
  669|  33.5k|            {
  670|  33.5k|                switch (streamID)
  ------------------
  |  Branch (670:25): [True: 33.5k, False: 0]
  ------------------
  671|  33.5k|                {
  672|  33.5k|                case M_GEOMETRY_VERTEX_ELEMENT:
  ------------------
  |  Branch (672:17): [True: 33.5k, False: 0]
  ------------------
  673|  33.5k|                    readGeometryVertexElement(stream, pMesh, dest);
  674|  33.5k|                    break;
  675|  33.5k|                }
  676|       |                // Get next stream
  677|  33.3k|                if (!stream->eof())
  ------------------
  |  Branch (677:21): [True: 33.2k, False: 59]
  ------------------
  678|  33.2k|                {
  679|  33.2k|                    streamID = readChunk(stream);
  680|  33.2k|                }
  681|  33.3k|            }
  682|  20.3k|            if (!stream->eof())
  ------------------
  |  Branch (682:17): [True: 20.1k, False: 242]
  ------------------
  683|  20.1k|            {
  684|       |                // Backpedal back to start of non-submesh stream
  685|  20.1k|                backpedalChunkHeader(stream);
  686|  20.1k|            }
  687|  20.3k|            popInnerChunk(stream);
  688|  20.3k|        }
  689|       |
  690|  20.5k|    }
_ZN4Ogre18MeshSerializerImpl25readGeometryVertexElementERKNS_9SharedPtrINS_10DataStreamEEEPNS_4MeshEPNS_10VertexDataE:
  694|  33.5k|    {
  695|  33.5k|        unsigned short source, offset, index, tmp;
  696|  33.5k|        VertexElementType vType;
  697|  33.5k|        VertexElementSemantic vSemantic;
  698|       |        // unsigned short source;   // buffer bind source
  699|  33.5k|        readShorts(stream, &source, 1);
  700|       |        // unsigned short type;     // VertexElementType
  701|  33.5k|        readShorts(stream, &tmp, 1);
  702|  33.5k|        if(tmp == 4 || tmp == 11)
  ------------------
  |  Branch (702:12): [True: 261, False: 33.2k]
  |  Branch (702:24): [True: 1.56k, False: 31.7k]
  ------------------
  703|  1.82k|            vType = VET_UBYTE4_NORM;
  704|  31.7k|        else
  705|  31.7k|            vType = static_cast<VertexElementType>(tmp);
  706|       |        // unsigned short semantic; // VertexElementSemantic
  707|  33.5k|        readShorts(stream, &tmp, 1);
  708|  33.5k|        vSemantic = static_cast<VertexElementSemantic>(tmp);
  709|       |        // unsigned short offset;   // start offset in buffer in bytes
  710|  33.5k|        readShorts(stream, &offset, 1);
  711|       |        // unsigned short index;    // index of the semantic
  712|  33.5k|        readShorts(stream, &index, 1);
  713|       |
  714|  33.5k|        if (dest->vertexBufferBinding->isBufferBound(source))
  ------------------
  |  Branch (714:13): [True: 201, False: 33.3k]
  ------------------
  715|  33.5k|            OGRE_EXCEPT(Exception::ERR_INVALID_STATE, "Cannot add vertex element after reading buffer");
  716|       |
  717|  33.3k|        dest->vertexDeclaration->addElement(source, offset, vType, vSemantic, index);
  718|       |
  719|  33.3k|        if (vType == _DETAIL_SWAP_RB)
  ------------------
  |  Branch (719:13): [True: 3.95k, False: 29.3k]
  ------------------
  720|  3.95k|        {
  721|  3.95k|            LogManager::getSingleton().stream(LML_WARNING)
  722|  3.95k|                << "Warning: VET_COLOUR_ARGB element type is deprecated and incurs conversion on load. "
  723|  3.95k|                << "Use OgreMeshUpgrader on '" << pMesh->getName() << "' as soon as possible.";
  724|  3.95k|        }
  725|       |
  726|  33.3k|    }
_ZN4Ogre18MeshSerializerImpl24readGeometryVertexBufferERKNS_9SharedPtrINS_10DataStreamEEEPNS_4MeshEPNS_10VertexDataE:
  730|  9.96k|    {
  731|  9.96k|        unsigned short bindIndex, vertexSize;
  732|       |        // unsigned short bindIndex;    // Index to bind this buffer to
  733|  9.96k|        readShorts(stream, &bindIndex, 1);
  734|       |        // unsigned short vertexSize;   // Per-vertex size, must agree with declaration at this index
  735|  9.96k|        readShorts(stream, &vertexSize, 1);
  736|  9.96k|        if (dest->vertexBufferBinding->isBufferBound(bindIndex))
  ------------------
  |  Branch (736:13): [True: 199, False: 9.76k]
  ------------------
  737|  9.96k|            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "Duplicate vertex buffer binding");
  738|  9.76k|        pushInnerChunk(stream);
  739|  9.76k|        {
  740|       |        // Check for vertex data header
  741|  9.76k|        unsigned short headerID;
  742|  9.76k|        headerID = readChunk(stream);
  743|  9.76k|        if (headerID != M_GEOMETRY_VERTEX_BUFFER_DATA)
  ------------------
  |  Branch (743:13): [True: 445, False: 9.31k]
  ------------------
  744|    445|        {
  745|    445|            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Can't find vertex buffer data area",
  746|    445|                "MeshSerializerImpl::readGeometryVertexBuffer");
  747|    445|        }
  748|  9.31k|        size_t declaredVertexSize = dest->vertexDeclaration->getVertexSize(bindIndex);
  749|  9.31k|        if (declaredVertexSize == 0)
  ------------------
  |  Branch (749:13): [True: 474, False: 8.84k]
  ------------------
  750|    474|        {
  751|    474|            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Missing vertex declaration for buffer bind index");
  752|    474|        }
  753|       |        // Check that vertex size agrees
  754|  8.84k|        if (declaredVertexSize != vertexSize)
  ------------------
  |  Branch (754:13): [True: 275, False: 8.56k]
  ------------------
  755|    275|        {
  756|    275|            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "Buffer vertex size does not agree with vertex declaration");
  757|    275|        }
  758|       |
  759|       |        // Create / populate vertex buffer
  760|  8.56k|        size_t vbufBytes = dest->vertexCount * (size_t)vertexSize;
  761|  8.56k|        if (!checkChunkRemainingSize(mCurrentstreamLen, vbufBytes, 1))
  ------------------
  |  Branch (761:13): [True: 472, False: 8.09k]
  ------------------
  762|  8.56k|            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "Vertex buffer size exceeds remaining chunk data");
  763|  8.09k|        HardwareVertexBufferSharedPtr vbuf;
  764|  8.09k|        vbuf = pMesh->getHardwareBufferManager()->createVertexBuffer(
  765|  8.09k|            vertexSize,
  766|  8.09k|            dest->vertexCount,
  767|  8.09k|            pMesh->mVertexBufferUsage,
  768|  8.09k|            pMesh->mVertexBufferShadowBuffer);
  769|  8.09k|        HardwareBufferLockGuard vbufLock(vbuf, HardwareBuffer::HBL_DISCARD);
  770|  8.09k|        stream->read(vbufLock.pData, vbufBytes);
  771|       |
  772|  8.09k|        auto elems = dest->vertexDeclaration->findElementsBySource(bindIndex);
  773|       |        // validate vertex element declarations
  774|  8.09k|        for (auto& elem : elems)
  ------------------
  |  Branch (774:25): [True: 12.7k, False: 7.58k]
  ------------------
  775|  12.7k|        {
  776|  12.7k|            if (elem.getSize() == 0)
  ------------------
  |  Branch (776:17): [True: 268, False: 12.4k]
  ------------------
  777|  12.7k|                    OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "Invalid vertex element type");
  778|  12.4k|            if (elem.getOffset() + elem.getSize() > vertexSize)
  ------------------
  |  Branch (778:17): [True: 247, False: 12.1k]
  ------------------
  779|  12.4k|                    OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR,
  780|  12.4k|                                "Vertex element offset + size exceeds vertex buffer stride");
  781|  12.4k|        }
  782|       |
  783|       |        // endian conversion for OSX
  784|  7.58k|        flipFromLittleEndian(vbufLock.pData, dest->vertexCount, vertexSize, elems);
  785|       |
  786|       |        // Set binding
  787|  7.58k|        dest->vertexBufferBinding->setBinding(bindIndex, vbuf);
  788|  7.58k|        }
  789|      0|        popInnerChunk(stream);
  790|       |
  791|  7.58k|    }
_ZN4Ogre18MeshSerializerImpl20readSubMeshNameTableERKNS_9SharedPtrINS_10DataStreamEEEPNS_4MeshE:
  794|  4.16k|    {
  795|       |        // The map for
  796|  4.16k|        std::map<unsigned short, String> subMeshNames;
  797|  4.16k|        unsigned short streamID, subMeshIndex;
  798|       |
  799|       |        // Need something to store the index, and the objects name
  800|       |        // This table is a method that imported meshes can retain their naming
  801|       |        // so that the names established in the modelling software can be used
  802|       |        // to get the sub-meshes by name. The exporter must support exporting
  803|       |        // the optional stream M_SUBMESH_NAME_TABLE.
  804|       |
  805|       |        // Read in all the sub-streams. Each sub-stream should contain an index and Ogre::String for the name.
  806|  4.16k|        if (!stream->eof())
  ------------------
  |  Branch (806:13): [True: 4.16k, False: 0]
  ------------------
  807|  4.16k|        {
  808|  4.16k|            pushInnerChunk(stream);
  809|  4.16k|            streamID = readChunk(stream);
  810|  14.5k|            while(!stream->eof() && (streamID == M_SUBMESH_NAME_TABLE_ELEMENT ))
  ------------------
  |  Branch (810:19): [True: 14.0k, False: 457]
  |  Branch (810:37): [True: 10.3k, False: 3.70k]
  ------------------
  811|  10.3k|            {
  812|       |                // Read in the index of the submesh.
  813|  10.3k|                readShorts(stream, &subMeshIndex, 1);
  814|       |                // Read in the String and map it to its index.
  815|  10.3k|                subMeshNames[subMeshIndex] = readString(stream);
  816|       |
  817|       |                // If we're not end of file get the next stream ID
  818|  10.3k|                if (!stream->eof())
  ------------------
  |  Branch (818:21): [True: 10.0k, False: 318]
  ------------------
  819|  10.0k|                    streamID = readChunk(stream);
  820|  10.3k|            }
  821|  4.16k|            if (!stream->eof())
  ------------------
  |  Branch (821:17): [True: 3.70k, False: 457]
  ------------------
  822|  3.70k|            {
  823|       |                // Backpedal back to start of stream
  824|  3.70k|                backpedalChunkHeader(stream);
  825|  3.70k|            }
  826|  4.16k|            popInnerChunk(stream);
  827|  4.16k|        }
  828|       |
  829|       |        // Set all the submeshes names
  830|       |        // ?
  831|       |        // Loop through and save out the index and names.
  832|  4.16k|        for (auto& sn : subMeshNames)
  ------------------
  |  Branch (832:23): [True: 9.50k, False: 4.16k]
  ------------------
  833|  9.50k|        {
  834|       |            // Name this submesh to the stored name.
  835|  9.50k|            pMesh->nameSubMesh(sn.second, sn.first);
  836|  9.50k|        }
  837|  4.16k|    }
_ZN4Ogre18MeshSerializerImpl8readMeshERKNS_9SharedPtrINS_10DataStreamEEEPNS_4MeshEPNS_22MeshSerializerListenerE:
  840|  22.2k|    {
  841|       |        // Never automatically build edge lists for this version
  842|       |        // expect them in the file or not at all
  843|  22.2k|        pMesh->mAutoBuildEdgeLists = false;
  844|       |
  845|       |        // bool skeletallyAnimated
  846|  22.2k|        bool skeletallyAnimated;
  847|  22.2k|        readBools(stream, &skeletallyAnimated, 1);
  848|       |
  849|       |        // Find all substreams
  850|  22.2k|        if (!stream->eof())
  ------------------
  |  Branch (850:13): [True: 22.2k, False: 6]
  ------------------
  851|  22.2k|        {
  852|  22.2k|            pushInnerChunk(stream);
  853|  22.2k|            unsigned short streamID = readChunk(stream);
  854|   236k|            while(!stream->eof() &&
  ------------------
  |  Branch (854:19): [True: 233k, False: 2.88k]
  ------------------
  855|   233k|                (streamID == M_GEOMETRY ||
  ------------------
  |  Branch (855:18): [True: 21.4k, False: 212k]
  ------------------
  856|   212k|                 streamID == M_SUBMESH ||
  ------------------
  |  Branch (856:18): [True: 152k, False: 59.5k]
  ------------------
  857|  59.5k|                 streamID == M_MESH_SKELETON_LINK ||
  ------------------
  |  Branch (857:18): [True: 16.4k, False: 43.0k]
  ------------------
  858|  43.0k|                 streamID == M_MESH_BONE_ASSIGNMENT ||
  ------------------
  |  Branch (858:18): [True: 2.76k, False: 40.2k]
  ------------------
  859|  40.2k|                 streamID == M_MESH_LOD_LEVEL ||
  ------------------
  |  Branch (859:18): [True: 7.34k, False: 32.9k]
  ------------------
  860|  32.9k|                 streamID == M_MESH_BOUNDS ||
  ------------------
  |  Branch (860:18): [True: 3.76k, False: 29.1k]
  ------------------
  861|  29.1k|                 streamID == M_SUBMESH_NAME_TABLE ||
  ------------------
  |  Branch (861:18): [True: 4.16k, False: 24.9k]
  ------------------
  862|  24.9k|                 streamID == M_EDGE_LISTS ||
  ------------------
  |  Branch (862:18): [True: 1.07k, False: 23.8k]
  ------------------
  863|  23.8k|                 streamID == M_POSES ||
  ------------------
  |  Branch (863:18): [True: 1.50k, False: 22.3k]
  ------------------
  864|  22.3k|                 streamID == M_ANIMATIONS ||
  ------------------
  |  Branch (864:18): [True: 2.89k, False: 19.5k]
  ------------------
  865|  19.5k|                 streamID == M_TABLE_EXTREMES))
  ------------------
  |  Branch (865:18): [True: 1.88k, False: 17.6k]
  ------------------
  866|   216k|            {
  867|   216k|                switch(streamID)
  ------------------
  |  Branch (867:24): [True: 216k, False: 0]
  ------------------
  868|   216k|                {
  869|  21.4k|                case M_GEOMETRY:
  ------------------
  |  Branch (869:17): [True: 21.4k, False: 194k]
  ------------------
  870|  21.4k|                    pMesh->createVertexData();
  871|  21.4k|                    try {
  872|  21.4k|                        readGeometry(stream, pMesh, pMesh->sharedVertexData);
  873|  21.4k|                    }
  874|  21.4k|                    catch (Exception&)
  875|  21.4k|                    {
  876|       |                        // duff geometry data entry with 0 vertices
  877|  4.59k|                        pMesh->resetVertexData();
  878|       |                        // Skip this stream (pointer will have been returned to just after header)
  879|  4.59k|                        stream->skip(mCurrentstreamLen - MSTREAM_OVERHEAD_SIZE);
  880|  4.59k|                    }
  881|  21.4k|                    break;
  882|   152k|                case M_SUBMESH:
  ------------------
  |  Branch (882:17): [True: 152k, False: 63.3k]
  ------------------
  883|   152k|                    readSubMesh(stream, pMesh, listener);
  884|   152k|                    break;
  885|  16.4k|                case M_MESH_SKELETON_LINK:
  ------------------
  |  Branch (885:17): [True: 16.4k, False: 199k]
  ------------------
  886|  16.4k|                    readSkeletonLink(stream, pMesh, listener);
  887|  16.4k|                    break;
  888|  2.76k|                case M_MESH_BONE_ASSIGNMENT:
  ------------------
  |  Branch (888:17): [True: 2.76k, False: 213k]
  ------------------
  889|  2.76k|                    readMeshBoneAssignment(stream, pMesh);
  890|  2.76k|                    break;
  891|  7.34k|                case M_MESH_LOD_LEVEL:
  ------------------
  |  Branch (891:17): [True: 7.34k, False: 208k]
  ------------------
  892|  7.34k|                    readMeshLodLevel(stream, pMesh);
  893|  7.34k|                    break;
  894|  3.76k|                case M_MESH_BOUNDS:
  ------------------
  |  Branch (894:17): [True: 3.76k, False: 212k]
  ------------------
  895|  3.76k|                    readBoundsInfo(stream, pMesh);
  896|  3.76k|                    break;
  897|  4.16k|                case M_SUBMESH_NAME_TABLE:
  ------------------
  |  Branch (897:17): [True: 4.16k, False: 212k]
  ------------------
  898|  4.16k|                    readSubMeshNameTable(stream, pMesh);
  899|  4.16k|                    break;
  900|  1.07k|                case M_EDGE_LISTS:
  ------------------
  |  Branch (900:17): [True: 1.07k, False: 215k]
  ------------------
  901|  1.07k|                    readEdgeList(stream, pMesh);
  902|  1.07k|                    break;
  903|  1.50k|                case M_POSES:
  ------------------
  |  Branch (903:17): [True: 1.50k, False: 214k]
  ------------------
  904|  1.50k|                    readPoses(stream, pMesh);
  905|  1.50k|                    break;
  906|  2.89k|                case M_ANIMATIONS:
  ------------------
  |  Branch (906:17): [True: 2.89k, False: 213k]
  ------------------
  907|  2.89k|                    readAnimations(stream, pMesh);
  908|  2.89k|                    break;
  909|  1.88k|                case M_TABLE_EXTREMES:
  ------------------
  |  Branch (909:17): [True: 1.88k, False: 214k]
  ------------------
  910|  1.88k|                    readExtremes(stream, pMesh);
  911|  1.88k|                    break;
  912|   216k|                }
  913|       |
  914|   214k|                if (!stream->eof())
  ------------------
  |  Branch (914:21): [True: 212k, False: 2.24k]
  ------------------
  915|   212k|                {
  916|   212k|                    streamID = readChunk(stream);
  917|   212k|                }
  918|       |
  919|   214k|            }
  920|  20.5k|            if (!stream->eof())
  ------------------
  |  Branch (920:17): [True: 17.6k, False: 2.88k]
  ------------------
  921|  17.6k|            {
  922|       |                // Backpedal back to start of stream
  923|  17.6k|                backpedalChunkHeader(stream);
  924|  17.6k|            }
  925|  20.5k|            popInnerChunk(stream);
  926|  20.5k|        }
  927|       |
  928|  22.2k|    }
_ZN4Ogre18MeshSerializerImpl11readSubMeshERKNS_9SharedPtrINS_10DataStreamEEEPNS_4MeshEPNS_22MeshSerializerListenerE:
  931|   152k|    {
  932|   152k|        unsigned short streamID;
  933|       |
  934|   152k|        SubMesh* sm = pMesh->createSubMesh();
  935|       |
  936|       |        // char* materialName
  937|   152k|        String materialName = readString(stream);
  938|   152k|        if(listener)
  ------------------
  |  Branch (938:12): [True: 0, False: 152k]
  ------------------
  939|      0|            listener->processMaterialName(pMesh, &materialName);
  940|   152k|        if (auto material = MaterialManager::getSingleton().getByName(materialName, pMesh->getGroup()))
  ------------------
  |  Branch (940:18): [True: 0, False: 152k]
  ------------------
  941|      0|        {
  942|      0|            sm->setMaterial(material);
  943|      0|        }
  944|   152k|        else
  945|   152k|        {
  946|   152k|            logMaterialNotFound(materialName, pMesh->getGroup(), "SubMesh of", pMesh->getName(), LML_WARNING);
  947|   152k|        }
  948|       |
  949|       |        // bool useSharedVertices
  950|   152k|        readBools(stream,&sm->useSharedVertices, 1);
  951|       |
  952|   152k|        sm->indexData->indexStart = 0;
  953|   152k|        unsigned int indexCount = 0;
  954|   152k|        readInts(stream, &indexCount, 1);
  955|   152k|        sm->indexData->indexCount = indexCount;
  956|       |
  957|   152k|        HardwareIndexBufferSharedPtr ibuf;
  958|       |        // bool indexes32Bit
  959|   152k|        bool idx32bit;
  960|   152k|        readBools(stream, &idx32bit, 1);
  961|   152k|        if (indexCount > 0)
  ------------------
  |  Branch (961:13): [True: 132k, False: 20.3k]
  ------------------
  962|   132k|        {
  963|   132k|            if (!checkChunkRemainingSize(mCurrentstreamLen, indexCount, idx32bit ? sizeof(unsigned int) : sizeof(unsigned short)))
  ------------------
  |  Branch (963:17): [True: 123, False: 132k]
  |  Branch (963:73): [True: 3.39k, False: 129k]
  ------------------
  964|   132k|                OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "Index buffer size exceeds chunk size");
  965|   132k|            if (idx32bit)
  ------------------
  |  Branch (965:17): [True: 3.33k, False: 129k]
  ------------------
  966|  3.33k|            {
  967|  3.33k|                ibuf = pMesh->getHardwareBufferManager()->createIndexBuffer(
  968|  3.33k|                        HardwareIndexBuffer::IT_32BIT,
  969|  3.33k|                        sm->indexData->indexCount,
  970|  3.33k|                        pMesh->mIndexBufferUsage,
  971|  3.33k|                        pMesh->mIndexBufferShadowBuffer);
  972|  3.33k|                HardwareBufferLockGuard ibufLock(ibuf, HardwareBuffer::HBL_DISCARD);
  973|  3.33k|                readInts(stream, static_cast<unsigned int*>(ibufLock.pData), sm->indexData->indexCount);
  974|       |
  975|  3.33k|            }
  976|   129k|            else // 16-bit
  977|   129k|            {
  978|   129k|                ibuf = pMesh->getHardwareBufferManager()->createIndexBuffer(
  979|   129k|                        HardwareIndexBuffer::IT_16BIT,
  980|   129k|                        sm->indexData->indexCount,
  981|   129k|                        pMesh->mIndexBufferUsage,
  982|   129k|                        pMesh->mIndexBufferShadowBuffer);
  983|   129k|                HardwareBufferLockGuard ibufLock(ibuf, HardwareBuffer::HBL_DISCARD);
  984|   129k|                readShorts(stream, static_cast<unsigned short*>(ibufLock.pData), sm->indexData->indexCount);
  985|   129k|            }
  986|   132k|        }
  987|   152k|        sm->indexData->indexBuffer = ibuf;
  988|       |
  989|   152k|        pushInnerChunk(stream);
  990|   152k|        {
  991|       |        // M_GEOMETRY stream (Optional: present only if useSharedVertices = false)
  992|   152k|        if (!sm->useSharedVertices)
  ------------------
  |  Branch (992:13): [True: 126k, False: 26.1k]
  ------------------
  993|   126k|        {
  994|   126k|            streamID = readChunk(stream);
  995|   126k|            if (streamID != M_GEOMETRY)
  ------------------
  |  Branch (995:17): [True: 46, False: 126k]
  ------------------
  996|     46|            {
  997|     46|                OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "Missing geometry data in mesh file",
  998|     46|                    "MeshSerializerImpl::readSubMesh");
  999|     46|            }
 1000|   126k|            sm->createVertexData();
 1001|   126k|            readGeometry(stream, pMesh, sm->vertexData);
 1002|   126k|        }
 1003|       |
 1004|       |
 1005|       |        // Find all bone assignments, submesh operation, and texture aliases (if present)
 1006|   152k|        if (!stream->eof())
  ------------------
  |  Branch (1006:13): [True: 152k, False: 293]
  ------------------
 1007|   152k|        {
 1008|   152k|            streamID = readChunk(stream);
 1009|   152k|            bool seenTexAlias = false;
 1010|   155k|            while(!stream->eof() &&
  ------------------
  |  Branch (1010:19): [True: 155k, False: 184]
  ------------------
 1011|   155k|                (streamID == M_SUBMESH_BONE_ASSIGNMENT ||
  ------------------
  |  Branch (1011:18): [True: 1.60k, False: 153k]
  ------------------
 1012|   153k|                 streamID == M_SUBMESH_OPERATION ||
  ------------------
  |  Branch (1012:18): [True: 198, False: 153k]
  ------------------
 1013|   153k|                 streamID == M_SUBMESH_TEXTURE_ALIAS))
  ------------------
  |  Branch (1013:18): [True: 1.52k, False: 152k]
  ------------------
 1014|  3.32k|            {
 1015|  3.32k|                switch(streamID)
  ------------------
  |  Branch (1015:24): [True: 3.32k, False: 0]
  ------------------
 1016|  3.32k|                {
 1017|    198|                case M_SUBMESH_OPERATION:
  ------------------
  |  Branch (1017:17): [True: 198, False: 3.12k]
  ------------------
 1018|    198|                    readSubMeshOperation(stream, pMesh, sm);
 1019|    198|                    break;
 1020|  1.60k|                case M_SUBMESH_BONE_ASSIGNMENT:
  ------------------
  |  Branch (1020:17): [True: 1.60k, False: 1.72k]
  ------------------
 1021|  1.60k|                    readSubMeshBoneAssignment(stream, pMesh, sm);
 1022|  1.60k|                    break;
 1023|  1.52k|                case M_SUBMESH_TEXTURE_ALIAS:
  ------------------
  |  Branch (1023:17): [True: 1.52k, False: 1.79k]
  ------------------
 1024|  1.52k|                    seenTexAlias = true;
 1025|  1.52k|                    String aliasName = readString(stream);
 1026|  1.52k|                    String textureName = readString(stream);
 1027|  1.52k|                    break;
 1028|  3.32k|                }
 1029|       |
 1030|  3.32k|                if (!stream->eof())
  ------------------
  |  Branch (1030:21): [True: 3.29k, False: 28]
  ------------------
 1031|  3.29k|                {
 1032|  3.29k|                    streamID = readChunk(stream);
 1033|  3.29k|                }
 1034|       |
 1035|  3.32k|            }
 1036|       |
 1037|   152k|            if (seenTexAlias)
  ------------------
  |  Branch (1037:17): [True: 866, False: 151k]
  ------------------
 1038|    866|                LogManager::getSingleton().logError("texture aliases for SubMeshes are unsupported - " +
 1039|    866|                                                      stream->getName());
 1040|       |
 1041|   152k|            if (!stream->eof())
  ------------------
  |  Branch (1041:17): [True: 152k, False: 184]
  ------------------
 1042|   152k|            {
 1043|       |                // Backpedal back to start of stream
 1044|   152k|                    backpedalChunkHeader(stream);
 1045|   152k|                }
 1046|   152k|            }
 1047|   152k|        }
 1048|   152k|        popInnerChunk(stream);
 1049|       |
 1050|   152k|    }
_ZN4Ogre18MeshSerializerImpl20readSubMeshOperationERKNS_9SharedPtrINS_10DataStreamEEEPNS_4MeshEPNS_7SubMeshE:
 1054|    198|    {
 1055|       |        // unsigned short operationType
 1056|    198|        unsigned short opType;
 1057|    198|        readShorts(stream, &opType, 1);
 1058|    198|        sm->operationType = static_cast<RenderOperation::OperationType>(opType);
 1059|    198|    }
_ZN4Ogre18MeshSerializerImpl16readSkeletonLinkERKNS_9SharedPtrINS_10DataStreamEEEPNS_4MeshEPNS_22MeshSerializerListenerE:
 1070|  16.4k|    {
 1071|  16.4k|        String skelName = readString(stream);
 1072|       |
 1073|  16.4k|        if(listener)
  ------------------
  |  Branch (1073:12): [True: 0, False: 16.4k]
  ------------------
 1074|      0|            listener->processSkeletonName(pMesh, &skelName);
 1075|       |
 1076|  16.4k|        pMesh->setSkeletonName(skelName);
 1077|  16.4k|    }
_ZN4Ogre18MeshSerializerImpl22readMeshBoneAssignmentERKNS_9SharedPtrINS_10DataStreamEEEPNS_4MeshE:
 1120|  2.76k|    {
 1121|  2.76k|        VertexBoneAssignment assign;
 1122|       |
 1123|       |        // unsigned int vertexIndex;
 1124|  2.76k|        readInts(stream, &(assign.vertexIndex),1);
 1125|       |        // unsigned short boneIndex;
 1126|  2.76k|        readShorts(stream, &(assign.boneIndex),1);
 1127|       |        // float weight;
 1128|  2.76k|        readFloats(stream, &(assign.weight), 1);
 1129|       |
 1130|  2.76k|        pMesh->addBoneAssignment(assign);
 1131|       |
 1132|  2.76k|    }
_ZN4Ogre18MeshSerializerImpl25readSubMeshBoneAssignmentERKNS_9SharedPtrINS_10DataStreamEEEPNS_4MeshEPNS_7SubMeshE:
 1136|  1.60k|    {
 1137|  1.60k|        VertexBoneAssignment assign;
 1138|       |
 1139|       |        // unsigned int vertexIndex;
 1140|  1.60k|        readInts(stream, &(assign.vertexIndex),1);
 1141|       |        // unsigned short boneIndex;
 1142|  1.60k|        readShorts(stream, &(assign.boneIndex),1);
 1143|       |        // float weight;
 1144|  1.60k|        readFloats(stream, &(assign.weight), 1);
 1145|       |
 1146|  1.60k|        sub->addBoneAssignment(assign);
 1147|       |
 1148|  1.60k|    }
_ZN4Ogre18MeshSerializerImpl14readBoundsInfoERKNS_9SharedPtrINS_10DataStreamEEEPNS_4MeshE:
 1342|  3.76k|    {
 1343|  3.76k|        Vector3 min, max;
 1344|  3.76k|        readFloats(stream, min.ptr(), 3);
 1345|  3.76k|        readFloats(stream, max.ptr(), 3);
 1346|  3.76k|        AxisAlignedBox box(min, max);
 1347|  3.76k|        pMesh->_setBounds(box, false);
 1348|       |
 1349|  3.76k|        float radius;
 1350|  3.76k|        readFloats(stream, &radius, 1);
 1351|  3.76k|        pMesh->_setBoundingSphereRadius(radius);
 1352|  3.76k|    }
_ZN4Ogre18MeshSerializerImpl16readMeshLodLevelERKNS_9SharedPtrINS_10DataStreamEEEPNS_4MeshE:
 1362|  3.82k|    {
 1363|       |#if OGRE_NO_MESHLOD
 1364|       |
 1365|       |        /*
 1366|       |        //Since the chunk sizes in old versions are messed up, we can't use this clean solution.
 1367|       |        // We need to walk through the data to not rely on the chunk size!
 1368|       |        stream->skip(mCurrentstreamLen);
 1369|       |
 1370|       |        // Since we got here, we have already read the chunk header.
 1371|       |        backpedalChunkHeader(stream);
 1372|       |        */
 1373|       |        uint16 numSubs = pMesh->getNumSubMeshes();
 1374|       |        String strategyName = readString(stream);
 1375|       |        uint16 numLods;
 1376|       |        readShorts(stream, &numLods, 1);
 1377|       |        if (!checkChunkRemainingSize(mCurrentstreamLen, numLods > 0 ? numLods - 1 : 0, MSTREAM_OVERHEAD_SIZE + sizeof(float)))
 1378|       |            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "LOD level count exceeds chunk size");
 1379|       |        pushInnerChunk(stream);
 1380|       |        for (int lodID = 1; lodID < numLods; lodID++){
 1381|       |            unsigned short streamID = readChunk(stream);
 1382|       |            Real usageValue;
 1383|       |            readFloats(stream, &usageValue, 1);
 1384|       |            switch (streamID){
 1385|       |            case M_MESH_LOD_MANUAL:
 1386|       |            {
 1387|       |                                      String manualName = readString(stream);
 1388|       |                                      break;
 1389|       |            }
 1390|       |            case M_MESH_LOD_GENERATED:
 1391|       |                for (int i = 0; i < numSubs; ++i)
 1392|       |                {
 1393|       |                    unsigned int numIndexes;
 1394|       |                    readInts(stream, &numIndexes, 1);
 1395|       |
 1396|       |                    unsigned int offset;
 1397|       |                    readInts(stream, &offset, 1);
 1398|       |
 1399|       |                    // For merged buffers, you can pass the index of previous Lod.
 1400|       |                    // To create buffer it should be -1.
 1401|       |                    unsigned int bufferIndex;
 1402|       |                    readInts(stream, &bufferIndex, 1);
 1403|       |                    if (bufferIndex == (unsigned int)-1) {
 1404|       |                        // generate buffers
 1405|       |
 1406|       |                        // bool indexes32Bit
 1407|       |                        bool idx32Bit;
 1408|       |                        readBools(stream, &idx32Bit, 1);
 1409|       |
 1410|       |                        unsigned int buffIndexCount;
 1411|       |                        readInts(stream, &buffIndexCount, 1);
 1412|       |
 1413|       |                        size_t buffSize = buffIndexCount * (idx32Bit ? 4 : 2);
 1414|       |                        stream->skip(buffSize);
 1415|       |                    }
 1416|       |                }
 1417|       |                break;
 1418|       |            default:
 1419|       |                OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
 1420|       |                    "Invalid Lod Usage type in " + pMesh->getName(),
 1421|       |                    "MeshSerializerImpl::readMeshLodInfo");
 1422|       |            }
 1423|       |        }
 1424|       |        popInnerChunk(stream);
 1425|       |#else
 1426|       |        // Read the strategy to be used for this mesh
 1427|  3.82k|        String strategyName = readString(stream);
 1428|  3.82k|        LodStrategy *strategy = LodStrategyManager::getSingleton().getStrategy(strategyName);
 1429|       |
 1430|       |        // Check that valid strategy name was given, otherwise use default
 1431|  3.82k|        if (strategy == 0)
  ------------------
  |  Branch (1431:13): [True: 3.37k, False: 444]
  ------------------
 1432|  3.37k|            strategy = LodStrategyManager::getSingleton().getDefaultStrategy();
 1433|       |
 1434|  3.82k|        pMesh->setLodStrategy(strategy);
 1435|       |
 1436|       |        // unsigned short numLevels;
 1437|  3.82k|        uint16 numLods;
 1438|  3.82k|        readShorts(stream, &numLods, 1);
 1439|  3.82k|        numLods = std::max<ushort>(numLods, 1);
 1440|       |
 1441|  3.82k|        if (!checkChunkRemainingSize(mCurrentstreamLen, numLods - 1, MSTREAM_OVERHEAD_SIZE + sizeof(float)))
  ------------------
  |  Branch (1441:13): [True: 73, False: 3.74k]
  ------------------
 1442|  3.82k|            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "LOD level count exceeds chunk size");
 1443|       |
 1444|  3.74k|        if(pMesh->getNumLodLevels() > 1)
  ------------------
  |  Branch (1444:12): [True: 1, False: 3.74k]
  ------------------
 1445|  3.74k|            OGRE_EXCEPT(Exception::ERR_INVALID_STATE, "LOD levels already exist in mesh");
 1446|       |
 1447|  3.74k|        pMesh->_setLodInfo(numLods);
 1448|  3.74k|        pushInnerChunk(stream);
 1449|       |        // lodID=0 is the original mesh. We need to skip it.
 1450|  4.14k|        for(int lodID = 1; lodID < pMesh->getNumLodLevels(); lodID++){
  ------------------
  |  Branch (1450:28): [True: 699, False: 3.44k]
  ------------------
 1451|       |            // Read depth
 1452|    699|            MeshLodUsage& usage = pMesh->mMeshLodUsageList[lodID];
 1453|    699|            unsigned short streamID = readChunk(stream);
 1454|    699|            readFloats(stream, &(usage.userValue), 1);
 1455|    699|            switch(streamID){
 1456|    320|            case M_MESH_LOD_MANUAL:
  ------------------
  |  Branch (1456:13): [True: 320, False: 379]
  ------------------
 1457|    320|                readMeshLodUsageManual(stream, pMesh, lodID, usage);
 1458|    320|                break;
 1459|    211|            case M_MESH_LOD_GENERATED:
  ------------------
  |  Branch (1459:13): [True: 211, False: 488]
  ------------------
 1460|    211|                readMeshLodUsageGenerated(stream, pMesh, lodID, usage);
 1461|    211|                break;
 1462|     96|            default:
  ------------------
  |  Branch (1462:13): [True: 96, False: 603]
  ------------------
 1463|     96|                OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
 1464|    699|                "Invalid Lod Usage type in " + pMesh->getName(),
 1465|    699|                    "MeshSerializerImpl::readMeshLodInfo");
 1466|    699|            }
 1467|    398|            usage.manualMesh.reset(); // will trigger load later with manual Lod
 1468|    398|            usage.edgeData = NULL;
 1469|    398|        }
 1470|  3.44k|        popInnerChunk(stream);
 1471|  3.44k|#endif
 1472|  3.44k|    }
_ZN4Ogre18MeshSerializerImpl22readMeshLodUsageManualERKNS_9SharedPtrINS_10DataStreamEEEPNS_4MeshEtRNS_12MeshLodUsageE:
 1476|    320|    {
 1477|    320|        pMesh->mHasManualLodLevel = true;
 1478|    320|        usage.manualName = readString(stream);
 1479|       |        
 1480|       |        // Generate for mixed
 1481|    320|        for (auto *s : pMesh->getSubMeshes())
  ------------------
  |  Branch (1481:22): [True: 558, False: 320]
  ------------------
 1482|    558|        {
 1483|       |            s->mLodFaceList[lodNum-1] = OGRE_NEW IndexData();
 1484|    558|        }
 1485|    320|    }
_ZN4Ogre18MeshSerializerImpl25readMeshLodUsageGeneratedERKNS_9SharedPtrINS_10DataStreamEEEPNS_4MeshEtRNS_12MeshLodUsageE:
 1488|    211|    {
 1489|    211|        usage.manualName = "";
 1490|       |
 1491|       |        // Get one set of detail per SubMesh
 1492|    211|        for (auto *s : pMesh->getSubMeshes())
  ------------------
  |  Branch (1492:22): [True: 11.0k, False: 78]
  ------------------
 1493|  11.0k|        {
 1494|  11.0k|            s->mLodFaceList[lodNum - 1] = OGRE_NEW IndexData();
 1495|  11.0k|            IndexData* indexData = s->mLodFaceList[lodNum - 1];
 1496|       |
 1497|  11.0k|            unsigned int numIndexes;
 1498|  11.0k|            readInts(stream, &numIndexes, 1);
 1499|  11.0k|            indexData->indexCount = static_cast<size_t>(numIndexes);
 1500|       |
 1501|  11.0k|            unsigned int offset;
 1502|  11.0k|            readInts(stream, &offset, 1);
 1503|  11.0k|            indexData->indexStart = static_cast<size_t>(offset);
 1504|       |
 1505|       |            // For merged buffers, you can pass the index of previous Lod.
 1506|       |            // To create buffer it should be -1.
 1507|  11.0k|            unsigned int bufferIndex;
 1508|  11.0k|            readInts(stream, &bufferIndex, 1);
 1509|  11.0k|            if(bufferIndex != (unsigned int)-1) {
  ------------------
  |  Branch (1509:16): [True: 87, False: 10.9k]
  ------------------
 1510|     87|                if (bufferIndex - 1 >= (unsigned int)lodNum - 1)
  ------------------
  |  Branch (1510:21): [True: 79, False: 8]
  ------------------
 1511|     87|                    OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "Invalid LOD buffer index in mesh LOD data");
 1512|       |                // copy buffer pointer
 1513|      8|                indexData->indexBuffer = s->mLodFaceList.at(bufferIndex - 1)->indexBuffer;
 1514|      8|                if (!indexData->indexBuffer)
  ------------------
  |  Branch (1514:21): [True: 3, False: 5]
  ------------------
 1515|      8|                    OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "Referenced LOD index buffer is null");
 1516|  10.9k|            } else {
 1517|       |                // generate buffers
 1518|       |
 1519|       |                // bool indexes32Bit
 1520|  10.9k|                bool idx32Bit;
 1521|  10.9k|                readBools(stream, &idx32Bit, 1);
 1522|       |                
 1523|  10.9k|                unsigned int buffIndexCount;
 1524|  10.9k|                readInts(stream, &buffIndexCount, 1);
 1525|       |
 1526|  10.9k|                if (!checkChunkRemainingSize(mCurrentstreamLen, buffIndexCount, idx32Bit ? 4 : 2))
  ------------------
  |  Branch (1526:21): [True: 51, False: 10.9k]
  |  Branch (1526:81): [True: 613, False: 10.3k]
  ------------------
 1527|  10.9k|                    OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "LOD index data exceeds chunk size");
 1528|       |
 1529|  10.9k|                indexData->indexBuffer = pMesh->getHardwareBufferManager()->createIndexBuffer(
 1530|  10.9k|                    idx32Bit ? HardwareIndexBuffer::IT_32BIT : HardwareIndexBuffer::IT_16BIT,
  ------------------
  |  Branch (1530:21): [True: 565, False: 10.3k]
  ------------------
 1531|  10.9k|                    buffIndexCount, pMesh->mIndexBufferUsage, pMesh->mIndexBufferShadowBuffer);
 1532|  10.9k|                HardwareBufferLockGuard ibufLock(indexData->indexBuffer, HardwareBuffer::HBL_DISCARD);
 1533|       |
 1534|  10.9k|                if (idx32Bit)
  ------------------
  |  Branch (1534:21): [True: 565, False: 10.3k]
  ------------------
 1535|    565|                {
 1536|    565|                    readInts(stream, (uint32*)ibufLock.pData, buffIndexCount);
 1537|    565|                }
 1538|  10.3k|                else
 1539|  10.3k|                {
 1540|  10.3k|                    readShorts(stream, (uint16*)ibufLock.pData, buffIndexCount);
 1541|  10.3k|                }
 1542|  10.9k|            }
 1543|  11.0k|        }
 1544|    211|    }
_ZN4Ogre18MeshSerializerImpl20flipFromLittleEndianEPvmmRKNSt3__14listINS_13VertexElementENS2_9allocatorIS4_EEEE:
 1549|  7.57k|    {
 1550|  7.57k|        if (mFlipEndian)
  ------------------
  |  Branch (1550:13): [True: 7.57k, False: 0]
  ------------------
 1551|  7.57k|        {
 1552|  7.57k|            flipEndian(pData, vertexCount, vertexSize, elems);
 1553|  7.57k|        }
 1554|  7.57k|    }
_ZN4Ogre18MeshSerializerImpl10flipEndianEPvmmRKNSt3__14listINS_13VertexElementENS2_9allocatorIS4_EEEE:
 1567|  7.57k|    {
 1568|  7.57k|        void *pBase = pData;
 1569|  23.8k|        for (size_t v = 0; v < vertexCount; ++v)
  ------------------
  |  Branch (1569:28): [True: 16.3k, False: 7.57k]
  ------------------
 1570|  16.3k|        {
 1571|  16.3k|            for (auto& e : elems)
  ------------------
  |  Branch (1571:26): [True: 29.7k, False: 16.3k]
  ------------------
 1572|  29.7k|            {
 1573|  29.7k|                void *pElem;
 1574|       |                // re-base pointer to the element
 1575|  29.7k|                e.baseVertexPointerToElement(pBase, &pElem);
 1576|       |                // Flip the endian based on the type
 1577|  29.7k|                size_t typeSize = 0;
 1578|  29.7k|                switch (VertexElement::getBaseType(e.getType()))
 1579|  29.7k|                {
 1580|  2.70k|                    case VET_FLOAT1:
  ------------------
  |  Branch (1580:21): [True: 2.70k, False: 27.0k]
  ------------------
 1581|  2.70k|                        typeSize = sizeof(float);
 1582|  2.70k|                        break;
 1583|  1.06k|                    case VET_DOUBLE1:
  ------------------
  |  Branch (1583:21): [True: 1.06k, False: 28.7k]
  ------------------
 1584|  1.06k|                        typeSize = sizeof(double);
 1585|  1.06k|                        break;
 1586|    818|                    case VET_SHORT1:
  ------------------
  |  Branch (1586:21): [True: 818, False: 28.9k]
  ------------------
 1587|    818|                        typeSize = sizeof(short);
 1588|    818|                        break;
 1589|    786|                    case VET_USHORT1:
  ------------------
  |  Branch (1589:21): [True: 786, False: 29.0k]
  ------------------
 1590|    786|                        typeSize = sizeof(unsigned short);
 1591|    786|                        break;
 1592|    908|                    case VET_INT1:
  ------------------
  |  Branch (1592:21): [True: 908, False: 28.8k]
  ------------------
 1593|    908|                        typeSize = sizeof(int);
 1594|    908|                        break;
 1595|  1.55k|                    case VET_UINT1:
  ------------------
  |  Branch (1595:21): [True: 1.55k, False: 28.2k]
  ------------------
 1596|  1.55k|                        typeSize = sizeof(unsigned int);
 1597|  1.55k|                        break;
 1598|  7.67k|                    case VET_UBYTE4_NORM:
  ------------------
  |  Branch (1598:21): [True: 7.67k, False: 22.1k]
  ------------------
 1599|  7.89k|                    case VET_UBYTE4:
  ------------------
  |  Branch (1599:21): [True: 222, False: 29.5k]
  ------------------
 1600|  7.89k|                        typeSize = 0; // NO FLIPPING
 1601|  7.89k|                        break;
 1602|  14.0k|                    default:
  ------------------
  |  Branch (1602:21): [True: 14.0k, False: 15.7k]
  ------------------
 1603|  14.0k|                        assert(false); // Should never happen
 1604|  29.7k|                };
 1605|  29.7k|				Bitwise::bswapChunks(pElem, typeSize,
 1606|  29.7k|                    VertexElement::getTypeCount(e.getType()));
 1607|  29.7k|            }
 1608|       |
 1609|  16.3k|            pBase = static_cast<void*>(
 1610|  16.3k|                static_cast<unsigned char*>(pBase) + vertexSize);
 1611|  16.3k|        }
 1612|  7.57k|    }
_ZN4Ogre18MeshSerializerImpl12readEdgeListERKNS_9SharedPtrINS_10DataStreamEEEPNS_4MeshE:
 1797|  1.07k|    {
 1798|  1.07k|        pMesh->mEdgeListsBuilt = true; // set this early, so any partial data is freed
 1799|       |
 1800|  1.07k|        if (!stream->eof())
  ------------------
  |  Branch (1800:13): [True: 1.07k, False: 0]
  ------------------
 1801|  1.07k|        {
 1802|  1.07k|            pushInnerChunk(stream);
 1803|  1.07k|            unsigned short streamID = readChunk(stream);
 1804|  2.13k|            while(!stream->eof() &&
  ------------------
  |  Branch (1804:19): [True: 1.74k, False: 391]
  ------------------
 1805|  1.74k|                streamID == M_EDGE_LIST_LOD)
  ------------------
  |  Branch (1805:17): [True: 1.06k, False: 677]
  ------------------
 1806|  1.06k|            {
 1807|       |                // Process single LOD
 1808|       |
 1809|       |                // unsigned short lodIndex
 1810|  1.06k|                unsigned short lodIndex;
 1811|  1.06k|                readShorts(stream, &lodIndex, 1);
 1812|       |
 1813|       |                // bool isManual            // If manual, no edge data here, loaded from manual mesh
 1814|  1.06k|                bool isManual;
 1815|  1.06k|                readBools(stream, &isManual, 1);
 1816|       |                // Only load in non-manual levels; others will be connected up by Mesh on demand
 1817|       |#if OGRE_NO_MESHLOD
 1818|       |                // 
 1819|       |                if (!isManual)
 1820|       |                    if (lodIndex != 0) {
 1821|       |                        readEdgeListLodInfo(stream, NULL);
 1822|       |                    } else {
 1823|       |#else
 1824|  1.06k|                if (!isManual) {
  ------------------
  |  Branch (1824:21): [True: 371, False: 694]
  ------------------
 1825|    371|#endif
 1826|    371|                    MeshLodUsage& usage = pMesh->mMeshLodUsageList.at(lodIndex);
 1827|    371|                    if(!usage.manualName.empty())
  ------------------
  |  Branch (1827:24): [True: 9, False: 362]
  ------------------
 1828|    371|                        OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "LOD is marked as non-manual, but has a manual mesh name");
 1829|       |
 1830|    362|                    if (usage.edgeData)
  ------------------
  |  Branch (1830:25): [True: 1, False: 361]
  ------------------
 1831|    362|                        OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "Duplicate edge data for LOD");
 1832|       |
 1833|    361|                    auto edgeData = std::make_unique<EdgeData>(); // in case of exception, will be deleted automatically
 1834|       |
 1835|       |                    // Read detail information of the edge list
 1836|    361|                    readEdgeListLodInfo(stream, edgeData.get());
 1837|       |
 1838|       |                    // Postprocessing edge groups
 1839|    361|                    for (auto& edgeGroup : edgeData->edgeGroups)
  ------------------
  |  Branch (1839:42): [True: 175, False: 361]
  ------------------
 1840|    175|                    {
 1841|       |                        // Populate edgeGroup.vertexData pointers
 1842|       |                        // If there is shared vertex data, vertexSet 0 is that,
 1843|       |                        // otherwise 0 is first dedicated
 1844|    175|                        if (pMesh->sharedVertexData)
  ------------------
  |  Branch (1844:29): [True: 133, False: 42]
  ------------------
 1845|    133|                        {
 1846|    133|                            if (edgeGroup.vertexSet == 0)
  ------------------
  |  Branch (1846:33): [True: 62, False: 71]
  ------------------
 1847|     62|                            {
 1848|     62|                                edgeGroup.vertexData = pMesh->sharedVertexData;
 1849|     62|                            }
 1850|     71|                            else
 1851|     71|                            {
 1852|     71|                                edgeGroup.vertexData = pMesh->getSubMeshes().at(edgeGroup.vertexSet - 1)->vertexData;
 1853|     71|                            }
 1854|    133|                        }
 1855|     42|                        else
 1856|     42|                        {
 1857|     42|                            edgeGroup.vertexData = pMesh->getSubMeshes().at(edgeGroup.vertexSet)->vertexData;
 1858|     42|                        }
 1859|    175|                    }
 1860|       |
 1861|    361|                    usage.edgeData = edgeData.release();
 1862|    361|                }
 1863|       |
 1864|  1.05k|                if (!stream->eof())
  ------------------
  |  Branch (1864:21): [True: 713, False: 342]
  ------------------
 1865|    713|                {
 1866|    713|                    streamID = readChunk(stream);
 1867|    713|                }
 1868|       |
 1869|  1.05k|            }
 1870|  1.06k|            if (!stream->eof())
  ------------------
  |  Branch (1870:17): [True: 677, False: 391]
  ------------------
 1871|    677|            {
 1872|       |                // Backpedal back to start of stream
 1873|    677|                backpedalChunkHeader(stream);
 1874|    677|            }
 1875|  1.06k|            popInnerChunk(stream);
 1876|  1.06k|        }
 1877|  1.07k|    }
_ZN4Ogre18MeshSerializerImpl19readEdgeListLodInfoERKNS_9SharedPtrINS_10DataStreamEEEPNS_8EdgeDataE:
 1881|    359|    {
 1882|       |#if OGRE_NO_MESHLOD
 1883|       |        if (edgeData == NULL) { // skip it!
 1884|       |            bool isClosed;
 1885|       |            readBools(stream, &isClosed, 1);
 1886|       |            // unsigned long numTriangles
 1887|       |            uint32 numTriangles;
 1888|       |            readInts(stream, &numTriangles, 1);
 1889|       |            // unsigned long numEdgeGroups
 1890|       |            uint32 numEdgeGroups;
 1891|       |            readInts(stream, &numEdgeGroups, 1);
 1892|       |            stream->skip(numTriangles * (8 * sizeof(uint32) + 4 * sizeof(float)));
 1893|       |            pushInnerChunk(stream);
 1894|       |            for (uint32 eg = 0; eg < numEdgeGroups; ++eg)
 1895|       |            {
 1896|       |                unsigned short streamID = readChunk(stream);
 1897|       |                if (streamID != M_EDGE_GROUP)
 1898|       |                {
 1899|       |                    OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR,
 1900|       |                        "Missing M_EDGE_GROUP stream",
 1901|       |                        "MeshSerializerImpl::readEdgeListLodInfo");
 1902|       |                }
 1903|       |                uint32 tmp[3];
 1904|       |                // unsigned long vertexSet
 1905|       |                readInts(stream, &tmp[0], 3);
 1906|       |                uint32 numEdges;
 1907|       |                readInts(stream, &numEdges, 1);
 1908|       |
 1909|       |                stream->skip(numEdges * (6 * sizeof(uint32) + sizeof(bool)));
 1910|       |            }
 1911|       |            popInnerChunk(stream);
 1912|       |            return;
 1913|       |        }
 1914|       |#endif
 1915|       |        // bool isClosed
 1916|    359|        readBools(stream, &edgeData->isClosed, 1);
 1917|       |        // unsigned long numTriangles
 1918|    359|        uint32 numTriangles;
 1919|    359|        readInts(stream, &numTriangles, 1);
 1920|    359|        if(!checkChunkRemainingSize(mCurrentstreamLen, numTriangles, sizeof(EdgeData::Triangle) + sizeof(Vector4f)))
  ------------------
  |  Branch (1920:12): [True: 59, False: 300]
  ------------------
 1921|    359|            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "Edge list triangle data exceeds chunk size");
 1922|       |
 1923|       |        // Allocate correct amount of memory
 1924|    300|        edgeData->triangles.resize(numTriangles);
 1925|    300|        edgeData->triangleFaceNormals.resize(numTriangles);
 1926|    300|        edgeData->triangleLightFacings.resize(numTriangles);
 1927|       |        // unsigned long numEdgeGroups
 1928|    300|        uint32 numEdgeGroups;
 1929|    300|        readInts(stream, &numEdgeGroups, 1);
 1930|    300|        if(!checkChunkRemainingSize(mCurrentstreamLen, numEdgeGroups, sizeof(uint32) * 4))
  ------------------
  |  Branch (1930:12): [True: 47, False: 253]
  ------------------
 1931|    300|            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "Edge list group data exceeds chunk size");
 1932|       |
 1933|       |        // Allocate correct amount of memory
 1934|    253|        edgeData->edgeGroups.resize(numEdgeGroups);
 1935|       |        // Triangle* triangleList
 1936|    253|        uint32 tmp[3];
 1937|  2.39k|        for (size_t t = 0; t < numTriangles; ++t)
  ------------------
  |  Branch (1937:28): [True: 2.14k, False: 253]
  ------------------
 1938|  2.14k|        {
 1939|  2.14k|            EdgeData::Triangle& tri = edgeData->triangles[t];
 1940|       |            // unsigned long indexSet
 1941|  2.14k|            readInts(stream, tmp, 1);
 1942|  2.14k|            tri.indexSet = tmp[0];
 1943|       |            // unsigned long vertexSet
 1944|  2.14k|            readInts(stream, tmp, 1);
 1945|  2.14k|            tri.vertexSet = tmp[0];
 1946|       |            // unsigned long vertIndex[3]
 1947|  2.14k|            readInts(stream, tmp, 3);
 1948|       |
 1949|  2.14k|            tri.vertIndex[0] = tmp[0];
 1950|  2.14k|            tri.vertIndex[1] = tmp[1];
 1951|  2.14k|            tri.vertIndex[2] = tmp[2];
 1952|       |            // unsigned long sharedVertIndex[3]
 1953|  2.14k|            readInts(stream, tmp, 3);
 1954|  2.14k|            tri.sharedVertIndex[0] = tmp[0];
 1955|  2.14k|            tri.sharedVertIndex[1] = tmp[1];
 1956|  2.14k|            tri.sharedVertIndex[2] = tmp[2];
 1957|       |            // float normal[4]
 1958|  2.14k|            readFloats(stream, &(edgeData->triangleFaceNormals[t].x), 4);
 1959|       |
 1960|  2.14k|        }
 1961|    253|        pushInnerChunk(stream);
 1962|    574|        for (uint32 eg = 0; eg < numEdgeGroups; ++eg)
  ------------------
  |  Branch (1962:29): [True: 451, False: 123]
  ------------------
 1963|    451|        {
 1964|    451|            unsigned short streamID = readChunk(stream);
 1965|    451|            if (streamID != M_EDGE_GROUP)
  ------------------
  |  Branch (1965:17): [True: 21, False: 430]
  ------------------
 1966|     21|            {
 1967|     21|                OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR,
 1968|     21|                    "Missing M_EDGE_GROUP stream",
 1969|     21|                    "MeshSerializerImpl::readEdgeListLodInfo");
 1970|     21|            }
 1971|    430|            EdgeData::EdgeGroup& edgeGroup = edgeData->edgeGroups[eg];
 1972|       |
 1973|       |            // unsigned long vertexSet
 1974|    430|            readInts(stream, tmp, 1);
 1975|    430|            edgeGroup.vertexSet = tmp[0];
 1976|       |            // unsigned long triStart
 1977|    430|            readInts(stream, tmp, 1);
 1978|    430|            edgeGroup.triStart = tmp[0];
 1979|       |            // unsigned long triCount
 1980|    430|            readInts(stream, tmp, 1);
 1981|    430|            edgeGroup.triCount = tmp[0];
 1982|       |            // unsigned long numEdges
 1983|    430|            uint32 numEdges;
 1984|    430|            readInts(stream, &numEdges, 1);
 1985|    430|            if(!checkChunkRemainingSize(mCurrentstreamLen, numEdges, sizeof(uint32) * 6 + sizeof(bool)))
  ------------------
  |  Branch (1985:16): [True: 109, False: 321]
  ------------------
 1986|    430|                OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "Edge list edge data exceeds chunk size");
 1987|       |
 1988|    321|            edgeGroup.edges.resize(numEdges);
 1989|       |            // Edge* edgeList
 1990|  3.09k|            for (uint32 e = 0; e < numEdges; ++e)
  ------------------
  |  Branch (1990:32): [True: 2.77k, False: 321]
  ------------------
 1991|  2.77k|            {
 1992|  2.77k|                EdgeData::Edge& edge = edgeGroup.edges[e];
 1993|       |                // unsigned long  triIndex[2]
 1994|  2.77k|                readInts(stream, tmp, 2);
 1995|  2.77k|                edge.triIndex[0] = tmp[0];
 1996|  2.77k|                edge.triIndex[1] = tmp[1];
 1997|       |                // unsigned long  vertIndex[2]
 1998|  2.77k|                readInts(stream, tmp, 2);
 1999|  2.77k|                edge.vertIndex[0] = tmp[0];
 2000|  2.77k|                edge.vertIndex[1] = tmp[1];
 2001|       |                // unsigned long  sharedVertIndex[2]
 2002|  2.77k|                readInts(stream, tmp, 2);
 2003|  2.77k|                edge.sharedVertIndex[0] = tmp[0];
 2004|  2.77k|                edge.sharedVertIndex[1] = tmp[1];
 2005|       |                // bool degenerate
 2006|  2.77k|                readBools(stream, &(edge.degenerate), 1);
 2007|  2.77k|            }
 2008|    321|        }
 2009|    123|        popInnerChunk(stream);
 2010|    123|    }
_ZN4Ogre18MeshSerializerImpl9readPosesERKNS_9SharedPtrINS_10DataStreamEEEPNS_4MeshE:
 2325|  1.50k|    {
 2326|       |        // Find all substreams
 2327|  1.50k|        if (!stream->eof())
  ------------------
  |  Branch (2327:13): [True: 1.50k, False: 0]
  ------------------
 2328|  1.50k|        {
 2329|  1.50k|            pushInnerChunk(stream);
 2330|  1.50k|            unsigned short streamID = readChunk(stream);
 2331|  20.8k|            while(!stream->eof() &&
  ------------------
  |  Branch (2331:19): [True: 20.6k, False: 259]
  ------------------
 2332|  20.6k|                (streamID == M_POSE))
  ------------------
  |  Branch (2332:17): [True: 19.4k, False: 1.15k]
  ------------------
 2333|  19.4k|            {
 2334|  19.4k|                switch(streamID)
  ------------------
  |  Branch (2334:24): [True: 19.4k, False: 0]
  ------------------
 2335|  19.4k|                {
 2336|  19.4k|                case M_POSE:
  ------------------
  |  Branch (2336:17): [True: 19.4k, False: 0]
  ------------------
 2337|  19.4k|                    readPose(stream, pMesh);
 2338|  19.4k|                    break;
 2339|       |
 2340|  19.4k|                }
 2341|       |
 2342|  19.3k|                if (!stream->eof())
  ------------------
  |  Branch (2342:21): [True: 19.1k, False: 235]
  ------------------
 2343|  19.1k|                {
 2344|  19.1k|                    streamID = readChunk(stream);
 2345|  19.1k|                }
 2346|       |
 2347|  19.3k|            }
 2348|  1.41k|            if (!stream->eof())
  ------------------
  |  Branch (2348:17): [True: 1.15k, False: 259]
  ------------------
 2349|  1.15k|            {
 2350|       |                // Backpedal back to start of stream
 2351|  1.15k|                backpedalChunkHeader(stream);
 2352|  1.15k|            }
 2353|  1.41k|            popInnerChunk(stream);
 2354|  1.41k|        }
 2355|  1.50k|    }
_ZN4Ogre18MeshSerializerImpl8readPoseERKNS_9SharedPtrINS_10DataStreamEEEPNS_4MeshE:
 2358|  19.4k|    {
 2359|       |        // char* name (may be blank)
 2360|  19.4k|        String name = readString(stream);
 2361|       |        // unsigned short target
 2362|  19.4k|        unsigned short target;
 2363|  19.4k|        readShorts(stream, &target, 1);
 2364|       |
 2365|       |        // bool includesNormals
 2366|  19.4k|        bool includesNormals;
 2367|  19.4k|        readBools(stream, &includesNormals, 1);
 2368|       |        
 2369|  19.4k|        Pose* pose = pMesh->createPose(target, name);
 2370|       |
 2371|       |        // Find all substreams
 2372|  19.4k|        if (!stream->eof())
  ------------------
  |  Branch (2372:13): [True: 19.4k, False: 23]
  ------------------
 2373|  19.4k|        {
 2374|  19.4k|            pushInnerChunk(stream);
 2375|  19.4k|            unsigned short streamID = readChunk(stream);
 2376|  25.3k|            while(!stream->eof() &&
  ------------------
  |  Branch (2376:19): [True: 25.0k, False: 299]
  ------------------
 2377|  25.0k|                (streamID == M_POSE_VERTEX))
  ------------------
  |  Branch (2377:17): [True: 5.89k, False: 19.1k]
  ------------------
 2378|  5.89k|            {
 2379|  5.89k|                switch(streamID)
  ------------------
  |  Branch (2379:24): [True: 5.89k, False: 0]
  ------------------
 2380|  5.89k|                {
 2381|  5.89k|                case M_POSE_VERTEX:
  ------------------
  |  Branch (2381:17): [True: 5.89k, False: 0]
  ------------------
 2382|       |                    // create vertex offset
 2383|  5.89k|                    uint32 vertIndex;
 2384|  5.89k|                    Vector3f offset, normal;
 2385|       |                    // unsigned long vertexIndex
 2386|  5.89k|                    readInts(stream, &vertIndex, 1);
 2387|       |                    // float xoffset, yoffset, zoffset
 2388|  5.89k|                    readFloats(stream, offset.ptr(), 3);
 2389|       |                    
 2390|  5.89k|                    if (includesNormals)
  ------------------
  |  Branch (2390:25): [True: 3.21k, False: 2.68k]
  ------------------
 2391|  3.21k|                    {
 2392|  3.21k|                        readFloats(stream, normal.ptr(), 3);
 2393|  3.21k|                        pose->addVertex(vertIndex, offset, normal);                     
 2394|  3.21k|                    }
 2395|  2.68k|                    else 
 2396|  2.68k|                    {
 2397|  2.68k|                        pose->addVertex(vertIndex, offset);
 2398|  2.68k|                    }
 2399|       |
 2400|       |
 2401|  5.89k|                    break;
 2402|       |
 2403|  5.89k|                }
 2404|       |
 2405|  5.89k|                if (!stream->eof())
  ------------------
  |  Branch (2405:21): [True: 5.77k, False: 122]
  ------------------
 2406|  5.77k|                {
 2407|  5.77k|                    streamID = readChunk(stream);
 2408|  5.77k|                }
 2409|       |
 2410|  5.89k|            }
 2411|  19.4k|            if (!stream->eof())
  ------------------
  |  Branch (2411:17): [True: 19.1k, False: 299]
  ------------------
 2412|  19.1k|            {
 2413|       |                // Backpedal back to start of stream
 2414|  19.1k|                backpedalChunkHeader(stream);
 2415|  19.1k|            }
 2416|  19.4k|            popInnerChunk(stream);
 2417|  19.4k|        }
 2418|  19.4k|    }
_ZN4Ogre18MeshSerializerImpl14readAnimationsERKNS_9SharedPtrINS_10DataStreamEEEPNS_4MeshE:
 2421|  2.89k|    {
 2422|       |        // Find all substreams
 2423|  2.89k|        if (!stream->eof())
  ------------------
  |  Branch (2423:13): [True: 2.89k, False: 0]
  ------------------
 2424|  2.89k|        {
 2425|  2.89k|            pushInnerChunk(stream);
 2426|  2.89k|            unsigned short streamID = readChunk(stream);
 2427|  4.22k|            while(!stream->eof() &&
  ------------------
  |  Branch (2427:19): [True: 4.09k, False: 129]
  ------------------
 2428|  4.09k|                (streamID == M_ANIMATION))
  ------------------
  |  Branch (2428:17): [True: 1.48k, False: 2.60k]
  ------------------
 2429|  1.48k|            {
 2430|  1.48k|                switch(streamID)
  ------------------
  |  Branch (2430:24): [True: 1.48k, False: 0]
  ------------------
 2431|  1.48k|                {
 2432|  1.48k|                case M_ANIMATION:
  ------------------
  |  Branch (2432:17): [True: 1.48k, False: 0]
  ------------------
 2433|  1.48k|                    readAnimation(stream, pMesh);
 2434|  1.48k|                    break;
 2435|       |
 2436|  1.48k|                }
 2437|       |
 2438|  1.33k|                if (!stream->eof())
  ------------------
  |  Branch (2438:21): [True: 1.21k, False: 113]
  ------------------
 2439|  1.21k|                {
 2440|  1.21k|                    streamID = readChunk(stream);
 2441|  1.21k|                }
 2442|       |
 2443|  1.33k|            }
 2444|  2.73k|            if (!stream->eof())
  ------------------
  |  Branch (2444:17): [True: 2.60k, False: 129]
  ------------------
 2445|  2.60k|            {
 2446|       |                // Backpedal back to start of stream
 2447|  2.60k|                backpedalChunkHeader(stream);
 2448|  2.60k|            }
 2449|  2.73k|            popInnerChunk(stream);
 2450|  2.73k|        }
 2451|  2.89k|    }
_ZN4Ogre18MeshSerializerImpl13readAnimationERKNS_9SharedPtrINS_10DataStreamEEEPNS_4MeshE:
 2454|  1.48k|    {
 2455|       |        // char* name
 2456|  1.48k|        String name = readString(stream);
 2457|       |        // float length
 2458|  1.48k|        float len;
 2459|  1.48k|        readFloats(stream, &len, 1);
 2460|       |
 2461|  1.48k|        Animation* anim = pMesh->createAnimation(name, len);
 2462|       |
 2463|       |        // tracks
 2464|  1.48k|        if (!stream->eof())
  ------------------
  |  Branch (2464:13): [True: 1.43k, False: 49]
  ------------------
 2465|  1.43k|        {
 2466|  1.43k|            pushInnerChunk(stream);
 2467|  1.43k|            unsigned short streamID = readChunk(stream);
 2468|       |            
 2469|       |            // Optional base info is possible
 2470|  1.43k|            if (streamID == M_ANIMATION_BASEINFO)
  ------------------
  |  Branch (2470:17): [True: 128, False: 1.30k]
  ------------------
 2471|    128|            {
 2472|       |                // char baseAnimationName
 2473|    128|                String baseAnimName = readString(stream);
 2474|       |                // float baseKeyFrameTime
 2475|    128|                float baseKeyTime;
 2476|    128|                readFloats(stream, &baseKeyTime, 1);
 2477|       |                
 2478|    128|                anim->setUseBaseKeyFrame(true, baseKeyTime, baseAnimName);
 2479|       |                
 2480|    128|                if (!stream->eof())
  ------------------
  |  Branch (2480:21): [True: 123, False: 5]
  ------------------
 2481|    123|                {
 2482|       |                    // Get next stream
 2483|    123|                    streamID = readChunk(stream);
 2484|    123|                }
 2485|    128|            }
 2486|       |            
 2487|  2.58k|            while(!stream->eof() &&
  ------------------
  |  Branch (2487:19): [True: 2.49k, False: 83]
  ------------------
 2488|  2.49k|                streamID == M_ANIMATION_TRACK)
  ------------------
  |  Branch (2488:17): [True: 1.28k, False: 1.21k]
  ------------------
 2489|  1.28k|            {
 2490|  1.28k|                switch(streamID)
  ------------------
  |  Branch (2490:24): [True: 1.28k, False: 0]
  ------------------
 2491|  1.28k|                {
 2492|  1.28k|                case M_ANIMATION_TRACK:
  ------------------
  |  Branch (2492:17): [True: 1.28k, False: 0]
  ------------------
 2493|  1.28k|                    readAnimationTrack(stream, anim, pMesh);
 2494|  1.28k|                    break;
 2495|  1.28k|                };
 2496|  1.14k|                if (!stream->eof())
  ------------------
  |  Branch (2496:21): [True: 1.10k, False: 40]
  ------------------
 2497|  1.10k|                {
 2498|  1.10k|                    streamID = readChunk(stream);
 2499|  1.10k|                }
 2500|       |
 2501|  1.14k|            }
 2502|  1.30k|            if (!stream->eof())
  ------------------
  |  Branch (2502:17): [True: 1.21k, False: 83]
  ------------------
 2503|  1.21k|            {
 2504|       |                // Backpedal back to start of stream
 2505|  1.21k|                backpedalChunkHeader(stream);
 2506|  1.21k|            }
 2507|  1.30k|            popInnerChunk(stream);
 2508|  1.30k|        }
 2509|  1.48k|    }
_ZN4Ogre18MeshSerializerImpl18readAnimationTrackERKNS_9SharedPtrINS_10DataStreamEEEPNS_9AnimationEPNS_4MeshE:
 2513|  1.28k|    {
 2514|       |        // ushort type
 2515|  1.28k|        uint16 inAnimType;
 2516|  1.28k|        readShorts(stream, &inAnimType, 1);
 2517|  1.28k|        VertexAnimationType animType = (VertexAnimationType)inAnimType;
 2518|       |
 2519|       |        // unsigned short target
 2520|  1.28k|        uint16 target;
 2521|  1.28k|        readShorts(stream, &target, 1);
 2522|       |
 2523|  1.28k|        if (target > pMesh->getNumSubMeshes())
  ------------------
  |  Branch (2523:13): [True: 2, False: 1.27k]
  ------------------
 2524|  1.28k|            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Invalid target for vertex animation track");
 2525|       |
 2526|  1.27k|        VertexData* vdata = pMesh->getVertexDataByTrackHandle(target);
 2527|  1.27k|        if (!vdata)
  ------------------
  |  Branch (2527:13): [True: 2, False: 1.27k]
  ------------------
 2528|  1.27k|            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Animation track references target with no vertex data");
 2529|  1.27k|        VertexAnimationTrack* track = anim->createVertexTrack(target, vdata, animType);
 2530|       |
 2531|       |        // keyframes
 2532|  1.27k|        if (!stream->eof())
  ------------------
  |  Branch (2532:13): [True: 1.26k, False: 8]
  ------------------
 2533|  1.26k|        {
 2534|  1.26k|            pushInnerChunk(stream);
 2535|  1.26k|            unsigned short streamID = readChunk(stream);
 2536|  5.29k|            while(!stream->eof() &&
  ------------------
  |  Branch (2536:19): [True: 5.19k, False: 95]
  ------------------
 2537|  5.19k|                (streamID == M_ANIMATION_MORPH_KEYFRAME ||
  ------------------
  |  Branch (2537:18): [True: 1.69k, False: 3.50k]
  ------------------
 2538|  3.50k|                 streamID == M_ANIMATION_POSE_KEYFRAME))
  ------------------
  |  Branch (2538:18): [True: 2.39k, False: 1.10k]
  ------------------
 2539|  4.08k|            {
 2540|  4.08k|                switch(streamID)
  ------------------
  |  Branch (2540:24): [True: 4.08k, False: 0]
  ------------------
 2541|  4.08k|                {
 2542|  1.69k|                case M_ANIMATION_MORPH_KEYFRAME:
  ------------------
  |  Branch (2542:17): [True: 1.69k, False: 2.39k]
  ------------------
 2543|  1.69k|                    readMorphKeyFrame(stream, pMesh, track);
 2544|  1.69k|                    break;
 2545|  2.39k|                case M_ANIMATION_POSE_KEYFRAME:
  ------------------
  |  Branch (2545:17): [True: 2.39k, False: 1.69k]
  ------------------
 2546|  2.39k|                    readPoseKeyFrame(stream, track);
 2547|  2.39k|                    break;
 2548|  4.08k|                };
 2549|  4.02k|                if (!stream->eof())
  ------------------
  |  Branch (2549:21): [True: 3.98k, False: 34]
  ------------------
 2550|  3.98k|                {
 2551|  3.98k|                    streamID = readChunk(stream);
 2552|  3.98k|                }
 2553|       |
 2554|  4.02k|            }
 2555|  1.20k|            if (!stream->eof())
  ------------------
  |  Branch (2555:17): [True: 1.10k, False: 95]
  ------------------
 2556|  1.10k|            {
 2557|       |                // Backpedal back to start of stream
 2558|  1.10k|                backpedalChunkHeader(stream);
 2559|  1.10k|            }
 2560|  1.20k|            popInnerChunk(stream);
 2561|  1.20k|        }
 2562|       |
 2563|  1.27k|    }
_ZN4Ogre18MeshSerializerImpl17readMorphKeyFrameERKNS_9SharedPtrINS_10DataStreamEEEPNS_4MeshEPNS_20VertexAnimationTrackE:
 2566|  1.69k|    {
 2567|       |        // float time
 2568|  1.69k|        float timePos;
 2569|  1.69k|        readFloats(stream, &timePos, 1);
 2570|       |        
 2571|       |        // bool includesNormals
 2572|  1.69k|        bool includesNormals;
 2573|  1.69k|        readBools(stream, &includesNormals, 1);
 2574|       |
 2575|  1.69k|        VertexMorphKeyFrame* kf = track->createVertexMorphKeyFrame(timePos);
 2576|       |
 2577|       |        // Create buffer, allow read and use shadow buffer
 2578|  1.69k|        size_t vertexCount = track->getAssociatedVertexData()->vertexCount;
 2579|  1.69k|        size_t vertexSize = sizeof(float) * (includesNormals ? 6 : 3);
  ------------------
  |  Branch (2579:46): [True: 709, False: 986]
  ------------------
 2580|  1.69k|        HardwareVertexBufferSharedPtr vbuf =
 2581|  1.69k|            pMesh->getHardwareBufferManager()->createVertexBuffer(
 2582|  1.69k|                vertexSize, vertexCount,
 2583|  1.69k|                HardwareBuffer::HBU_STATIC, true);
 2584|       |        // float x,y,z          // repeat by number of vertices in original geometry
 2585|  1.69k|        HardwareBufferLockGuard vbufLock(vbuf, HardwareBuffer::HBL_DISCARD);
 2586|  1.69k|        readFloats(stream, static_cast<float*>(vbufLock.pData), vertexCount * (includesNormals ? 6 : 3));
  ------------------
  |  Branch (2586:80): [True: 709, False: 986]
  ------------------
 2587|  1.69k|        kf->setVertexBuffer(vbuf);
 2588|       |
 2589|  1.69k|    }
_ZN4Ogre18MeshSerializerImpl16readPoseKeyFrameERKNS_9SharedPtrINS_10DataStreamEEEPNS_20VertexAnimationTrackE:
 2592|  2.39k|    {
 2593|       |        // float time
 2594|  2.39k|        float timePos;
 2595|  2.39k|        readFloats(stream, &timePos, 1);
 2596|       |
 2597|       |        // Create keyframe
 2598|  2.39k|        VertexPoseKeyFrame* kf = track->createVertexPoseKeyFrame(timePos);
 2599|       |
 2600|  2.39k|        if (!stream->eof())
  ------------------
  |  Branch (2600:13): [True: 2.38k, False: 9]
  ------------------
 2601|  2.38k|        {
 2602|  2.38k|            pushInnerChunk(stream);
 2603|  2.38k|            unsigned short streamID = readChunk(stream);
 2604|  4.98k|            while(!stream->eof() &&
  ------------------
  |  Branch (2604:19): [True: 4.90k, False: 79]
  ------------------
 2605|  4.90k|                streamID == M_ANIMATION_POSE_REF)
  ------------------
  |  Branch (2605:17): [True: 2.60k, False: 2.30k]
  ------------------
 2606|  2.60k|            {
 2607|  2.60k|                switch(streamID)
  ------------------
  |  Branch (2607:24): [True: 2.60k, False: 0]
  ------------------
 2608|  2.60k|                {
 2609|  2.60k|                case M_ANIMATION_POSE_REF:
  ------------------
  |  Branch (2609:17): [True: 2.60k, False: 0]
  ------------------
 2610|  2.60k|                    uint16 poseIndex;
 2611|  2.60k|                    float influence;
 2612|       |                    // unsigned short poseIndex
 2613|  2.60k|                    readShorts(stream, &poseIndex, 1);
 2614|       |                    // float influence
 2615|  2.60k|                    readFloats(stream, &influence, 1);
 2616|       |
 2617|  2.60k|                    kf->addPoseReference(poseIndex, influence);
 2618|       |
 2619|  2.60k|                    break;
 2620|  2.60k|                };
 2621|  2.60k|                if (!stream->eof())
  ------------------
  |  Branch (2621:21): [True: 2.59k, False: 9]
  ------------------
 2622|  2.59k|                {
 2623|  2.59k|                    streamID = readChunk(stream);
 2624|  2.59k|                }
 2625|  2.60k|            }
 2626|  2.38k|            if (!stream->eof())
  ------------------
  |  Branch (2626:17): [True: 2.30k, False: 79]
  ------------------
 2627|  2.30k|            {
 2628|       |                // Backpedal back to start of stream
 2629|  2.30k|                backpedalChunkHeader(stream);
 2630|  2.30k|            }
 2631|  2.38k|            popInnerChunk(stream);
 2632|  2.38k|        }
 2633|  2.39k|    }
_ZN4Ogre18MeshSerializerImpl12readExtremesERKNS_9SharedPtrINS_10DataStreamEEEPNS_4MeshE:
 2636|  1.88k|    {
 2637|  1.88k|        unsigned short idx;
 2638|  1.88k|        readShorts(stream, &idx, 1);
 2639|       |        
 2640|  1.88k|        SubMesh *sm = pMesh->getSubMeshes().at(idx);
 2641|       |
 2642|  1.88k|        const size_t minChunkSize = MSTREAM_OVERHEAD_SIZE + sizeof(unsigned short);
 2643|  1.88k|        if (mCurrentstreamLen <= minChunkSize)
  ------------------
  |  Branch (2643:13): [True: 3, False: 1.87k]
  ------------------
 2644|  1.88k|            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "Extremes chunk too small");
 2645|       |
 2646|  1.87k|        size_t n_floats = (mCurrentstreamLen - minChunkSize) / sizeof(float);
 2647|       |
 2648|  1.87k|        if (n_floats == 0 || n_floats % 3 != 0)
  ------------------
  |  Branch (2648:13): [True: 20, False: 1.85k]
  |  Branch (2648:30): [True: 10, False: 1.84k]
  ------------------
 2649|  1.87k|            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "Invalid extremes data size");
 2650|       |        
 2651|  1.86k|        sm->extremityPoints.resize(n_floats / 3);
 2652|       |
 2653|  1.86k|        readFloats(stream, sm->extremityPoints.front().ptr(), n_floats);
 2654|  1.86k|    }
_ZN4Ogre23MeshSerializerImpl_v1_8C2Ev:
 2668|  5.12k|    {
 2669|       |        // Version number
 2670|  5.12k|        mVersion = "[MeshSerializer_v1.8]";
 2671|  5.12k|    }
_ZN4Ogre23MeshSerializerImpl_v1_825readMeshLodUsageGeneratedERKNS_9SharedPtrINS_10DataStreamEEEPNS_4MeshEtRNS_12MeshLodUsageE:
 2898|    204|    {
 2899|    204|        usage.manualName = "";
 2900|    204|        usage.manualMesh.reset();
 2901|    204|        pushInnerChunk(stream);
 2902|    204|        {
 2903|       |            // Get one set of detail per SubMesh
 2904|    204|            for (auto *sm : pMesh->getSubMeshes())
  ------------------
  |  Branch (2904:27): [True: 198, False: 111]
  ------------------
 2905|    198|            {
 2906|    198|                unsigned long streamID = readChunk(stream);
 2907|    198|                if (streamID != M_MESH_LOD_GENERATED)
  ------------------
  |  Branch (2907:21): [True: 30, False: 168]
  ------------------
 2908|     30|                {
 2909|     30|                    OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
 2910|     30|                        "Missing M_MESH_LOD_GENERATED stream in " + pMesh->getName(),
 2911|     30|                        "MeshSerializerImpl::readMeshLodUsageGenerated");
 2912|     30|                }
 2913|       |
 2914|    168|                IndexData* indexData = OGRE_NEW IndexData();
 2915|    168|                sm->mLodFaceList[lodNum - 1] = indexData;
 2916|    168|                unsigned int numIndexes;
 2917|    168|                readInts(stream, &numIndexes, 1);
 2918|    168|                bool idx32Bit;
 2919|    168|                readBools(stream, &idx32Bit, 1);
 2920|       |
 2921|    168|                if (!checkChunkRemainingSize(mCurrentstreamLen, numIndexes, idx32Bit ? 4 : 2))
  ------------------
  |  Branch (2921:21): [True: 63, False: 105]
  |  Branch (2921:77): [True: 92, False: 76]
  ------------------
 2922|    168|                    OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "LOD index data exceeds chunk size");
 2923|       |
 2924|    105|                indexData->indexCount = numIndexes;
 2925|       |
 2926|    105|                if (idx32Bit)
  ------------------
  |  Branch (2926:21): [True: 38, False: 67]
  ------------------
 2927|     38|                {
 2928|     38|                    indexData->indexBuffer = pMesh->getHardwareBufferManager()->createIndexBuffer(
 2929|     38|                        HardwareIndexBuffer::IT_32BIT, indexData->indexCount,
 2930|     38|                        pMesh->mIndexBufferUsage, pMesh->mIndexBufferShadowBuffer);
 2931|     38|                    HardwareBufferLockGuard ibufLock(indexData->indexBuffer, HardwareBuffer::HBL_DISCARD);
 2932|     38|                    readInts(stream, static_cast<unsigned int*>(ibufLock.pData), indexData->indexCount);
 2933|     38|                }
 2934|     67|                else
 2935|     67|                {
 2936|     67|                    indexData->indexBuffer = pMesh->getHardwareBufferManager()->createIndexBuffer(
 2937|     67|                        HardwareIndexBuffer::IT_16BIT, indexData->indexCount,
 2938|     67|                        pMesh->mIndexBufferUsage, pMesh->mIndexBufferShadowBuffer);
 2939|     67|                    HardwareBufferLockGuard ibufLock(indexData->indexBuffer, HardwareBuffer::HBL_DISCARD);
 2940|     67|                    readShorts(stream, static_cast<unsigned short*>(ibufLock.pData), indexData->indexCount);
 2941|     67|                }
 2942|    105|            }
 2943|    204|        }
 2944|    111|        popInnerChunk(stream);
 2945|    111|    }
_ZN4Ogre23MeshSerializerImpl_v1_822readMeshLodUsageManualERKNS_9SharedPtrINS_10DataStreamEEEPNS_4MeshEtRNS_12MeshLodUsageE:
 2949|     24|    {
 2950|     24|        pushInnerChunk(stream);
 2951|     24|        unsigned long streamID;
 2952|       |        // Read detail stream
 2953|     24|        streamID = readChunk(stream);
 2954|     24|        if (streamID != M_MESH_LOD_MANUAL)
  ------------------
  |  Branch (2954:13): [True: 5, False: 19]
  ------------------
 2955|      5|        {
 2956|      5|            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
 2957|      5|                "Missing M_MESH_LOD_MANUAL stream in " + pMesh->getName(),
 2958|      5|                "MeshSerializerImpl::readMeshLodUsageManual");
 2959|      5|        }
 2960|       |
 2961|     19|        usage.manualName = readString(stream);
 2962|     19|        usage.manualMesh.reset(); // will trigger load later
 2963|     19|        popInnerChunk(stream);
 2964|     19|    }
_ZN4Ogre23MeshSerializerImpl_v1_816readMeshLodLevelERKNS_9SharedPtrINS_10DataStreamEEEPNS_4MeshE:
 2968|  3.52k|    {
 2969|       |#if OGRE_NO_MESHLOD
 2970|       |
 2971|       |        /*
 2972|       |        //Since the chunk sizes in old versions are messed up, we can't use this clean solution.
 2973|       |        // We need to walk through the data to not rely on the chunk size!
 2974|       |        stream->skip(mCurrentstreamLen);
 2975|       |
 2976|       |        // Since we got here, we have already read the chunk header.
 2977|       |        backpedalChunkHeader(stream);
 2978|       |        */
 2979|       |        uint16 numSubs = pMesh->getNumSubMeshes();
 2980|       |        String strategyName = readString(stream);
 2981|       |        uint16 numLods;
 2982|       |        readShorts(stream, &numLods, 1);
 2983|       |        if (!checkChunkRemainingSize(mCurrentstreamLen, numLods > 0 ? numLods - 1 : 0, MSTREAM_OVERHEAD_SIZE + sizeof(float)))
 2984|       |            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "LOD level count exceeds chunk size");
 2985|       |        bool manual;
 2986|       |        readBools(stream, &manual, 1); // missing in v1_9
 2987|       |        pushInnerChunk(stream);
 2988|       |        for (uint16 i = 1; i < numLods; ++i)
 2989|       |        {
 2990|       |            uint16 streamID = readChunk(stream);
 2991|       |            if (streamID != M_MESH_LOD_USAGE)
 2992|       |            {
 2993|       |                OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
 2994|       |                    "Missing M_MESH_LOD_USAGE stream in " + pMesh->getName(),
 2995|       |                    "MeshSerializerImpl::readMeshLodInfo");
 2996|       |            }
 2997|       |            float usageValue;
 2998|       |            readFloats(stream, &usageValue, 1);
 2999|       |
 3000|       |            if (manual)
 3001|       |            {
 3002|       |                // Read detail stream
 3003|       |                streamID = readChunk(stream);
 3004|       |                if (streamID != M_MESH_LOD_MANUAL)
 3005|       |                {
 3006|       |                    OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
 3007|       |                        "Missing M_MESH_LOD_MANUAL stream in " + pMesh->getName(),
 3008|       |                        "MeshSerializerImpl::readMeshLodUsageManual");
 3009|       |                }
 3010|       |
 3011|       |                String manualName = readString(stream);
 3012|       |            }
 3013|       |            else
 3014|       |            {
 3015|       |                pushInnerChunk(stream);
 3016|       |                for (uint16 n = 0; n < numSubs; ++n)
 3017|       |                {
 3018|       |                    streamID = readChunk(stream);
 3019|       |                    if (streamID != M_MESH_LOD_GENERATED)
 3020|       |                    {
 3021|       |                        OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
 3022|       |                            "Missing M_MESH_LOD_GENERATED stream in " + pMesh->getName(),
 3023|       |                            "MeshSerializerImpl::readMeshLodUsageGenerated");
 3024|       |                    }
 3025|       |
 3026|       |                    unsigned int numIndexes;
 3027|       |                    readInts(stream, &numIndexes, 1);
 3028|       |
 3029|       |                    bool idx32Bit;
 3030|       |                    readBools(stream, &idx32Bit, 1);
 3031|       |
 3032|       |                    size_t buffSize = numIndexes * (idx32Bit ? 4 : 2);
 3033|       |                    stream->skip(buffSize);
 3034|       |                }
 3035|       |                popInnerChunk(stream);
 3036|       |            }
 3037|       |        }
 3038|       |        popInnerChunk(stream);
 3039|       |#else
 3040|  3.52k|        unsigned short streamID, i;
 3041|       |
 3042|       |        // Read the strategy to be used for this mesh
 3043|  3.52k|        String strategyName = readString(stream);
 3044|  3.52k|        LodStrategy *strategy = LodStrategyManager::getSingleton().getStrategy(strategyName);
 3045|       |        
 3046|  3.52k|        if (strategy)
  ------------------
  |  Branch (3046:13): [True: 892, False: 2.63k]
  ------------------
 3047|    892|            pMesh->setLodStrategy(strategy);
 3048|       |
 3049|       |        // unsigned short numLevels;
 3050|  3.52k|        uint16 numLods;
 3051|  3.52k|        readShorts(stream, &numLods, 1);
 3052|  3.52k|        numLods = std::max<ushort>(numLods, 1);
 3053|       |
 3054|  3.52k|        if (!checkChunkRemainingSize(mCurrentstreamLen, numLods - 1, MSTREAM_OVERHEAD_SIZE + sizeof(float)))
  ------------------
  |  Branch (3054:13): [True: 47, False: 3.47k]
  ------------------
 3055|  3.52k|            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "LOD level count exceeds chunk size");
 3056|       |
 3057|  3.47k|        if(pMesh->getNumLodLevels() > 1)
  ------------------
  |  Branch (3057:12): [True: 3, False: 3.47k]
  ------------------
 3058|  3.47k|            OGRE_EXCEPT(Exception::ERR_INVALID_STATE, "LOD levels already exist in mesh");
 3059|       |
 3060|  3.47k|        pMesh->mMeshLodUsageList.resize(numLods);
 3061|       |
 3062|  3.47k|        bool manual; // true for manual alternate meshes, false for generated
 3063|  3.47k|        readBools(stream, &manual, 1);
 3064|  3.47k|        pMesh->mHasManualLodLevel = manual;
 3065|       |
 3066|       |        // Preallocate submesh lod face data if not manual
 3067|  3.47k|        if (!pMesh->hasManualLodLevel())
  ------------------
  |  Branch (3067:13): [True: 1.80k, False: 1.67k]
  ------------------
 3068|  1.80k|        {
 3069|  1.80k|            unsigned short numsubs = pMesh->getNumSubMeshes();
 3070|   162k|            for (i = 0; i < numsubs; ++i)
  ------------------
  |  Branch (3070:25): [True: 161k, False: 1.80k]
  ------------------
 3071|   161k|            {
 3072|   161k|                SubMesh* sm = pMesh->getSubMesh(i);
 3073|   161k|                assert(sm->mLodFaceList.empty());
 3074|   161k|                sm->mLodFaceList.resize(numLods - 1);
 3075|   161k|            }
 3076|  1.80k|        }
 3077|       |
 3078|  3.47k|        pushInnerChunk(stream);
 3079|       |        // Loop from 1 rather than 0 (full detail index is not in file)
 3080|  3.74k|        for (i = 1; i < numLods; ++i)
  ------------------
  |  Branch (3080:21): [True: 306, False: 3.44k]
  ------------------
 3081|    306|        {
 3082|    306|            streamID = readChunk(stream);
 3083|    306|            if (streamID != M_MESH_LOD_USAGE)
  ------------------
  |  Branch (3083:17): [True: 32, False: 274]
  ------------------
 3084|     32|            {
 3085|     32|                OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
 3086|     32|                    "Missing M_MESH_LOD_USAGE stream in " + pMesh->getName(),
 3087|     32|                    "MeshSerializerImpl::readMeshLodInfo");
 3088|     32|            }
 3089|       |            // Read depth
 3090|    274|            MeshLodUsage& usage = pMesh->mMeshLodUsageList[i];
 3091|    274|            readFloats(stream, &(usage.userValue), 1);
 3092|       |
 3093|    274|            if (pMesh->hasManualLodLevel())
  ------------------
  |  Branch (3093:17): [True: 24, False: 250]
  ------------------
 3094|     24|            {
 3095|     24|                readMeshLodUsageManual(stream, pMesh, i, usage);
 3096|     24|            }
 3097|    250|            else //(!pMesh->hasManualLodLevel())
 3098|    250|            {
 3099|    250|                readMeshLodUsageGenerated(stream, pMesh, i, usage);
 3100|    250|            }
 3101|    274|            usage.edgeData = NULL;
 3102|    274|        }
 3103|  3.44k|        popInnerChunk(stream);
 3104|  3.44k|#endif
 3105|  3.44k|    }
OgreMeshSerializerImpl.cpp:_ZN4OgreL23checkChunkRemainingSizeEmmm:
   51|   308k|    {
   52|   308k|        if (itemCount == 0)
  ------------------
  |  Branch (52:13): [True: 26.6k, False: 281k]
  ------------------
   53|  26.6k|            return true;
   54|       |
   55|   281k|        if (chunkSize <= MSTREAM_OVERHEAD_SIZE || itemSize == 0)
  ------------------
  |  Branch (55:13): [True: 563, False: 281k]
  |  Branch (55:51): [True: 0, False: 281k]
  ------------------
   56|    563|            return false;
   57|       |
   58|   281k|        size_t remaining = chunkSize - MSTREAM_OVERHEAD_SIZE;
   59|   281k|        return remaining / itemSize >= itemCount;
   60|   281k|    }

_ZN4Ogre4NodeC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   35|    814|        :mParent(0),
   36|    814|        mName(name),
   37|    814|        mNeedParentUpdate(false),
   38|    814|        mNeedChildUpdate(false),
   39|    814|        mParentNotified(false),
   40|    814|        mQueuedForUpdate(false),
   41|    814|        mInheritOrientation(true),
   42|    814|        mInheritScale(true),
   43|    814|        mCachedTransformOutOfDate(true),
   44|    814|        mOrientation(Quaternion::IDENTITY),
   45|    814|        mPosition(Vector3::ZERO),
   46|    814|        mScale(Vector3::UNIT_SCALE),
   47|    814|        mDerivedOrientation(Quaternion::IDENTITY),
   48|    814|        mDerivedPosition(Vector3::ZERO),
   49|    814|        mDerivedScale(Vector3::UNIT_SCALE),
   50|    814|        mInitialPosition(Vector3::ZERO),
   51|    814|        mInitialOrientation(Quaternion::IDENTITY),
   52|    814|        mInitialScale(Vector3::UNIT_SCALE),
   53|    814|        mListener(0)
   54|    814|    {
   55|    814|        needUpdate();
   56|    814|    }
_ZN4Ogre4NodeD2Ev:
   60|    814|    {
   61|       |        // Call listener (note, only called if there's something to do)
   62|    814|        if (mListener)
  ------------------
  |  Branch (62:13): [True: 0, False: 814]
  ------------------
   63|      0|        {
   64|      0|            mListener->nodeDestroyed(this);
   65|      0|        }
   66|       |
   67|    814|        removeAllChildren();
   68|    814|        if(mParent)
  ------------------
  |  Branch (68:12): [True: 5, False: 809]
  ------------------
   69|      5|            mParent->removeChild(this);
   70|       |
   71|    814|        if (mQueuedForUpdate)
  ------------------
  |  Branch (71:13): [True: 0, False: 814]
  ------------------
   72|      0|        {
   73|       |            // Erase from queued updates
   74|      0|            QueuedUpdates::iterator it =
   75|      0|                std::find(msQueuedUpdates.begin(), msQueuedUpdates.end(), this);
   76|      0|            assert(it != msQueuedUpdates.end());
   77|      0|            if (it != msQueuedUpdates.end())
  ------------------
  |  Branch (77:17): [True: 0, False: 0]
  ------------------
   78|      0|            {
   79|       |                // Optimised algorithm to erase an element from unordered vector.
   80|      0|                *it = msQueuedUpdates.back();
   81|      0|                msQueuedUpdates.pop_back();
   82|      0|            }
   83|      0|        }
   84|       |
   85|    814|    }
_ZN4Ogre4Node9setParentEPS0_:
   89|     20|    {
   90|     20|        bool different = (parent != mParent);
   91|       |
   92|     20|        mParent = parent;
   93|       |        // Request update from parent
   94|     20|        mParentNotified = false ;
   95|     20|        needUpdate();
   96|       |
   97|       |        // Call listener (note, only called if there's something to do)
   98|     20|        if (mListener && different)
  ------------------
  |  Branch (98:13): [True: 0, False: 20]
  |  Branch (98:26): [True: 0, False: 0]
  ------------------
   99|      0|        {
  100|      0|            if (mParent)
  ------------------
  |  Branch (100:17): [True: 0, False: 0]
  ------------------
  101|      0|                mListener->nodeAttached(this);
  102|      0|            else
  103|      0|                mListener->nodeDetached(this);
  104|      0|        }
  105|       |
  106|     20|    }
_ZNK4Ogre4Node17_updateFromParentEv:
  192|    667|    {
  193|    667|        updateFromParentImpl();
  194|       |
  195|       |        // Call listener (note, this method only called if there's something to do)
  196|    667|        if (mListener)
  ------------------
  |  Branch (196:13): [True: 0, False: 667]
  ------------------
  197|      0|        {
  198|      0|            mListener->nodeUpdated(this);
  199|      0|        }
  200|    667|    }
_ZNK4Ogre4Node20updateFromParentImplEv:
  203|    667|    {
  204|    667|        mCachedTransformOutOfDate = true;
  205|       |
  206|    667|        if (mParent)
  ------------------
  |  Branch (206:13): [True: 3, False: 664]
  ------------------
  207|      3|        {
  208|       |#if OGRE_NODE_INHERIT_TRANSFORM
  209|       |            // Decompose full transform to position, orientation and scale, shear is lost here.
  210|       |            _getFullTransform().decomposition(mDerivedPosition, mDerivedScale, mDerivedOrientation);
  211|       |#else
  212|       |            // Update orientation
  213|      3|            const Quaternion& parentOrientation = mParent->_getDerivedOrientation();
  214|      3|            if (mInheritOrientation)
  ------------------
  |  Branch (214:17): [True: 3, False: 0]
  ------------------
  215|      3|            {
  216|       |                // Combine orientation with that of parent
  217|      3|                mDerivedOrientation = parentOrientation * mOrientation;
  218|      3|            }
  219|      0|            else
  220|      0|            {
  221|       |                // No inheritance
  222|      0|                mDerivedOrientation = mOrientation;
  223|      0|            }
  224|       |
  225|       |            // Update scale
  226|      3|            const Vector3& parentScale = mParent->_getDerivedScale();
  227|      3|            if (mInheritScale)
  ------------------
  |  Branch (227:17): [True: 3, False: 0]
  ------------------
  228|      3|            {
  229|       |                // Scale own position by parent scale, NB just combine
  230|       |                // as equivalent axes, no shearing
  231|      3|                mDerivedScale = parentScale * mScale;
  232|      3|            }
  233|      0|            else
  234|      0|            {
  235|       |                // No inheritance
  236|      0|                mDerivedScale = mScale;
  237|      0|            }
  238|       |
  239|       |            // Change position vector based on parent's orientation & scale
  240|      3|            mDerivedPosition = parentOrientation * (parentScale * mPosition);
  241|       |
  242|       |            // Add altered position vector to parents
  243|      3|            mDerivedPosition += mParent->_getDerivedPosition();
  244|      3|#endif
  245|      3|        }
  246|    664|        else
  247|    664|        {
  248|       |            // Root node, no parent
  249|    664|            mDerivedOrientation = mOrientation;
  250|    664|            mDerivedPosition = mPosition;
  251|    664|            mDerivedScale = mScale;
  252|    664|        }
  253|       |
  254|    667|        mNeedParentUpdate = false;
  255|       |
  256|    667|    }
_ZN4Ogre4Node8addChildEPS0_:
  280|     13|    {
  281|     13|        if (child->mParent)
  ------------------
  |  Branch (281:13): [True: 3, False: 10]
  ------------------
  282|      3|        {
  283|      3|            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
  284|      3|                        "Node '" + child->getName() + "' already is a child of '" + child->mParent->getName() + "'");
  285|      3|        }
  286|       |
  287|     10|        mChildren.push_back(child);
  288|     10|        child->setParent(this);
  289|       |
  290|     10|    }
_ZN4Ogre4Node11removeChildEPS0_:
  320|      5|    {
  321|      5|        if (child)
  ------------------
  |  Branch (321:13): [True: 5, False: 0]
  ------------------
  322|      5|        {
  323|      5|            ChildNodeMap::iterator i = std::find(mChildren.begin(), mChildren.end(), child);
  324|      5|            if(i != mChildren.end() && *i == child)
  ------------------
  |  Branch (324:16): [True: 5, False: 0]
  |  Branch (324:16): [True: 5, False: 0]
  |  Branch (324:40): [True: 5, False: 0]
  ------------------
  325|      5|            {
  326|       |                // cancel any pending update
  327|      5|                cancelUpdate(child);
  328|       |
  329|      5|                std::swap(*i, mChildren.back());
  330|      5|                mChildren.pop_back();
  331|       |                child->setParent(NULL);
  332|      5|            }
  333|      5|        }
  334|      5|        return child;
  335|      5|    }
_ZN4Ogre4Node14setOrientationERKNS_10QuaternionE:
  339|    814|    {
  340|    814|#ifndef OGRE_FAST_MATH
  341|    814|        OgreAssertDbg(!q.isNaN(), "Invalid orientation supplied as parameter");
  342|    814|#endif
  343|    814|        mOrientation = q;
  344|    814|        mOrientation.normalise();
  345|    814|        needUpdate();
  346|    814|    }
_ZN4Ogre4Node11setPositionERKNS_6VectorILi3EfEE:
  361|    814|    {
  362|    814|#ifndef OGRE_FAST_MATH
  363|       |        assert(!pos.isNaN() && "Invalid vector supplied as parameter");
  364|    814|#endif
  365|    814|        mPosition = pos;
  366|    814|        needUpdate();
  367|    814|    }
_ZNK4Ogre4Node22_getDerivedOrientationEv:
  452|    670|    {
  453|    670|        if (mNeedParentUpdate)
  ------------------
  |  Branch (453:13): [True: 1, False: 669]
  ------------------
  454|      1|        {
  455|      1|            _updateFromParent();
  456|      1|        }
  457|    670|        return mDerivedOrientation;
  458|    670|    }
_ZNK4Ogre4Node19_getDerivedPositionEv:
  461|    670|    {
  462|    670|        if (mNeedParentUpdate)
  ------------------
  |  Branch (462:13): [True: 666, False: 4]
  ------------------
  463|    666|        {
  464|    666|            _updateFromParent();
  465|    666|        }
  466|    670|        return mDerivedPosition;
  467|    670|    }
_ZNK4Ogre4Node16_getDerivedScaleEv:
  470|    670|    {
  471|    670|        if (mNeedParentUpdate)
  ------------------
  |  Branch (471:13): [True: 0, False: 670]
  ------------------
  472|      0|        {
  473|      0|            _updateFromParent();
  474|      0|        }
  475|    670|        return mDerivedScale;
  476|    670|    }
_ZN4Ogre4Node17removeAllChildrenEv:
  546|    814|    {
  547|    814|        for (auto *c : mChildren)
  ------------------
  |  Branch (547:22): [True: 5, False: 814]
  ------------------
  548|      5|        {
  549|      5|            c->setParent(0);
  550|      5|        }
  551|    814|        mChildren.clear();
  552|    814|        mChildrenToUpdate.clear();
  553|    814|    }
_ZN4Ogre4Node8setScaleERKNS_6VectorILi3EfEE:
  563|     23|    {
  564|     23|#ifndef OGRE_FAST_MATH
  565|       |        assert(!inScale.isNaN() && "Invalid vector supplied as parameter");
  566|     23|#endif
  567|     23|        mScale = inScale;
  568|     23|        needUpdate();
  569|     23|    }
_ZN4Ogre4Node15setInitialStateEv:
  600|    667|    {
  601|    667|        mInitialPosition = mPosition;
  602|    667|        mInitialOrientation = mOrientation;
  603|    667|        mInitialScale = mScale;
  604|    667|    }
_ZN4Ogre4Node10needUpdateEb:
  680|  2.48k|    {
  681|       |
  682|  2.48k|        mNeedParentUpdate = true;
  683|  2.48k|        mNeedChildUpdate = true;
  684|  2.48k|        mCachedTransformOutOfDate = true;
  685|       |
  686|       |        // Make sure we're not root and parent hasn't been notified before
  687|  2.48k|        if (mParent && (!mParentNotified || forceParentUpdate))
  ------------------
  |  Branch (687:13): [True: 10, False: 2.47k]
  |  Branch (687:25): [True: 10, False: 0]
  |  Branch (687:45): [True: 0, False: 0]
  ------------------
  688|     10|        {
  689|     10|            mParent->requestUpdate(this, forceParentUpdate);
  690|     10|            mParentNotified = true ;
  691|     10|        }
  692|       |
  693|       |        // all children will be updated
  694|  2.48k|        mChildrenToUpdate.clear();
  695|  2.48k|    }
_ZN4Ogre4Node13requestUpdateEPS0_b:
  698|     10|    {
  699|       |        // If we're already going to update everything this doesn't matter
  700|     10|        if (mNeedChildUpdate)
  ------------------
  |  Branch (700:13): [True: 10, False: 0]
  ------------------
  701|     10|        {
  702|     10|            return;
  703|     10|        }
  704|       |
  705|      0|        mChildrenToUpdate.push_back(child);
  706|       |        // Request selective update of me, if we didn't do it before
  707|      0|        if (mParent && (!mParentNotified || forceParentUpdate))
  ------------------
  |  Branch (707:13): [True: 0, False: 0]
  |  Branch (707:25): [True: 0, False: 0]
  |  Branch (707:45): [True: 0, False: 0]
  ------------------
  708|      0|        {
  709|      0|            mParent->requestUpdate(this, forceParentUpdate);
  710|      0|            mParentNotified = true ;
  711|      0|        }
  712|       |
  713|      0|    }
_ZN4Ogre4Node12cancelUpdateEPS0_:
  716|      5|    {
  717|      5|        mChildrenToUpdate.erase(std::remove(mChildrenToUpdate.begin(), mChildrenToUpdate.end(), child),
  718|      5|                                mChildrenToUpdate.end());
  719|       |
  720|       |        // Propagate this up if we're done
  721|      5|        if (mChildrenToUpdate.empty() && mParent && !mNeedChildUpdate)
  ------------------
  |  Branch (721:13): [True: 5, False: 0]
  |  Branch (721:42): [True: 0, False: 5]
  |  Branch (721:53): [True: 0, False: 0]
  ------------------
  722|      0|        {
  723|      0|            mParent->cancelUpdate(this);
  724|      0|            mParentNotified = false ;
  725|      0|        }
  726|      5|    }

_ZN4Ogre13OptimisedUtil21_detectImplementationEv:
  326|      2|    {
  327|       |        //
  328|       |        // Some speed test results (averaged number of CPU timestamp (RDTSC) per-function call):
  329|       |        //
  330|       |        //   Dagon SkeletonAnimation sample - softwareVertexSkinning:
  331|       |        //
  332|       |        //                                      Pentium 4 3.0G HT       Athlon XP 2500+     Athlon 64 X2 Dual Core 3800+
  333|       |        //
  334|       |        //      Shared Buffers, General C       763677                  462903              473038
  335|       |        //      Shared Buffers, Unrolled SSE    210030 *best*           369762              228328 *best*
  336|       |        //      Shared Buffers, General SSE     286202                  352412 *best*       302796
  337|       |        //
  338|       |        //      Separated Buffers, General C    762640                  464840              478740
  339|       |        //      Separated Buffers, Unrolled SSE 219222 *best*           287992 *best*       238770 *best*
  340|       |        //      Separated Buffers, General SSE  290129                  341614              307262
  341|       |        //
  342|       |        //      PosOnly, General C              388663                  257350              262831
  343|       |        //      PosOnly, Unrolled SSE           139814 *best*           200323 *best*       168995 *best*
  344|       |        //      PosOnly, General SSE            172693                  213704              175447
  345|       |        //
  346|       |        //   Another my own test scene - softwareVertexSkinning:
  347|       |        //
  348|       |        //                                      Pentium P4 3.0G HT      Athlon XP 2500+
  349|       |        //
  350|       |        //      Shared Buffers, General C       74527                   -
  351|       |        //      Shared Buffers, Unrolled SSE    22743 *best*            -
  352|       |        //      Shared Buffers, General SSE     28527                   -
  353|       |        //
  354|       |        //
  355|       |        // Note that speed test appears unaligned load/store instruction version
  356|       |        // loss performance 5%-10% than aligned load/store version, even if both
  357|       |        // of them access to aligned data. Thus, we should use aligned load/store
  358|       |        // as soon as possible.
  359|       |        //
  360|       |        //
  361|       |        // We are pick up the implementation based on test results above.
  362|       |        //
  363|       |#ifdef __DO_PROFILE__
  364|       |        {
  365|       |            static OptimisedUtilProfiler msOptimisedUtilProfiler;
  366|       |            return &msOptimisedUtilProfiler;
  367|       |        }
  368|       |
  369|       |#else   // !__DO_PROFILE__
  370|       |
  371|      2|#if __OGRE_HAVE_SSE
  372|      2|        if (PlatformInformation::getCpuFeatures() & PlatformInformation::CPU_FEATURE_SSE)
  ------------------
  |  Branch (372:13): [True: 2, False: 0]
  ------------------
  373|      2|        {
  374|      2|            return _getOptimisedUtilSSE();
  375|      2|        }
  376|      0|        else
  377|       |#elif __OGRE_HAVE_NEON
  378|       |        if (PlatformInformation::getCpuFeatures() & PlatformInformation::CPU_FEATURE_NEON)
  379|       |        {
  380|       |            return _getOptimisedUtilSSE();
  381|       |        }
  382|       |        else
  383|       |#endif  // __OGRE_HAVE_SSE
  384|      0|        {
  385|      0|            return _getOptimisedUtilGeneral();
  386|      0|        }
  387|       |
  388|      2|#endif  // __DO_PROFILE__
  389|      2|    }

_ZN4Ogre16OptimisedUtilSSEC2Ev:
 1040|      2|        : mPreferGeneralVersionForSharedBuffers(false)
 1041|      2|    {
 1042|       |        // For AMD Athlon XP (but not that for Althon 64), it's prefer to never use
 1043|       |        // unrolled version for shared buffers at all, I guess because that version
 1044|       |        // run out of usable CPU registers, or L1/L2 cache related problem, causing
 1045|       |        // slight performance loss than general version.
 1046|       |        //
 1047|      2|#if __OGRE_HAVE_NEON == 0
 1048|      2|        if (PlatformInformation::getCpuIdentifier().find("AuthenticAMD") != String::npos)
  ------------------
  |  Branch (1048:13): [True: 0, False: 2]
  ------------------
 1049|      0|        {
 1050|       |            // How can I check it's an Athlon XP but not Althon 64?
 1051|       |            // Ok, just test whether supports SSE2/SSE3 or not, if not,
 1052|       |            // assume general version faster than unrolled version :)
 1053|       |            //
 1054|      0|            if (!(PlatformInformation::getCpuFeatures() &
  ------------------
  |  Branch (1054:17): [True: 0, False: 0]
  ------------------
 1055|      0|                (PlatformInformation::CPU_FEATURE_SSE2 | PlatformInformation::CPU_FEATURE_SSE3)))
 1056|      0|            {
 1057|      0|                mPreferGeneralVersionForSharedBuffers = true;
 1058|      0|            }
 1059|      0|        }
 1060|      2|#endif
 1061|      2|    }
_ZN4Ogre20_getOptimisedUtilSSEEv:
 2141|      2|    {
 2142|      2|        static OptimisedUtilSSE msOptimisedUtilSSE;
 2143|       |#if defined(__OGRE_SIMD_ALIGN_STACK)
 2144|       |        static OptimisedUtilWithStackAlign msOptimisedUtilWithStackAlign(&msOptimisedUtilSSE);
 2145|       |        return &msOptimisedUtilWithStackAlign;
 2146|       |#else
 2147|      2|        return &msOptimisedUtilSSE;
 2148|      2|#endif
 2149|      2|    }

_ZN4Ogre4PassC2EPNS_9TechniqueEt:
  122|      1|        : mParent(parent)
  123|      1|        , mHash(0)
  124|      1|        , mAmbient(ColourValue::White)
  125|      1|        , mDiffuse(ColourValue::White)
  126|      1|        , mSpecular(ColourValue::Black)
  127|      1|        , mEmissive(ColourValue::Black)
  128|      1|        , mShininess(0)
  129|      1|        , mTracking(TVC_NONE)
  130|      1|        , mHashDirtyQueued(false)
  131|      1|        , mDepthCheck(true)
  132|      1|        , mDepthWrite(true)
  133|      1|        , mAlphaToCoverageEnabled(false)
  134|      1|        , mTransparentSorting(true)
  135|      1|        , mTransparentSortingForced(false)
  136|      1|        , mLightingEnabled(true)
  137|      1|        , mIteratePerLight(false)
  138|      1|        , mRunOnlyForOneLightType(false)
  139|      1|        , mPolygonModeOverrideable(true)
  140|      1|        , mFogOverride(false)
  141|      1|        , mQueuedForDeletion(false)
  142|      1|        , mLightScissoring(false)
  143|      1|        , mLightClipPlanes(false)
  144|      1|        , mPointSpritesEnabled(false)
  145|      1|        , mPointAttenuationEnabled(false)
  146|      1|        , mContentTypeLookupBuilt(false)
  147|      1|        , mAlphaRejectVal(0)
  148|      1|        , mDepthBiasConstant(0.0f)
  149|      1|        , mDepthBiasSlopeScale(0.0f)
  150|      1|        , mDepthBiasPerIteration(0.0f)
  151|      1|        , mDepthFunc(CMPF_LESS_EQUAL)
  152|      1|        , mAlphaRejectFunc(CMPF_ALWAYS_PASS)
  153|      1|        , mCullMode(CULL_CLOCKWISE)
  154|      1|        , mManualCullMode(MANUAL_CULL_BACK)
  155|      1|        , mMaxSimultaneousLights(OGRE_MAX_SIMULTANEOUS_LIGHTS)
  156|      1|        , mStartLight(0)
  157|      1|        , mLightsPerIteration(1)
  158|      1|        , mIndex(index)
  159|      1|        , mLightMask(0xFFFFFFFF)
  160|      1|        , mFogColour(ColourValue::White)
  161|      1|        , mFogStart(0.0)
  162|      1|        , mFogEnd(1.0)
  163|      1|        , mFogDensity(0.001)
  164|      1|        , mLineWidth(1.0f)
  165|      1|        , mPassIterationCount(1)
  166|      1|        , mPointMinSize(0.0f)
  167|      1|        , mPointMaxSize(0.0f)
  168|      1|        , mPointAttenution(1.0f, 1.0f, 0.0f, 0.0f)
  169|      1|        , mShadeOptions(SO_GOURAUD)
  170|      1|        , mPolygonMode(PM_SOLID)
  171|      1|        , mIlluminationStage(IS_UNKNOWN)
  172|      1|        , mOnlyLightType(Light::LT_POINT)
  173|      1|        , mFogMode(FOG_NONE)
  174|      1|    {
  175|       |        // init the hash inline
  176|      1|        _recalculateHash();
  177|      1|   }
_ZN4Ogre4PassC2EPNS_9TechniqueEtRKS0_:
  181|      2|        : mParent(parent), mQueuedForDeletion(false), mIndex(index), mPassIterationCount(1)
  182|      2|    {
  183|      2|        *this = oth;
  184|      2|        mParent = parent;
  185|      2|        mIndex = index;
  186|      2|        mQueuedForDeletion = false;
  187|       |
  188|       |        // init the hash inline
  189|      2|        _recalculateHash();
  190|      2|    }
_ZN4Ogre4PassaSERKS0_:
  194|      2|    {
  195|      2|        mName = oth.mName;
  196|      2|        mHash = oth.mHash;
  197|      2|        mAmbient = oth.mAmbient;
  198|      2|        mDiffuse = oth.mDiffuse;
  199|      2|        mSpecular = oth.mSpecular;
  200|      2|        mEmissive = oth.mEmissive;
  201|      2|        mShininess = oth.mShininess;
  202|      2|        mTracking = oth.mTracking;
  203|       |
  204|       |        // Copy fog parameters
  205|      2|        mFogOverride = oth.mFogOverride;
  206|      2|        mFogMode = oth.mFogMode;
  207|      2|        mFogColour = oth.mFogColour;
  208|      2|        mFogStart = oth.mFogStart;
  209|      2|        mFogEnd = oth.mFogEnd;
  210|      2|        mFogDensity = oth.mFogDensity;
  211|       |
  212|       |        // Default blending (overwrite)
  213|      2|        mBlendState = oth.mBlendState;
  214|       |
  215|      2|        mDepthCheck = oth.mDepthCheck;
  216|      2|        mDepthWrite = oth.mDepthWrite;
  217|      2|        mAlphaRejectFunc = oth.mAlphaRejectFunc;
  218|      2|        mAlphaRejectVal = oth.mAlphaRejectVal;
  219|      2|        mAlphaToCoverageEnabled = oth.mAlphaToCoverageEnabled;
  220|      2|        mTransparentSorting = oth.mTransparentSorting;
  221|      2|        mTransparentSortingForced = oth.mTransparentSortingForced;
  222|      2|        mDepthFunc = oth.mDepthFunc;
  223|      2|        mDepthBiasConstant = oth.mDepthBiasConstant;
  224|      2|        mDepthBiasSlopeScale = oth.mDepthBiasSlopeScale;
  225|      2|        mDepthBiasPerIteration = oth.mDepthBiasPerIteration;
  226|      2|        mCullMode = oth.mCullMode;
  227|      2|        mManualCullMode = oth.mManualCullMode;
  228|      2|        mLightingEnabled = oth.mLightingEnabled;
  229|      2|        mMaxSimultaneousLights = oth.mMaxSimultaneousLights;
  230|      2|        mStartLight = oth.mStartLight;
  231|      2|        mIteratePerLight = oth.mIteratePerLight;
  232|      2|        mLightsPerIteration = oth.mLightsPerIteration;
  233|      2|        mRunOnlyForOneLightType = oth.mRunOnlyForOneLightType;
  234|      2|        mOnlyLightType = oth.mOnlyLightType;
  235|      2|        mShadeOptions = oth.mShadeOptions;
  236|      2|        mPolygonMode = oth.mPolygonMode;
  237|      2|        mPolygonModeOverrideable = oth.mPolygonModeOverrideable;
  238|      2|        mPassIterationCount = oth.mPassIterationCount;
  239|      2|        mLineWidth = oth.mLineWidth;
  240|      2|        mPointAttenution = oth.mPointAttenution;
  241|      2|        mPointMinSize = oth.mPointMinSize;
  242|      2|        mPointMaxSize = oth.mPointMaxSize;
  243|      2|        mPointSpritesEnabled = oth.mPointSpritesEnabled;
  244|      2|        mPointAttenuationEnabled = oth.mPointAttenuationEnabled;
  245|      2|        mShadowContentTypeLookup = oth.mShadowContentTypeLookup;
  246|      2|        mContentTypeLookupBuilt = oth.mContentTypeLookupBuilt;
  247|      2|        mLightScissoring = oth.mLightScissoring;
  248|      2|        mLightClipPlanes = oth.mLightClipPlanes;
  249|      2|        mIlluminationStage = oth.mIlluminationStage;
  250|      2|        mLightMask = oth.mLightMask;
  251|       |
  252|     12|        for(int i = 0; i < GPT_PIPELINE_COUNT; i++)
  ------------------
  |  Branch (252:24): [True: 10, False: 2]
  ------------------
  253|     10|        {
  254|     10|            auto& programUsage = mProgramUsage[i];
  255|     10|            auto& othUsage = oth.mProgramUsage[i];
  256|     10|            programUsage = othUsage ? std::make_unique<GpuProgramUsage>(*othUsage, this) : nullptr;
  ------------------
  |  Branch (256:28): [True: 0, False: 10]
  ------------------
  257|     10|        }
  258|       |
  259|       |        // Clear texture units but doesn't notify need recompilation in the case
  260|       |        // we are cloning, The parent material will take care of this.
  261|      2|        for (auto *t : mTextureUnitStates)
  ------------------
  |  Branch (261:22): [True: 0, False: 2]
  ------------------
  262|      0|        {
  263|      0|            OGRE_DELETE t;
  264|      0|        }
  265|       |
  266|      2|        mTextureUnitStates.clear();
  267|       |
  268|       |        // Copy texture units
  269|      2|        for (auto *s : oth.mTextureUnitStates)
  ------------------
  |  Branch (269:22): [True: 0, False: 2]
  ------------------
  270|      0|        {
  271|      0|            TextureUnitState* t = OGRE_NEW TextureUnitState(this, *s);
  272|      0|            mTextureUnitStates.push_back(t);
  273|      0|        }
  274|       |
  275|      2|        _dirtyHash();
  276|       |
  277|      2|        return *this;
  278|      2|    }
_ZNK4Ogre4Pass15getProgramUsageENS_14GpuProgramTypeE:
  825|     24|    {
  826|     24|        static std::unique_ptr<GpuProgramUsage> nullUsage;
  827|     24|        auto& ret = mProgramUsage[programType % GPT_PIPELINE_COUNT];
  828|     24|        return ret && ret->getType() == programType ? ret : nullUsage;
  ------------------
  |  Branch (828:16): [True: 0, False: 24]
  |  Branch (828:23): [True: 0, False: 0]
  ------------------
  829|     24|    }
_ZNK4Ogre4Pass17getGpuProgramNameENS_14GpuProgramTypeE:
  843|     24|    {
  844|     24|        OGRE_LOCK_MUTEX(mGpuProgramChangeMutex);
  845|       |
  846|     24|        const std::unique_ptr<GpuProgramUsage>& programUsage = getProgramUsage(type);
  847|     24|        if (!programUsage)
  ------------------
  |  Branch (847:13): [True: 24, False: 0]
  ------------------
  848|     24|            return BLANKSTRING;
  849|      0|        else
  850|      0|            return programUsage->getProgramName();
  851|     24|    }
_ZN4Ogre4Pass16_recalculateHashEv:
  859|      3|    {
  860|       |        /* Hash format is 32-bit, divided as follows (high to low bits)
  861|       |           bits   purpose
  862|       |            4     Pass index (i.e. max 16 passes!)
  863|       |           28     Pass contents
  864|       |       */
  865|      3|        mHash = (*msHashFunc)(this);
  866|       |
  867|       |        // overwrite the 4 upper bits with pass index
  868|      3|        mHash = (uint32(mIndex) << 28) | (mHash >> 4);
  869|      3|    }
_ZN4Ogre4Pass10_dirtyHashEv:
  872|      2|    {
  873|      2|        if (mQueuedForDeletion)
  ------------------
  |  Branch (873:13): [True: 0, False: 2]
  ------------------
  874|      0|            return;
  875|       |
  876|      2|        Material* mat = mParent->getParent();
  877|      2|        if (mat->isLoading() || mat->isLoaded())
  ------------------
  |  Branch (877:13): [True: 0, False: 2]
  |  Branch (877:33): [True: 0, False: 2]
  ------------------
  878|      0|        {
  879|      0|            OGRE_LOCK_MUTEX(msDirtyHashListMutex);
  880|       |            // Mark this hash as for follow up
  881|      0|            msDirtyHashList.insert(this);
  882|      0|            mHashDirtyQueued = false;
  883|      0|        }
  884|      2|        else
  885|      2|        {
  886|      2|            mHashDirtyQueued = true;
  887|      2|        }
  888|      2|    }
_ZNK4Ogre27MinGpuProgramChangeHashFuncclEPKNS_4PassE:
   67|      3|        {
   68|      3|            OGRE_LOCK_MUTEX(p->mGpuProgramChangeMutex);
   69|      3|            uint32 hash = 0;
   70|       |
   71|     27|            for(int i = 0; i < GPT_COUNT; i++)
  ------------------
  |  Branch (71:28): [True: 24, False: 3]
  ------------------
   72|     24|            {
   73|     24|                const String& name = p->getGpuProgramName(GpuProgramType(i));
   74|     24|                if(!name.empty()) {
  ------------------
  |  Branch (74:20): [True: 0, False: 24]
  ------------------
   75|      0|                    hash = FastHash(name.c_str(), name.size(), hash);
   76|      0|                }
   77|     24|            }
   78|       |
   79|      3|            return hash;
   80|      3|        }

_ZN4Ogre25PixelCountLodStrategyBaseC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   37|      2|        : LodStrategy(name)
   38|      2|    { }
_ZNK4Ogre25PixelCountLodStrategyBase12getBaseValueEv:
   41|    311|    {
   42|       |        // Use the maximum possible value as base
   43|    311|        return std::numeric_limits<Real>::max();
   44|    311|    }
_ZN4Ogre29AbsolutePixelCountLodStrategyC2Ev:
   92|      1|        : PixelCountLodStrategyBase("pixel_count")
   93|      1|    { }
_ZN4Ogre32ScreenRatioPixelCountLodStrategyC2Ev:
  172|      1|        : PixelCountLodStrategyBase("screen_ratio_pixel_count")
  173|      1|    { }

_ZN4Ogre19PlatformInformation16getCpuIdentifierEv:
  655|      2|    {
  656|      2|        static const String sIdentifier = _detectCpuIdentifier();
  657|      2|        return sIdentifier;
  658|      2|    }
_ZN4Ogre19PlatformInformation14getCpuFeaturesEv:
  661|      2|    {
  662|      2|        static const uint sFeatures = _detectCpuFeatures();
  663|      2|        return sFeatures;
  664|      2|    }
OgrePlatformInformation.cpp:_ZN4OgreL20_detectCpuIdentifierEv:
  427|      2|    {
  428|       |        // Supports CPUID instruction ?
  429|      2|        if (_isSupportCpuid())
  ------------------
  |  Branch (429:13): [True: 2, False: 0]
  ------------------
  430|      2|        {
  431|      2|            CpuidResult result;
  432|      2|            uint nExIds;
  433|      2|            char CPUString[0x20];
  434|      2|            char CPUBrandString[0x40];
  435|       |
  436|      2|            StringStream detailedIdentStr;
  437|       |
  438|       |
  439|       |            // Has standard feature ?
  440|      2|            if (_performCpuid(0, result))
  ------------------
  |  Branch (440:17): [True: 2, False: 0]
  ------------------
  441|      2|            {
  442|      2|                memset(CPUString, 0, sizeof(CPUString));
  443|      2|                memset(CPUBrandString, 0, sizeof(CPUBrandString));
  444|       |
  445|       |                //*((int*)CPUString) = result._ebx;
  446|       |                //*((int*)(CPUString+4)) = result._edx;
  447|       |                //*((int*)(CPUString+8)) = result._ecx;
  448|      2|                memcpy(CPUString, &result._ebx, sizeof(int));
  449|      2|                memcpy(CPUString+4, &result._edx, sizeof(int));
  450|      2|                memcpy(CPUString+8, &result._ecx, sizeof(int));
  451|       |
  452|      2|                detailedIdentStr << CPUString;
  453|       |
  454|       |                // Calling _performCpuid with 0x80000000 as the query argument
  455|       |                // gets the number of valid extended IDs.
  456|      2|                nExIds = _performCpuid(0x80000000, result);
  457|       |
  458|     20|                for (uint i=0x80000000; i<=nExIds; ++i)
  ------------------
  |  Branch (458:41): [True: 18, False: 2]
  ------------------
  459|     18|                {
  460|     18|                    _performCpuid(i, result);
  461|       |
  462|       |                    // Interpret CPU brand string and cache information.
  463|     18|                    if  (i == 0x80000002)
  ------------------
  |  Branch (463:26): [True: 2, False: 16]
  ------------------
  464|      2|                    {
  465|      2|                        memcpy(CPUBrandString + 0, &result._eax, sizeof(result._eax));
  466|      2|                        memcpy(CPUBrandString + 4, &result._ebx, sizeof(result._ebx));
  467|      2|                        memcpy(CPUBrandString + 8, &result._ecx, sizeof(result._ecx));
  468|      2|                        memcpy(CPUBrandString + 12, &result._edx, sizeof(result._edx));
  469|      2|                    }
  470|     16|                    else if  (i == 0x80000003)
  ------------------
  |  Branch (470:31): [True: 2, False: 14]
  ------------------
  471|      2|                    {
  472|      2|                        memcpy(CPUBrandString + 16 + 0, &result._eax, sizeof(result._eax));
  473|      2|                        memcpy(CPUBrandString + 16 + 4, &result._ebx, sizeof(result._ebx));
  474|      2|                        memcpy(CPUBrandString + 16 + 8, &result._ecx, sizeof(result._ecx));
  475|      2|                        memcpy(CPUBrandString + 16 + 12, &result._edx, sizeof(result._edx));
  476|      2|                    }
  477|     14|                    else if  (i == 0x80000004)
  ------------------
  |  Branch (477:31): [True: 2, False: 12]
  ------------------
  478|      2|                    {
  479|      2|                        memcpy(CPUBrandString + 32 + 0, &result._eax, sizeof(result._eax));
  480|      2|                        memcpy(CPUBrandString + 32 + 4, &result._ebx, sizeof(result._ebx));
  481|      2|                        memcpy(CPUBrandString + 32 + 8, &result._ecx, sizeof(result._ecx));
  482|      2|                        memcpy(CPUBrandString + 32 + 12, &result._edx, sizeof(result._edx));
  483|      2|                    }
  484|     18|                }
  485|       |
  486|      2|                String brand(CPUBrandString);
  487|      2|                StringUtil::trim(brand);
  488|      2|                if (!brand.empty())
  ------------------
  |  Branch (488:21): [True: 2, False: 0]
  ------------------
  489|      2|                    detailedIdentStr << ": " << brand;
  490|       |
  491|      2|                return detailedIdentStr.str();
  492|      2|            }
  493|      2|        }
  494|       |
  495|      0|        return "X86";
  496|      2|    }
OgrePlatformInformation.cpp:_ZN4OgreL13_performCpuidEiRNS_11CpuidResultE:
  151|     30|    {
  152|       |#if OGRE_COMPILER == OGRE_COMPILER_MSVC
  153|       |        int CPUInfo[4];
  154|       |        __cpuid(CPUInfo, query);
  155|       |        result._eax = CPUInfo[0];
  156|       |        result._ebx = CPUInfo[1];
  157|       |        result._ecx = CPUInfo[2];
  158|       |        result._edx = CPUInfo[3];
  159|       |        return result._eax;
  160|       |#elif (OGRE_COMPILER == OGRE_COMPILER_GNUC || OGRE_COMPILER == OGRE_COMPILER_CLANG) && OGRE_PLATFORM != OGRE_PLATFORM_EMSCRIPTEN
  161|       |        #if OGRE_ARCH_TYPE == OGRE_ARCHITECTURE_64
  162|     30|        __asm__
  163|     30|        (
  164|     30|            "cpuid": "=a" (result._eax), "=b" (result._ebx), "=c" (result._ecx), "=d" (result._edx) : "a" (query)
  165|     30|        );
  166|       |        #else
  167|       |        __asm__
  168|       |        (
  169|       |            "pushl  %%ebx           \n\t"
  170|       |            "cpuid                  \n\t"
  171|       |            "movl   %%ebx, %%edi    \n\t"
  172|       |            "popl   %%ebx           \n\t"
  173|       |            : "=a" (result._eax), "=D" (result._ebx), "=c" (result._ecx), "=d" (result._edx)
  174|       |            : "a" (query)
  175|       |        );
  176|       |       #endif // OGRE_ARCHITECTURE_64
  177|     30|        return result._eax;
  178|       |
  179|       |#else
  180|       |        // TODO: Supports other compiler
  181|       |        return 0;
  182|       |#endif
  183|     30|    }
OgrePlatformInformation.cpp:_ZN4OgreL18_detectCpuFeaturesEv:
  408|      2|    {
  409|      2|        uint features = queryCpuFeatures();
  410|       |
  411|      2|        const uint sse_features = 0
  412|      2|            | PlatformInformation::CPU_FEATURE_SSE
  413|      2|            | PlatformInformation::CPU_FEATURE_SSE2
  414|      2|            | PlatformInformation::CPU_FEATURE_SSE3
  415|      2|            | PlatformInformation::CPU_FEATURE_SSE41
  416|      2|            | PlatformInformation::CPU_FEATURE_SSE42;
  417|       |
  418|      2|        if ((features & sse_features) && !_checkOperatingSystemSupportSSE())
  ------------------
  |  Branch (418:13): [True: 2, False: 0]
  |  Branch (418:42): [True: 0, False: 2]
  ------------------
  419|      0|        {
  420|      0|            features &= ~sse_features;
  421|      0|        }
  422|       |
  423|      2|        return features;
  424|      2|    }
OgrePlatformInformation.cpp:_ZN4OgreL16queryCpuFeaturesEv:
  266|      2|    {
  267|       |
  268|      2|#define CPUID_FUNC_VENDOR_ID                 0x0
  269|      2|#define CPUID_FUNC_STANDARD_FEATURES         0x1
  270|      2|#define CPUID_FUNC_EXTENSION_QUERY           0x80000000
  271|      2|#define CPUID_FUNC_EXTENDED_FEATURES         0x80000001
  272|      2|#define CPUID_FUNC_ADVANCED_POWER_MANAGEMENT 0x80000007
  273|       |
  274|      2|#define CPUID_STD_FPU               (1<<0)
  275|      2|#define CPUID_STD_TSC               (1<<4)
  276|      2|#define CPUID_STD_CMOV              (1<<15)
  277|      2|#define CPUID_STD_MMX               (1<<23)
  278|      2|#define CPUID_STD_SSE               (1<<25)
  279|      2|#define CPUID_STD_SSE2              (1<<26)
  280|      2|#define CPUID_STD_HTT               (1<<28)     // EDX[28] - Bit 28 set indicates  Hyper-Threading Technology is supported in hardware.
  281|       |
  282|      2|#define CPUID_STD_SSE3              (1<<0)      // ECX[0]  - Bit 0 of standard function 1 indicate SSE3 supported
  283|      2|#define CPUID_STD_SSE41             (1<<19)     // ECX[19] - Bit 0 of standard function 1 indicate SSE41 supported
  284|      2|#define CPUID_STD_SSE42             (1<<20)     // ECX[20] - Bit 0 of standard function 1 indicate SSE42 supported
  285|       |
  286|      2|#define CPUID_FAMILY_ID_MASK        0x0F00      // EAX[11:8] - Bit 11 thru 8 contains family  processor id
  287|      2|#define CPUID_EXT_FAMILY_ID_MASK    0x0F00000   // EAX[23:20] - Bit 23 thru 20 contains extended family processor id
  288|      2|#define CPUID_PENTIUM4_ID           0x0F00      // Pentium 4 family processor id
  289|       |
  290|      2|#define CPUID_EXT_3DNOW             (1<<31)
  291|      2|#define CPUID_EXT_AMD_3DNOWEXT      (1<<30)
  292|      2|#define CPUID_EXT_AMD_MMXEXT        (1<<22)
  293|       |
  294|       |
  295|      2|#define CPUID_APM_INVARIANT_TSC     (1<<8)      // EDX[8] - Bit 8 of function 0x80000007 indicates support for invariant TSC.
  296|       |
  297|      2|        uint features = 0;
  298|       |
  299|       |        // Supports CPUID instruction ?
  300|      2|        if (_isSupportCpuid())
  ------------------
  |  Branch (300:13): [True: 2, False: 0]
  ------------------
  301|      2|        {
  302|      2|            CpuidResult result;
  303|       |
  304|       |            // Has standard feature ?
  305|      2|            if (_performCpuid(CPUID_FUNC_VENDOR_ID, result))
  ------------------
  |  |  268|      2|#define CPUID_FUNC_VENDOR_ID                 0x0
  ------------------
  |  Branch (305:17): [True: 2, False: 0]
  ------------------
  306|      2|            {
  307|       |                // Check vendor strings
  308|      2|                if (memcmp(&result._ebx, "GenuineIntel", 12) == 0)
  ------------------
  |  Branch (308:21): [True: 2, False: 0]
  ------------------
  309|      2|                {
  310|      2|                    if (result._eax > 2)
  ------------------
  |  Branch (310:25): [True: 2, False: 0]
  ------------------
  311|      2|                        features |= PlatformInformation::CPU_FEATURE_PRO;
  312|       |
  313|       |                    // Check standard feature
  314|      2|                    _performCpuid(CPUID_FUNC_STANDARD_FEATURES, result);
  ------------------
  |  |  269|      2|#define CPUID_FUNC_STANDARD_FEATURES         0x1
  ------------------
  315|       |
  316|      2|                    if (result._edx & CPUID_STD_FPU)
  ------------------
  |  |  274|      2|#define CPUID_STD_FPU               (1<<0)
  ------------------
  |  Branch (316:25): [True: 2, False: 0]
  ------------------
  317|      2|                        features |= PlatformInformation::CPU_FEATURE_FPU;
  318|      2|                    if (result._edx & CPUID_STD_TSC)
  ------------------
  |  |  275|      2|#define CPUID_STD_TSC               (1<<4)
  ------------------
  |  Branch (318:25): [True: 2, False: 0]
  ------------------
  319|      2|                        features |= PlatformInformation::CPU_FEATURE_TSC;
  320|      2|                    if (result._edx & CPUID_STD_CMOV)
  ------------------
  |  |  276|      2|#define CPUID_STD_CMOV              (1<<15)
  ------------------
  |  Branch (320:25): [True: 2, False: 0]
  ------------------
  321|      2|                        features |= PlatformInformation::CPU_FEATURE_CMOV;
  322|      2|                    if (result._edx & CPUID_STD_MMX)
  ------------------
  |  |  277|      2|#define CPUID_STD_MMX               (1<<23)
  ------------------
  |  Branch (322:25): [True: 2, False: 0]
  ------------------
  323|      2|                        features |= PlatformInformation::CPU_FEATURE_MMX;
  324|      2|                    if (result._edx & CPUID_STD_SSE)
  ------------------
  |  |  278|      2|#define CPUID_STD_SSE               (1<<25)
  ------------------
  |  Branch (324:25): [True: 2, False: 0]
  ------------------
  325|      2|                        features |= PlatformInformation::CPU_FEATURE_MMXEXT | PlatformInformation::CPU_FEATURE_SSE;
  326|      2|                    if (result._edx & CPUID_STD_SSE2)
  ------------------
  |  |  279|      2|#define CPUID_STD_SSE2              (1<<26)
  ------------------
  |  Branch (326:25): [True: 2, False: 0]
  ------------------
  327|      2|                        features |= PlatformInformation::CPU_FEATURE_SSE2;
  328|      2|                    if (result._ecx & CPUID_STD_SSE3)
  ------------------
  |  |  282|      2|#define CPUID_STD_SSE3              (1<<0)      // ECX[0]  - Bit 0 of standard function 1 indicate SSE3 supported
  ------------------
  |  Branch (328:25): [True: 2, False: 0]
  ------------------
  329|      2|                        features |= PlatformInformation::CPU_FEATURE_SSE3;
  330|      2|                    if (result._ecx & CPUID_STD_SSE41)
  ------------------
  |  |  283|      2|#define CPUID_STD_SSE41             (1<<19)     // ECX[19] - Bit 0 of standard function 1 indicate SSE41 supported
  ------------------
  |  Branch (330:25): [True: 2, False: 0]
  ------------------
  331|      2|                        features |= PlatformInformation::CPU_FEATURE_SSE41;
  332|      2|                    if (result._ecx & CPUID_STD_SSE42)
  ------------------
  |  |  284|      2|#define CPUID_STD_SSE42             (1<<20)     // ECX[20] - Bit 0 of standard function 1 indicate SSE42 supported
  ------------------
  |  Branch (332:25): [True: 2, False: 0]
  ------------------
  333|      2|                        features |= PlatformInformation::CPU_FEATURE_SSE42;
  334|       |
  335|       |                    // Check to see if this is a Pentium 4 or later processor
  336|      2|                    if ((result._eax & CPUID_EXT_FAMILY_ID_MASK) ||
  ------------------
  |  |  287|      2|#define CPUID_EXT_FAMILY_ID_MASK    0x0F00000   // EAX[23:20] - Bit 23 thru 20 contains extended family processor id
  ------------------
  |  Branch (336:25): [True: 0, False: 2]
  ------------------
  337|      2|                        (result._eax & CPUID_FAMILY_ID_MASK) == CPUID_PENTIUM4_ID)
  ------------------
  |  |  286|      2|#define CPUID_FAMILY_ID_MASK        0x0F00      // EAX[11:8] - Bit 11 thru 8 contains family  processor id
  ------------------
                                      (result._eax & CPUID_FAMILY_ID_MASK) == CPUID_PENTIUM4_ID)
  ------------------
  |  |  288|      2|#define CPUID_PENTIUM4_ID           0x0F00      // Pentium 4 family processor id
  ------------------
  |  Branch (337:25): [True: 0, False: 2]
  ------------------
  338|      0|                    {
  339|       |                        // Check hyper-threading technology
  340|      0|                        if (result._edx & CPUID_STD_HTT)
  ------------------
  |  |  280|      0|#define CPUID_STD_HTT               (1<<28)     // EDX[28] - Bit 28 set indicates  Hyper-Threading Technology is supported in hardware.
  ------------------
  |  Branch (340:29): [True: 0, False: 0]
  ------------------
  341|      0|                            features |= PlatformInformation::CPU_FEATURE_HTT;
  342|      0|                    }
  343|       |
  344|       |
  345|      2|                    const uint maxExtensionFunctionSupport = _performCpuid(CPUID_FUNC_EXTENSION_QUERY, result);
  ------------------
  |  |  270|      2|#define CPUID_FUNC_EXTENSION_QUERY           0x80000000
  ------------------
  346|      2|                    if (maxExtensionFunctionSupport >= CPUID_FUNC_ADVANCED_POWER_MANAGEMENT)
  ------------------
  |  |  272|      2|#define CPUID_FUNC_ADVANCED_POWER_MANAGEMENT 0x80000007
  ------------------
  |  Branch (346:25): [True: 2, False: 0]
  ------------------
  347|      2|                    {
  348|      2|                        _performCpuid(CPUID_FUNC_ADVANCED_POWER_MANAGEMENT, result);
  ------------------
  |  |  272|      2|#define CPUID_FUNC_ADVANCED_POWER_MANAGEMENT 0x80000007
  ------------------
  349|       |
  350|      2|                        if (result._edx & CPUID_APM_INVARIANT_TSC)
  ------------------
  |  |  295|      2|#define CPUID_APM_INVARIANT_TSC     (1<<8)      // EDX[8] - Bit 8 of function 0x80000007 indicates support for invariant TSC.
  ------------------
  |  Branch (350:29): [True: 2, False: 0]
  ------------------
  351|      2|                            features |= PlatformInformation::CPU_FEATURE_INVARIANT_TSC;
  352|      2|                    }
  353|      2|                }
  354|      0|                else if (memcmp(&result._ebx, "AuthenticAMD", 12) == 0)
  ------------------
  |  Branch (354:26): [True: 0, False: 0]
  ------------------
  355|      0|                {
  356|      0|                    features |= PlatformInformation::CPU_FEATURE_PRO;
  357|       |
  358|       |                    // Check standard feature
  359|      0|                    _performCpuid(CPUID_FUNC_STANDARD_FEATURES, result);
  ------------------
  |  |  269|      0|#define CPUID_FUNC_STANDARD_FEATURES         0x1
  ------------------
  360|       |
  361|      0|                    if (result._edx & CPUID_STD_FPU)
  ------------------
  |  |  274|      0|#define CPUID_STD_FPU               (1<<0)
  ------------------
  |  Branch (361:25): [True: 0, False: 0]
  ------------------
  362|      0|                        features |= PlatformInformation::CPU_FEATURE_FPU;
  363|      0|                    if (result._edx & CPUID_STD_TSC)
  ------------------
  |  |  275|      0|#define CPUID_STD_TSC               (1<<4)
  ------------------
  |  Branch (363:25): [True: 0, False: 0]
  ------------------
  364|      0|                        features |= PlatformInformation::CPU_FEATURE_TSC;
  365|      0|                    if (result._edx & CPUID_STD_CMOV)
  ------------------
  |  |  276|      0|#define CPUID_STD_CMOV              (1<<15)
  ------------------
  |  Branch (365:25): [True: 0, False: 0]
  ------------------
  366|      0|                        features |= PlatformInformation::CPU_FEATURE_CMOV;
  367|      0|                    if (result._edx & CPUID_STD_MMX)
  ------------------
  |  |  277|      0|#define CPUID_STD_MMX               (1<<23)
  ------------------
  |  Branch (367:25): [True: 0, False: 0]
  ------------------
  368|      0|                        features |= PlatformInformation::CPU_FEATURE_MMX;
  369|      0|                    if (result._edx & CPUID_STD_SSE)
  ------------------
  |  |  278|      0|#define CPUID_STD_SSE               (1<<25)
  ------------------
  |  Branch (369:25): [True: 0, False: 0]
  ------------------
  370|      0|                        features |= PlatformInformation::CPU_FEATURE_SSE;
  371|      0|                    if (result._edx & CPUID_STD_SSE2)
  ------------------
  |  |  279|      0|#define CPUID_STD_SSE2              (1<<26)
  ------------------
  |  Branch (371:25): [True: 0, False: 0]
  ------------------
  372|      0|                        features |= PlatformInformation::CPU_FEATURE_SSE2;
  373|       |
  374|      0|                    if (result._ecx & CPUID_STD_SSE3)
  ------------------
  |  |  282|      0|#define CPUID_STD_SSE3              (1<<0)      // ECX[0]  - Bit 0 of standard function 1 indicate SSE3 supported
  ------------------
  |  Branch (374:25): [True: 0, False: 0]
  ------------------
  375|      0|                        features |= PlatformInformation::CPU_FEATURE_SSE3;
  376|       |
  377|       |                    // Has extended feature ?
  378|      0|                    const uint maxExtensionFunctionSupport = _performCpuid(CPUID_FUNC_EXTENSION_QUERY, result);
  ------------------
  |  |  270|      0|#define CPUID_FUNC_EXTENSION_QUERY           0x80000000
  ------------------
  379|      0|                    if (maxExtensionFunctionSupport >= CPUID_FUNC_EXTENDED_FEATURES)
  ------------------
  |  |  271|      0|#define CPUID_FUNC_EXTENDED_FEATURES         0x80000001
  ------------------
  |  Branch (379:25): [True: 0, False: 0]
  ------------------
  380|      0|                    {
  381|       |                        // Check extended feature
  382|      0|                        _performCpuid(CPUID_FUNC_EXTENDED_FEATURES, result);
  ------------------
  |  |  271|      0|#define CPUID_FUNC_EXTENDED_FEATURES         0x80000001
  ------------------
  383|       |
  384|      0|                        if (result._edx & CPUID_EXT_3DNOW)
  ------------------
  |  |  290|      0|#define CPUID_EXT_3DNOW             (1<<31)
  ------------------
  |  Branch (384:29): [True: 0, False: 0]
  ------------------
  385|      0|                            features |= PlatformInformation::CPU_FEATURE_3DNOW;
  386|      0|                        if (result._edx & CPUID_EXT_AMD_3DNOWEXT)
  ------------------
  |  |  291|      0|#define CPUID_EXT_AMD_3DNOWEXT      (1<<30)
  ------------------
  |  Branch (386:29): [True: 0, False: 0]
  ------------------
  387|      0|                            features |= PlatformInformation::CPU_FEATURE_3DNOWEXT;
  388|      0|                        if (result._edx & CPUID_EXT_AMD_MMXEXT)
  ------------------
  |  |  292|      0|#define CPUID_EXT_AMD_MMXEXT        (1<<22)
  ------------------
  |  Branch (388:29): [True: 0, False: 0]
  ------------------
  389|      0|                            features |= PlatformInformation::CPU_FEATURE_MMXEXT;
  390|      0|                    }
  391|       |
  392|       |
  393|      0|                    if (maxExtensionFunctionSupport >= CPUID_FUNC_ADVANCED_POWER_MANAGEMENT)
  ------------------
  |  |  272|      0|#define CPUID_FUNC_ADVANCED_POWER_MANAGEMENT 0x80000007
  ------------------
  |  Branch (393:25): [True: 0, False: 0]
  ------------------
  394|      0|                    {
  395|      0|                        _performCpuid(CPUID_FUNC_ADVANCED_POWER_MANAGEMENT, result);
  ------------------
  |  |  272|      0|#define CPUID_FUNC_ADVANCED_POWER_MANAGEMENT 0x80000007
  ------------------
  396|       |
  397|      0|                        if (result._edx & CPUID_APM_INVARIANT_TSC)
  ------------------
  |  |  295|      0|#define CPUID_APM_INVARIANT_TSC     (1<<8)      // EDX[8] - Bit 8 of function 0x80000007 indicates support for invariant TSC.
  ------------------
  |  Branch (397:29): [True: 0, False: 0]
  ------------------
  398|      0|                            features |= PlatformInformation::CPU_FEATURE_INVARIANT_TSC;
  399|      0|                    }
  400|      0|                }
  401|      2|            }
  402|      2|        }
  403|       |
  404|      2|        return features;
  405|      2|    }
OgrePlatformInformation.cpp:_ZN4OgreL31_checkOperatingSystemSupportSSEEv:
  202|      2|    {
  203|       |#if OGRE_COMPILER == OGRE_COMPILER_MSVC
  204|       |        /*
  205|       |            The FP part of SSE introduces a new architectural state and therefore
  206|       |            requires support from the operating system. So even if CPUID indicates
  207|       |            support for SSE FP, the application might not be able to use it. If
  208|       |            CPUID indicates support for SSE FP, check here whether it is also
  209|       |            supported by the OS, and turn off the SSE FP feature bit if there
  210|       |            is no OS support for SSE FP.
  211|       |
  212|       |            Operating systems that do not support SSE FP return an illegal
  213|       |            instruction exception if execution of an SSE FP instruction is performed.
  214|       |            Here, a sample SSE FP instruction is executed, and is checked for an
  215|       |            exception using the (non-standard) __try/__except mechanism
  216|       |            of Microsoft Visual C/C++.
  217|       |        */
  218|       |        // Visual Studio 2005, Both AMD and Intel x64 support SSE
  219|       |        // note that even though this is a build rather than runtime setting, all
  220|       |        // 64-bit CPUs support this so since binary is 64-bit only we're ok
  221|       |    #if _MSC_VER >= 1400 && defined(_M_X64)
  222|       |            return true;
  223|       |    #else
  224|       |        __try
  225|       |        {
  226|       |            __asm orps  xmm0, xmm0
  227|       |            return true;
  228|       |        }
  229|       |        __except(EXCEPTION_EXECUTE_HANDLER)
  230|       |        {
  231|       |            return false;
  232|       |        }
  233|       |    #endif
  234|       |#elif (OGRE_COMPILER == OGRE_COMPILER_GNUC || OGRE_COMPILER == OGRE_COMPILER_CLANG) && OGRE_PLATFORM != OGRE_PLATFORM_EMSCRIPTEN
  235|       |        #if OGRE_ARCH_TYPE == OGRE_ARCHITECTURE_64 
  236|      2|            return true;
  237|       |        #else
  238|       |        // Does gcc have __try/__except similar mechanism?
  239|       |        // Use signal, setjmp/longjmp instead.
  240|       |        void (*oldHandler)(int);
  241|       |        oldHandler = signal(SIGILL, _illegalHandler);
  242|       |
  243|       |        if (setjmp(sIllegalJmpBuf))
  244|       |        {
  245|       |            signal(SIGILL, oldHandler);
  246|       |            return false;
  247|       |        }
  248|       |        else
  249|       |        {
  250|       |            __asm__ __volatile__ ("orps %xmm0, %xmm0");
  251|       |            signal(SIGILL, oldHandler);
  252|       |            return true;
  253|       |        }
  254|       |       #endif
  255|       |#else
  256|       |        // TODO: Supports other compiler, assumed is supported by default
  257|       |        return true;
  258|       |#endif
  259|      2|    }
OgrePlatformInformation.cpp:_ZN4OgreL15_isSupportCpuidEv:
   83|      4|    {
   84|       |#if OGRE_COMPILER == OGRE_COMPILER_MSVC
   85|       |        // Visual Studio 2005 & 64-bit compilers always supports __cpuid intrinsic
   86|       |        // note that even though this is a build rather than runtime setting, all
   87|       |        // 64-bit CPUs support this so since binary is 64-bit only we're ok
   88|       |    #if _MSC_VER >= 1400 && defined(_M_X64)
   89|       |        return true;
   90|       |    #else
   91|       |        // If we can modify flag register bit 21, the cpu is supports CPUID instruction
   92|       |        __asm
   93|       |        {
   94|       |            // Read EFLAG
   95|       |            pushfd
   96|       |            pop     eax
   97|       |            mov     ecx, eax
   98|       |
   99|       |            // Modify bit 21
  100|       |            xor     eax, 0x200000
  101|       |            push    eax
  102|       |            popfd
  103|       |
  104|       |            // Read back EFLAG
  105|       |            pushfd
  106|       |            pop     eax
  107|       |
  108|       |            // Restore EFLAG
  109|       |            push    ecx
  110|       |            popfd
  111|       |
  112|       |            // Check bit 21 modifiable
  113|       |            xor     eax, ecx
  114|       |            neg     eax
  115|       |            sbb     eax, eax
  116|       |
  117|       |            // Return values in eax, no return statement requirement here for VC.
  118|       |        }
  119|       |    #endif
  120|       |#elif (OGRE_COMPILER == OGRE_COMPILER_GNUC || OGRE_COMPILER == OGRE_COMPILER_CLANG) && OGRE_PLATFORM != OGRE_PLATFORM_EMSCRIPTEN
  121|       |        #if OGRE_ARCH_TYPE == OGRE_ARCHITECTURE_64
  122|      4|           return true;
  123|       |       #else
  124|       |        unsigned oldFlags, newFlags;
  125|       |        __asm__
  126|       |        (
  127|       |            "pushfl         \n\t"
  128|       |            "pop    %0      \n\t"
  129|       |            "mov    %0, %1  \n\t"
  130|       |            "xor    %2, %0  \n\t"
  131|       |            "push   %0      \n\t"
  132|       |            "popfl          \n\t"
  133|       |            "pushfl         \n\t"
  134|       |            "pop    %0      \n\t"
  135|       |            "push   %1      \n\t"
  136|       |            "popfl          \n\t"
  137|       |            : "=r" (oldFlags), "=r" (newFlags)
  138|       |            : "n" (0x200000)
  139|       |        );
  140|       |        return oldFlags != newFlags;
  141|       |       #endif // 64
  142|       |#else
  143|       |        // TODO: Supports other compiler
  144|       |        return false;
  145|       |#endif
  146|      4|    }

_ZN4Ogre4PoseC2EtRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   34|  19.4k|        : mTarget(target), mName(name)
   35|  19.4k|    {
   36|  19.4k|    }
_ZN4Ogre4Pose9addVertexEjRKNS_6VectorILi3EfEE:
   39|  2.68k|    {
   40|  2.68k|        OgreAssert(mNormalsMap.empty(),
  ------------------
  |  Branch (40:9): [True: 0, False: 2.68k]
  ------------------
   41|  2.68k|                   "Inconsistent calls to addVertex, must include normals always or never");
   42|       |
   43|  2.68k|        if(offset.squaredLength() < 1e-6f)
  ------------------
  |  Branch (43:12): [True: 342, False: 2.34k]
  ------------------
   44|    342|        {
   45|    342|            return;
   46|    342|        }
   47|       |
   48|  2.34k|        mVertexOffsetMap[index] = offset;
   49|  2.34k|        mBuffer.reset();
   50|  2.34k|    }
_ZN4Ogre4Pose9addVertexEjRKNS_6VectorILi3EfEES4_:
   53|  3.21k|    {
   54|  3.21k|        OgreAssert(mVertexOffsetMap.empty() || !mNormalsMap.empty(),
  ------------------
  |  Branch (54:9): [True: 987, False: 2.22k]
  |  Branch (54:9): [True: 2.22k, False: 0]
  ------------------
   55|  3.21k|                   "Inconsistent calls to addVertex, must include normals always or never");
   56|       |
   57|  3.21k|        if(offset.squaredLength() < 1e-6f && normal.squaredLength() < 1e-6f)
  ------------------
  |  Branch (57:12): [True: 1.06k, False: 2.14k]
  |  Branch (57:46): [True: 236, False: 831]
  ------------------
   58|    236|        {
   59|    236|            return;
   60|    236|        }
   61|       |
   62|  2.97k|        mVertexOffsetMap[index] = offset;
   63|  2.97k|        mNormalsMap[index] = normal;
   64|  2.97k|        mBuffer.reset();
   65|  2.97k|    }

_ZNK4Ogre10QuaternionmlERKS0_:
  261|      3|    {
  262|       |        // NOTE:  Multiplication is not generally commutative, so in most
  263|       |        // cases p*q != q*p.
  264|       |
  265|      3|        return Quaternion
  266|      3|        (
  267|      3|            w * rkQ.w - x * rkQ.x - y * rkQ.y - z * rkQ.z,
  268|      3|            w * rkQ.x + x * rkQ.w + y * rkQ.z - z * rkQ.y,
  269|      3|            w * rkQ.y + y * rkQ.w + z * rkQ.x - x * rkQ.z,
  270|      3|            w * rkQ.z + z * rkQ.w + x * rkQ.y - y * rkQ.x
  271|      3|        );
  272|      3|    }
_ZNK4Ogre10Quaternion7InverseEv:
  275|    667|    {
  276|    667|        Real fNorm = w*w+x*x+y*y+z*z;
  277|    667|        if ( fNorm > 0.0 )
  ------------------
  |  Branch (277:14): [True: 423, False: 244]
  ------------------
  278|    423|        {
  279|    423|            Real fInvNorm = 1.0f/fNorm;
  280|    423|            return Quaternion(w*fInvNorm,-x*fInvNorm,-y*fInvNorm,-z*fInvNorm);
  281|    423|        }
  282|    244|        else
  283|    244|        {
  284|       |            // return an invalid result to flag the error
  285|    244|            return ZERO;
  286|    244|        }
  287|    667|    }
_ZNK4Ogre10QuaternionmlERKNS_6VectorILi3EfEE:
  360|      3|    {
  361|       |		// nVidia SDK implementation
  362|      3|		Vector3 uv, uuv;
  363|      3|		Vector3 qvec(x, y, z);
  364|      3|		uv = qvec.crossProduct(v);
  365|      3|		uuv = qvec.crossProduct(uv);
  366|      3|		uv *= (2.0f * w);
  367|      3|		uuv *= 2.0f;
  368|       |
  369|      3|		return v + uv + uuv;
  370|       |
  371|      3|    }

_ZN4Ogre8ResourceC2EPNS_15ResourceManagerERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEmSB_bPNS_20ManualResourceLoaderE:
   36|  9.97k|        : mCreator(creator), mName(name), mGroup(group), mHandle(handle), 
   37|  9.97k|        mLoadingState(LOADSTATE_UNLOADED), mIsBackgroundLoaded(false),
   38|  9.97k|        mIsManual(isManual), mSize(0),  mLoader(loader), mStateCount(0)
   39|  9.97k|    {
   40|  9.97k|    }
_ZN4Ogre8ResourceD2Ev:
   43|  6.46k|    { 
   44|  6.46k|    }
_ZN4Ogre8ResourceaSERKS0_:
   46|      2|    {
   47|      2|        mName = rhs.mName;
   48|      2|        mGroup = rhs.mGroup;
   49|      2|        mCreator = rhs.mCreator;
   50|      2|        mIsManual = rhs.mIsManual;
   51|      2|        mLoader = rhs.mLoader;
   52|      2|        mHandle = rhs.mHandle;
   53|      2|        mSize = rhs.mSize;
   54|       |
   55|      2|        mLoadingState.store(rhs.mLoadingState.load());
   56|      2|        mIsBackgroundLoaded = rhs.mIsBackgroundLoaded;
   57|       |
   58|      2|        return *this;
   59|      2|    }
_ZN4Ogre8Resource7prepareEb:
   70|  1.52k|    {
   71|       |        // quick check that avoids any synchronisation
   72|  1.52k|        LoadingState old = mLoadingState.load();
   73|  1.52k|        if (old != LOADSTATE_UNLOADED && old != LOADSTATE_PREPARING) return;
  ------------------
  |  Branch (73:13): [True: 0, False: 1.52k]
  |  Branch (73:42): [True: 0, False: 0]
  ------------------
   74|       |
   75|       |        // atomically do slower check to make absolutely sure,
   76|       |        // and set the load state to PREPARING
   77|  1.52k|        old = LOADSTATE_UNLOADED;
   78|  1.52k|        if (!mLoadingState.compare_exchange_strong(old,LOADSTATE_PREPARING))
  ------------------
  |  Branch (78:13): [True: 0, False: 1.52k]
  ------------------
   79|      0|        {
   80|      0|            while( mLoadingState.load() == LOADSTATE_PREPARING )
  ------------------
  |  Branch (80:20): [True: 0, False: 0]
  ------------------
   81|      0|            {
   82|      0|                            OGRE_LOCK_AUTO_MUTEX;
   83|      0|            }
   84|       |
   85|      0|            LoadingState state = mLoadingState.load();
   86|      0|            if( state != LOADSTATE_PREPARED && state != LOADSTATE_LOADING && state != LOADSTATE_LOADED )
  ------------------
  |  Branch (86:17): [True: 0, False: 0]
  |  Branch (86:48): [True: 0, False: 0]
  |  Branch (86:78): [True: 0, False: 0]
  ------------------
   87|      0|            {
   88|      0|                OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Another thread failed in resource operation",
   89|      0|                    "Resource::prepare");
   90|      0|            }
   91|      0|            return;
   92|      0|        }
   93|       |
   94|       |        // Scope lock for actual loading
   95|  1.52k|        try
   96|  1.52k|        {
   97|       |
   98|  1.52k|                    OGRE_LOCK_AUTO_MUTEX;
   99|       |
  100|  1.52k|            if (mIsManual)
  ------------------
  |  Branch (100:17): [True: 1.33k, False: 187]
  ------------------
  101|  1.33k|            {
  102|  1.33k|                if (mLoader)
  ------------------
  |  Branch (102:21): [True: 0, False: 1.33k]
  ------------------
  103|      0|                {
  104|      0|                    mLoader->prepareResource(this);
  105|      0|                }
  106|  1.33k|                else
  107|  1.33k|                {
  108|       |                    // Warn that this resource is not reloadable
  109|  1.33k|                    LogManager::getSingleton().stream(LML_TRIVIAL) 
  110|  1.33k|                        << "Note: " << mCreator->getResourceType()
  111|  1.33k|                        << " instance '" << mName << "' was defined as manually "
  112|  1.33k|                        << "loaded, but no manual loader was provided. This Resource "
  113|  1.33k|                        << "will be lost if it has to be reloaded.";
  114|  1.33k|                }
  115|  1.33k|            }
  116|    187|            else
  117|    187|            {
  118|    187|                if (mGroup == ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME)
  ------------------
  |  Branch (118:21): [True: 0, False: 187]
  ------------------
  119|      0|                {
  120|       |                    // Derive resource group
  121|      0|                    changeGroupOwnership(
  122|      0|                        ResourceGroupManager::getSingleton()
  123|      0|                        .findGroupContainingResource(mName));
  124|      0|                }
  125|    187|                prepareImpl();
  126|    187|            }
  127|  1.52k|        }
  128|  1.52k|        catch (...)
  129|  1.52k|        {
  130|    187|            mLoadingState.store(LOADSTATE_UNLOADED);
  131|       |
  132|    187|            OGRE_LOCK_AUTO_MUTEX;
  133|    187|            unloadImpl();
  134|       |
  135|    187|            throw;
  136|    187|        }
  137|       |
  138|  1.33k|        mLoadingState.store(LOADSTATE_PREPARED);
  139|       |
  140|       |        // Since we don't distinguish between GPU and CPU RAM, this
  141|       |        // seems pointless
  142|       |        //if(mCreator)
  143|       |        //  mCreator->_notifyResourcePrepared(this);
  144|       |
  145|       |        // Fire events (if not background)
  146|  1.33k|        if (!background)
  ------------------
  |  Branch (146:13): [True: 1.33k, False: 0]
  ------------------
  147|  1.33k|            _firePreparingComplete();
  148|       |
  149|       |
  150|  1.33k|    }
_ZN4Ogre8Resource4loadEb:
  153|  21.1k|    {
  154|       |        // Early-out without lock (mitigate perf cost of ensuring loaded)
  155|       |        // Don't load if:
  156|       |        // 1. We're already loaded
  157|       |        // 2. Another thread is loading right now
  158|       |        // 3. We're marked for background loading and this is not the background
  159|       |        //    loading thread we're being called by
  160|       |
  161|  21.1k|        if (mIsBackgroundLoaded && !background) return;
  ------------------
  |  Branch (161:13): [True: 0, False: 21.1k]
  |  Branch (161:36): [True: 0, False: 0]
  ------------------
  162|       |
  163|       |        // This next section is to deal with cases where 2 threads are fighting over
  164|       |        // who gets to prepare / load - this will only usually happen if loading is escalated
  165|  21.1k|        bool keepChecking = true;
  166|  21.1k|        LoadingState old = LOADSTATE_UNLOADED;
  167|  42.3k|        while (keepChecking)
  ------------------
  |  Branch (167:16): [True: 21.1k, False: 21.1k]
  ------------------
  168|  21.1k|        {
  169|       |            // quick check that avoids any synchronisation
  170|  21.1k|            old = mLoadingState.load();
  171|       |
  172|  21.1k|            if ( old == LOADSTATE_PREPARING )
  ------------------
  |  Branch (172:18): [True: 0, False: 21.1k]
  ------------------
  173|      0|            {
  174|      0|                while( mLoadingState.load() == LOADSTATE_PREPARING )
  ------------------
  |  Branch (174:24): [True: 0, False: 0]
  ------------------
  175|      0|                {
  176|      0|                                    OGRE_LOCK_AUTO_MUTEX;
  177|      0|                }
  178|      0|                old = mLoadingState.load();
  179|      0|            }
  180|       |
  181|  21.1k|            if (old!=LOADSTATE_UNLOADED && old!=LOADSTATE_PREPARED && old!=LOADSTATE_LOADING) return;
  ------------------
  |  Branch (181:17): [True: 0, False: 21.1k]
  |  Branch (181:44): [True: 0, False: 0]
  |  Branch (181:71): [True: 0, False: 0]
  ------------------
  182|       |
  183|       |            // atomically do slower check to make absolutely sure,
  184|       |            // and set the load state to LOADING
  185|  21.1k|            if (old==LOADSTATE_LOADING || !mLoadingState.compare_exchange_strong(old,LOADSTATE_LOADING))
  ------------------
  |  Branch (185:17): [True: 0, False: 21.1k]
  |  Branch (185:43): [True: 0, False: 21.1k]
  ------------------
  186|      0|            {
  187|      0|                while( mLoadingState.load() == LOADSTATE_LOADING )
  ------------------
  |  Branch (187:24): [True: 0, False: 0]
  ------------------
  188|      0|                {
  189|      0|                                    OGRE_LOCK_AUTO_MUTEX;
  190|      0|                }
  191|       |
  192|      0|                LoadingState state = mLoadingState.load();
  193|      0|                if( state == LOADSTATE_PREPARED || state == LOADSTATE_PREPARING )
  ------------------
  |  Branch (193:21): [True: 0, False: 0]
  |  Branch (193:52): [True: 0, False: 0]
  ------------------
  194|      0|                {
  195|       |                    // another thread is preparing, loop around
  196|      0|                    continue;
  197|      0|                }
  198|      0|                else if( state != LOADSTATE_LOADED )
  ------------------
  |  Branch (198:26): [True: 0, False: 0]
  ------------------
  199|      0|                {
  200|      0|                    OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Another thread failed in resource operation",
  201|      0|                        "Resource::load");
  202|      0|                }
  203|      0|                return;
  204|      0|            }
  205|  21.1k|            keepChecking = false;
  206|  21.1k|        }
  207|       |
  208|       |        // Scope lock for actual loading
  209|  21.1k|        try
  210|  21.1k|        {
  211|       |
  212|  21.1k|                    OGRE_LOCK_AUTO_MUTEX;
  213|       |
  214|       |
  215|       |
  216|  21.1k|            if (mIsManual)
  ------------------
  |  Branch (216:17): [True: 5.12k, False: 16.0k]
  ------------------
  217|  5.12k|            {
  218|  5.12k|                if (old==LOADSTATE_UNLOADED && mLoader)
  ------------------
  |  Branch (218:21): [True: 5.12k, False: 0]
  |  Branch (218:48): [True: 0, False: 5.12k]
  ------------------
  219|      0|                {
  220|      0|                    mLoader->prepareResource(this);
  221|       |
  222|      0|                    if (!background)
  ------------------
  |  Branch (222:25): [True: 0, False: 0]
  ------------------
  223|      0|                        _firePreparingComplete();
  224|      0|                }
  225|       |
  226|  5.12k|                preLoadImpl();
  227|       |
  228|       |                // Load from manual loader
  229|  5.12k|                if (mLoader)
  ------------------
  |  Branch (229:21): [True: 0, False: 5.12k]
  ------------------
  230|      0|                {
  231|      0|                    mLoader->loadResource(this);
  232|      0|                }
  233|  5.12k|                else
  234|  5.12k|                {
  235|       |                    // Warn that this resource is not reloadable
  236|  5.12k|                    LogManager::getSingleton().stream(LML_TRIVIAL) 
  237|  5.12k|                        << "Note: " << mCreator->getResourceType()
  238|  5.12k|                        << " instance '" << mName << "' was defined as manually "
  239|  5.12k|                        << "loaded, but no manual loader was provided. This Resource "
  240|  5.12k|                        << "will be lost if it has to be reloaded.";
  241|  5.12k|                }
  242|  5.12k|                postLoadImpl();
  243|  5.12k|            }
  244|  16.0k|            else
  245|  16.0k|            {
  246|       |
  247|  16.0k|                if (old==LOADSTATE_UNLOADED)
  ------------------
  |  Branch (247:21): [True: 16.0k, False: 0]
  ------------------
  248|  16.0k|                {
  249|  16.0k|                    prepareImpl();
  250|       |
  251|  16.0k|                    if (!background)
  ------------------
  |  Branch (251:25): [True: 0, False: 16.0k]
  ------------------
  252|      0|                        _firePreparingComplete();
  253|  16.0k|                }
  254|       |
  255|  16.0k|                preLoadImpl();
  256|       |
  257|  16.0k|                if (mGroup == ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME)
  ------------------
  |  Branch (257:21): [True: 0, False: 16.0k]
  ------------------
  258|      0|                {
  259|       |                    // Derive resource group
  260|      0|                    changeGroupOwnership(
  261|      0|                        ResourceGroupManager::getSingleton()
  262|      0|                        .findGroupContainingResource(mName));
  263|      0|                }
  264|       |
  265|  16.0k|                loadImpl();
  266|       |
  267|  16.0k|                postLoadImpl();
  268|  16.0k|            }
  269|       |
  270|       |            // Calculate resource size
  271|  21.1k|            mSize = calculateSize();
  272|       |
  273|  21.1k|        }
  274|  21.1k|        catch (...)
  275|  21.1k|        {
  276|       |            // Reset loading in-progress flag, in case failed for some reason.
  277|       |            // We reset it to UNLOADED because the only other case is when
  278|       |            // old == PREPARED in which case the loadImpl should wipe out
  279|       |            // any prepared data since it might be invalid.
  280|  16.0k|            mLoadingState.store(LOADSTATE_UNLOADED);
  281|       |
  282|  16.0k|            OGRE_LOCK_AUTO_MUTEX;
  283|  16.0k|            unloadImpl();
  284|       |
  285|       |            // Re-throw
  286|  16.0k|            throw;
  287|  16.0k|        }
  288|       |
  289|  5.12k|        mLoadingState.store(LOADSTATE_LOADED);
  290|  5.12k|        _dirtyState();
  291|       |
  292|       |        // Notify manager
  293|  5.12k|        if(mCreator)
  ------------------
  |  Branch (293:12): [True: 5.12k, False: 0]
  ------------------
  294|  5.12k|            mCreator->_notifyResourceLoaded(this);
  295|       |
  296|       |        // Fire events, if not background
  297|  5.12k|        if (!background)
  ------------------
  |  Branch (297:13): [True: 5.12k, False: 0]
  ------------------
  298|  5.12k|            _fireLoadingComplete();
  299|       |
  300|       |
  301|  5.12k|    }
_ZN4Ogre8Resource11_dirtyStateEv:
  315|   174k|    {
  316|       |        // don't worry about threading here, count only ever increases so 
  317|       |        // doesn't matter if we get a lost increment (one is enough)
  318|   174k|        ++mStateCount;  
  319|   174k|    }
_ZN4Ogre8Resource6unloadEv:
  333|  6.46k|    { 
  334|       |        // Early-out without lock (mitigate perf cost of ensuring unloaded)
  335|  6.46k|        LoadingState old = mLoadingState.load();
  336|  6.46k|        if (old!=LOADSTATE_LOADED && old!=LOADSTATE_PREPARED) return;
  ------------------
  |  Branch (336:13): [True: 1.33k, False: 5.12k]
  |  Branch (336:38): [True: 0, False: 1.33k]
  ------------------
  337|       |
  338|       |
  339|  6.46k|        if (!mLoadingState.compare_exchange_strong(old,LOADSTATE_UNLOADING)) return;
  ------------------
  |  Branch (339:13): [True: 0, False: 6.46k]
  ------------------
  340|       |
  341|       |        // Scope lock for actual unload
  342|  6.46k|        {
  343|  6.46k|                    OGRE_LOCK_AUTO_MUTEX;
  344|  6.46k|            if (old==LOADSTATE_PREPARED) {
  ------------------
  |  Branch (344:17): [True: 1.33k, False: 5.12k]
  ------------------
  345|  1.33k|                unprepareImpl();
  346|  5.12k|            } else {
  347|  5.12k|                preUnloadImpl();
  348|  5.12k|                unloadImpl();
  349|  5.12k|                postUnloadImpl();
  350|  5.12k|            }
  351|  6.46k|        }
  352|       |
  353|  6.46k|        mLoadingState.store(LOADSTATE_UNLOADED);
  354|       |
  355|       |        // Notify manager
  356|       |        // Note if we have gone from PREPARED to UNLOADED, then we haven't actually
  357|       |        // unloaded, i.e. there is no memory freed on the GPU.
  358|  6.46k|        if(old==LOADSTATE_LOADED && mCreator)
  ------------------
  |  Branch (358:12): [True: 5.12k, False: 1.33k]
  |  Branch (358:37): [True: 5.12k, False: 0]
  ------------------
  359|  5.12k|            mCreator->_notifyResourceUnloaded(this);
  360|       |
  361|  6.46k|        _fireUnloadingComplete();
  362|       |
  363|       |
  364|  6.46k|    }
_ZN4Ogre8Resource20_fireLoadingCompleteEb:
  399|  5.12k|    {
  400|  5.12k|        ListenerList listenerList;
  401|  5.12k|        {
  402|       |            // Lock the listener list and make a copy of it
  403|  5.12k|            OGRE_LOCK_MUTEX(mListenerListMutex);
  404|  5.12k|            listenerList = mListenerList;
  405|  5.12k|        }
  406|  5.12k|        for (auto& l : listenerList)
  ------------------
  |  Branch (406:22): [True: 0, False: 5.12k]
  ------------------
  407|      0|        {
  408|      0|            l->loadingComplete(this);
  409|      0|        }
  410|  5.12k|    }
_ZN4Ogre8Resource22_firePreparingCompleteEb:
  413|  1.33k|    {
  414|  1.33k|        ListenerList listenerList;
  415|  1.33k|        {
  416|       |            // Lock the listener list and make a copy of it
  417|  1.33k|            OGRE_LOCK_MUTEX(mListenerListMutex);
  418|  1.33k|            listenerList = mListenerList;
  419|  1.33k|        }
  420|  1.33k|        for (auto& l : listenerList)
  ------------------
  |  Branch (420:22): [True: 0, False: 1.33k]
  ------------------
  421|      0|        {
  422|      0|            l->preparingComplete(this);
  423|      0|        }
  424|  1.33k|    }
_ZN4Ogre8Resource22_fireUnloadingCompleteEv:
  427|  6.46k|    {
  428|  6.46k|        ListenerList listenerList;
  429|  6.46k|        {
  430|       |            // Lock the listener list and make a copy of it
  431|  6.46k|            OGRE_LOCK_MUTEX(mListenerListMutex);
  432|  6.46k|            listenerList = mListenerList;
  433|  6.46k|        }
  434|  6.46k|        for (auto& l : listenerList)
  ------------------
  |  Branch (434:22): [True: 0, False: 6.46k]
  ------------------
  435|      0|        {
  436|      0|            l->unloadingComplete(this);
  437|      0|        }
  438|  6.46k|    }

_ZN4Ogre20ResourceGroupManager12getSingletonEv:
   40|   228k|    {  
   41|       |        assert( msSingleton );  return ( *msSingleton );  
   42|   228k|    }
_ZN4Ogre20ResourceGroupManagerC2Ev:
   58|      1|        : mLoadingListener(0), mCurrentGroup(0)
   59|      1|    {
   60|       |        // Create the 'General' group
   61|      1|        createResourceGroup(DEFAULT_RESOURCE_GROUP_NAME, true); // the "General" group is synonymous to global pool
   62|       |        // Create the 'Internal' group
   63|      1|        createResourceGroup(INTERNAL_RESOURCE_GROUP_NAME, true);
   64|       |        // Create the 'Autodetect' group (only used for temp storage)
   65|      1|        createResourceGroup(AUTODETECT_RESOURCE_GROUP_NAME, true); // autodetect includes the global pool
   66|       |        // default world group to the default group
   67|      1|        mWorldGroupName = DEFAULT_RESOURCE_GROUP_NAME;
   68|      1|    }
_ZN4Ogre20ResourceGroupManager19createResourceGroupERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEb:
   83|      3|    {
   84|      3|        LogManager::getSingleton().logMessage("Creating resource group " + name);
   85|      3|        if (getResourceGroup(name))
  ------------------
  |  Branch (85:13): [True: 0, False: 3]
  ------------------
   86|      0|        {
   87|      0|            OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM, 
   88|      0|                "Resource group with name '" + name + "' already exists!", 
   89|      0|                "ResourceGroupManager::createResourceGroup");
   90|      0|        }
   91|      3|        ResourceGroup* grp = OGRE_NEW_T(ResourceGroup, MEMCATEGORY_RESOURCE)();
   92|      3|        grp->groupStatus = ResourceGroup::UNINITIALSED;
   93|      3|        grp->name = name;
   94|      3|        grp->inGlobalPool = inGlobalPool;
   95|      3|        grp->customStageCount = 0;
   96|       |
   97|      3|        OGRE_LOCK_AUTO_MUTEX;
   98|      3|        mResourceGroupMap.emplace(name, grp);
   99|      3|    }
_ZNK4Ogre20ResourceGroupManager16openResourceImplERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_bPNS_8ResourceEb:
  515|  16.2k|    {
  516|  16.2k|        OgreAssert(!resourceName.empty(), "resourceName is empty string");
  ------------------
  |  Branch (516:9): [True: 0, False: 16.2k]
  ------------------
  517|  16.2k|        if(mLoadingListener)
  ------------------
  |  Branch (517:12): [True: 0, False: 16.2k]
  ------------------
  518|      0|        {
  519|      0|            DataStreamPtr stream = mLoadingListener->resourceLoading(resourceName, groupName, resourceBeingLoaded);
  520|      0|            if(stream)
  ------------------
  |  Branch (520:16): [True: 0, False: 0]
  ------------------
  521|      0|                return stream;
  522|      0|        }
  523|       |
  524|       |        // Try to find in resource index first
  525|  16.2k|        ResourceGroup* grp = getResourceGroup(groupName, throwOnFailure);
  526|  16.2k|        if (!grp)
  ------------------
  |  Branch (526:13): [True: 0, False: 16.2k]
  ------------------
  527|      0|        {
  528|       |            // we only get here if throwOnFailure is false
  529|      0|            return DataStreamPtr();
  530|      0|        }
  531|       |
  532|  16.2k|        Archive* pArch = resourceExists(grp, resourceName);
  533|       |
  534|  16.2k|        if (pArch == NULL && (searchGroupsIfNotFound ||
  ------------------
  |  Branch (534:13): [True: 16.2k, False: 0]
  |  Branch (534:31): [True: 0, False: 16.2k]
  ------------------
  535|  16.2k|            groupName == AUTODETECT_RESOURCE_GROUP_NAME || grp->inGlobalPool ||
  ------------------
  |  Branch (535:13): [True: 0, False: 16.2k]
  |  Branch (535:60): [True: 16.2k, False: 0]
  ------------------
  536|      0|            (!OGRE_RESOURCEMANAGER_STRICT && (groupName == DEFAULT_RESOURCE_GROUP_NAME))))
  ------------------
  |  Branch (536:14): [Folded, False: 0]
  |  Branch (536:46): [True: 0, False: 0]
  ------------------
  537|  16.2k|        {
  538|  16.2k|            std::pair<Archive*, ResourceGroup*> ret = resourceExistsInAnyGroupImpl(resourceName);
  539|       |
  540|  16.2k|            if(ret.second && resourceBeingLoaded && !ret.second->inGlobalPool) {
  ------------------
  |  Branch (540:16): [True: 0, False: 16.2k]
  |  Branch (540:30): [True: 0, False: 0]
  |  Branch (540:53): [True: 0, False: 0]
  ------------------
  541|      0|                resourceBeingLoaded->changeGroupOwnership(ret.second->name);
  542|      0|            }
  543|       |
  544|  16.2k|            pArch = ret.first;
  545|  16.2k|        }
  546|       |
  547|  16.2k|        if (pArch)
  ------------------
  |  Branch (547:13): [True: 0, False: 16.2k]
  ------------------
  548|      0|        {
  549|      0|            DataStreamPtr stream = pArch->open(resourceName);
  550|      0|            if (mLoadingListener)
  ------------------
  |  Branch (550:17): [True: 0, False: 0]
  ------------------
  551|      0|                mLoadingListener->resourceStreamOpened(resourceName, groupName, resourceBeingLoaded, stream);
  552|      0|            return stream;
  553|      0|        }
  554|       |
  555|  16.2k|        if(!throwOnFailure)
  ------------------
  |  Branch (555:12): [True: 0, False: 16.2k]
  ------------------
  556|      0|            return DataStreamPtr();
  557|       |
  558|  16.2k|        OGRE_EXCEPT(Exception::ERR_FILE_NOT_FOUND, "Cannot locate resource " + 
  559|  16.2k|            resourceName + " in resource group " + groupName + ".", 
  560|  16.2k|            "ResourceGroupManager::openResource");
  561|       |
  562|  16.2k|    }
_ZN4Ogre20ResourceGroupManager24_registerResourceManagerERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPNS_15ResourceManagerE:
  702|      3|    {
  703|      3|        OGRE_LOCK_AUTO_MUTEX;
  704|       |
  705|      3|        LogManager::getSingleton().logMessage(
  706|      3|            "Registering ResourceManager for type " + resourceType);
  707|      3|        mResourceManagerMap[resourceType] = rm;
  708|      3|    }
_ZNK4Ogre20ResourceGroupManager22_notifyResourceCreatedERNS_9SharedPtrINS_8ResourceEEE:
  869|  9.97k|    {
  870|  9.97k|        if (mCurrentGroup && res->getGroup() == mCurrentGroup->name)
  ------------------
  |  Branch (870:13): [True: 0, False: 9.97k]
  |  Branch (870:30): [True: 0, False: 0]
  ------------------
  871|      0|        {
  872|       |            // Use current group (batch loading)
  873|      0|            addCreatedResource(res, *mCurrentGroup);
  874|      0|        }
  875|  9.97k|        else
  876|  9.97k|        {
  877|       |            // Find group
  878|  9.97k|            ResourceGroup* grp = getResourceGroup(res->getGroup());
  879|  9.97k|            if (grp)
  ------------------
  |  Branch (879:17): [True: 9.97k, False: 0]
  ------------------
  880|  9.97k|            {
  881|  9.97k|                addCreatedResource(res, *grp);
  882|  9.97k|            }
  883|  9.97k|        }
  884|       |
  885|  9.97k|        fireResourceCreated(res);
  886|  9.97k|    }
_ZNK4Ogre20ResourceGroupManager22_notifyResourceRemovedERKNS_9SharedPtrINS_8ResourceEEE:
  889|  6.46k|    {
  890|  6.46k|        fireResourceRemove(res);
  891|       |
  892|  6.46k|        if (mCurrentGroup && res->getGroup() == mCurrentGroup->name)
  ------------------
  |  Branch (892:13): [True: 0, False: 6.46k]
  |  Branch (892:30): [True: 0, False: 0]
  ------------------
  893|      0|        {
  894|       |            // Do nothing - we're batch unloading so list will be cleared
  895|      0|        }
  896|  6.46k|        else
  897|  6.46k|        {
  898|       |            // Find group
  899|  6.46k|            ResourceGroup* grp = getResourceGroup(res->getGroup());
  900|  6.46k|            if (grp)
  ------------------
  |  Branch (900:17): [True: 6.46k, False: 0]
  ------------------
  901|  6.46k|            {
  902|  6.46k|                            OGRE_LOCK_MUTEX(grp->OGRE_AUTO_MUTEX_NAME); // lock group mutex
  903|  6.46k|                ResourceGroup::LoadResourceOrderMap::iterator i = 
  904|  6.46k|                    grp->loadResourceOrderMap.find(
  905|  6.46k|                        res->getCreator()->getLoadingOrder());
  906|  6.46k|                if (i != grp->loadResourceOrderMap.end())
  ------------------
  |  Branch (906:21): [True: 6.46k, False: 0]
  ------------------
  907|  6.46k|                {
  908|       |                    // Iterate over the resource list and remove
  909|  6.46k|                    LoadUnloadResourceList& resList = i->second;
  910|  6.46k|                    for (LoadUnloadResourceList::iterator l = resList.begin();
  911|   590k|                        l != resList.end(); ++ l)
  ------------------
  |  Branch (911:25): [True: 590k, False: 0]
  ------------------
  912|   590k|                    {
  913|   590k|                        if ((*l).get() == res.get())
  ------------------
  |  Branch (913:29): [True: 6.46k, False: 584k]
  ------------------
  914|  6.46k|                        {
  915|       |                            // this is the one
  916|  6.46k|                            resList.erase(l);
  917|  6.46k|                            break;
  918|  6.46k|                        }
  919|   590k|                    }
  920|  6.46k|                }
  921|  6.46k|            }
  922|  6.46k|        }
  923|  6.46k|    }
_ZNK4Ogre20ResourceGroupManager18addCreatedResourceERNS_9SharedPtrINS_8ResourceEEERNS0_13ResourceGroupE:
  996|  9.97k|    {
  997|  9.97k|            OGRE_LOCK_MUTEX(grp.OGRE_AUTO_MUTEX_NAME);
  998|  9.97k|        Real order = res->getCreator()->getLoadingOrder();
  999|       |
 1000|  9.97k|        ResourceGroup::LoadResourceOrderMap::iterator i = grp.loadResourceOrderMap.find(order);
 1001|  9.97k|        LoadUnloadResourceList& loadList =
 1002|  9.97k|            i == grp.loadResourceOrderMap.end() ? grp.loadResourceOrderMap[order] : i->second;
  ------------------
  |  Branch (1002:13): [True: 3, False: 9.97k]
  ------------------
 1003|       |
 1004|  9.97k|        loadList.push_back(res);
 1005|  9.97k|    }
_ZNK4Ogre20ResourceGroupManager16getResourceGroupERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEb:
 1009|   218k|    {
 1010|   218k|        OGRE_LOCK_AUTO_MUTEX;
 1011|   218k|        ResourceGroupMap::const_iterator i = mResourceGroupMap.find(name);
 1012|       |
 1013|   218k|        if (i == mResourceGroupMap.end())
  ------------------
  |  Branch (1013:13): [True: 3, False: 218k]
  ------------------
 1014|      3|        {
 1015|      3|            if (throwOnFailure)
  ------------------
  |  Branch (1015:17): [True: 0, False: 3]
  ------------------
 1016|      3|                OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Cannot locate a resource group called '" + name + "'");
 1017|       |
 1018|      3|            return nullptr;
 1019|      3|        }
 1020|       |
 1021|   218k|        return i->second;
 1022|   218k|    }
_ZNK4Ogre20ResourceGroupManager19fireResourceCreatedERKNS_9SharedPtrINS_8ResourceEEE:
 1209|  9.97k|    {
 1210|  9.97k|        OGRE_LOCK_AUTO_MUTEX;
 1211|  9.97k|        for (auto l : mResourceGroupListenerList)
  ------------------
  |  Branch (1211:21): [True: 0, False: 9.97k]
  ------------------
 1212|      0|        {
 1213|      0|            l->resourceCreated(resource);
 1214|      0|        }
 1215|  9.97k|    }
_ZNK4Ogre20ResourceGroupManager18fireResourceRemoveERKNS_9SharedPtrINS_8ResourceEEE:
 1218|  6.46k|    {
 1219|  6.46k|        OGRE_LOCK_AUTO_MUTEX;
 1220|  6.46k|        for (auto l : mResourceGroupListenerList)
  ------------------
  |  Branch (1220:21): [True: 0, False: 6.46k]
  ------------------
 1221|      0|        {
 1222|      0|            l->resourceRemove(resource);
 1223|      0|        }
 1224|  6.46k|    }
_ZNK4Ogre20ResourceGroupManager14resourceExistsEPNS0_13ResourceGroupERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
 1323|  64.8k|    {
 1324|       |
 1325|  64.8k|            OGRE_LOCK_MUTEX(grp->OGRE_AUTO_MUTEX_NAME); // lock group mutex
 1326|       |
 1327|       |        // Try indexes first
 1328|  64.8k|        ResourceLocationIndex::iterator rit = grp->resourceIndexCaseSensitive.find(resourceName);
 1329|  64.8k|        if (rit != grp->resourceIndexCaseSensitive.end())
  ------------------
  |  Branch (1329:13): [True: 0, False: 64.8k]
  ------------------
 1330|      0|        {
 1331|       |            // Found in the index
 1332|      0|            return rit->second;
 1333|      0|        }
 1334|       |
 1335|       |#if !OGRE_RESOURCEMANAGER_STRICT
 1336|       |        // try case insensitive
 1337|       |        String lcResourceName = resourceName;
 1338|       |        StringUtil::toLowerCase(lcResourceName);
 1339|       |        rit = grp->resourceIndexCaseInsensitive.find(lcResourceName);
 1340|       |        if (rit != grp->resourceIndexCaseInsensitive.end())
 1341|       |        {
 1342|       |            // Found in the index
 1343|       |            return rit->second;
 1344|       |        }
 1345|       |
 1346|       |        // Search the hard way
 1347|       |        for (auto& li : grp->locationList)
 1348|       |        {
 1349|       |            if (li.archive->exists(resourceName))
 1350|       |            {
 1351|       |                return li.archive;
 1352|       |            }
 1353|       |        }
 1354|       |#endif
 1355|       |
 1356|  64.8k|        return NULL;
 1357|       |
 1358|  64.8k|    }
_ZNK4Ogre20ResourceGroupManager28resourceExistsInAnyGroupImplERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 1380|  16.2k|    {
 1381|  16.2k|        OgreAssert(!filename.empty(), "resourceName is empty string");
  ------------------
  |  Branch (1381:9): [True: 0, False: 16.2k]
  ------------------
 1382|  16.2k|            OGRE_LOCK_AUTO_MUTEX;
 1383|       |
 1384|       |            // Iterate over resource groups and find
 1385|  16.2k|        for (const auto & i : mResourceGroupMap)
  ------------------
  |  Branch (1385:29): [True: 48.6k, False: 16.2k]
  ------------------
 1386|  48.6k|        {
 1387|  48.6k|            Archive* arch = resourceExists(i.second, filename);
 1388|  48.6k|            if (arch)
  ------------------
  |  Branch (1388:17): [True: 0, False: 48.6k]
  ------------------
 1389|      0|                return std::make_pair(arch, i.second);
 1390|  48.6k|        }
 1391|       |        // Not found
 1392|  16.2k|        return std::pair<Archive*, ResourceGroup*>();
 1393|  16.2k|    }
_ZNK4Ogre20ResourceGroupManager27isResourceGroupInGlobalPoolERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 1468|   185k|    {
 1469|   185k|        return getResourceGroup(name, true)->inGlobalPool;
 1470|   185k|    }
_ZNK4Ogre20ResourceGroupManager18getLoadingListenerEv:
 1501|  9.97k|    {
 1502|  9.97k|        return mLoadingListener;
 1503|  9.97k|    }

_ZN4Ogre15ResourceManagerC2Ev:
   35|      3|        : mNextHandle(1), mMemoryUsage(0), mVerbose(true), mLoadOrder(0)
   36|      3|    {
   37|       |        // Init memory limit & usage
   38|      3|        mMemoryBudget = std::numeric_limits<unsigned long>::max();
   39|      3|    }
_ZN4Ogre15ResourceManager14createResourceERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_bPNS_20ManualResourceLoaderEPKNS1_3mapIS7_S7_NS1_4lessIS7_EENS5_INS1_4pairIS8_S7_EEEEEE:
   53|  9.98k|    {
   54|  9.98k|        OgreAssert(!name.empty(), "resource name must not be empty");
  ------------------
  |  Branch (54:9): [True: 4, False: 9.97k]
  ------------------
   55|       |
   56|       |        // Call creation implementation
   57|  9.97k|        ResourcePtr ret = ResourcePtr(
   58|  9.97k|            createImpl(name, getNextHandle(), group, isManual, loader, params));
   59|  9.97k|        if (params)
  ------------------
  |  Branch (59:13): [True: 0, False: 9.97k]
  ------------------
   60|      0|            ret->setParameterList(*params);
   61|       |
   62|  9.97k|        addImpl(ret);
   63|       |        // Tell resource group manager
   64|  9.97k|        if(ret)
  ------------------
  |  Branch (64:12): [True: 9.97k, False: 0]
  ------------------
   65|  9.97k|            ResourceGroupManager::getSingleton()._notifyResourceCreated(ret);
   66|  9.97k|        return ret;
   67|       |
   68|  9.98k|    }
_ZN4Ogre15ResourceManager16createOrRetrieveERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_bPNS_20ManualResourceLoaderEPKNS1_3mapIS7_S7_NS1_4lessIS7_EENS5_INS1_4pairIS8_S7_EEEEEE:
   75|  16.2k|    {
   76|       |        // Lock for the whole get / insert
   77|  16.2k|            OGRE_LOCK_AUTO_MUTEX;
   78|       |
   79|  16.2k|        ResourcePtr res = getResourceByName(name, group);
   80|  16.2k|        bool created = false;
   81|  16.2k|        if (!res)
  ------------------
  |  Branch (81:13): [True: 3.51k, False: 12.7k]
  ------------------
   82|  3.51k|        {
   83|  3.51k|            created = true;
   84|  3.51k|            res = createResource(name, group, isManual, loader, params);
   85|  3.51k|        }
   86|       |
   87|  16.2k|        return ResourceCreateOrRetrieveResult(res, created);
   88|  16.2k|    }
_ZN4Ogre15ResourceManager7prepareERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_bPNS_20ManualResourceLoaderEPKNS1_3mapIS7_S7_NS1_4lessIS7_EENS5_INS1_4pairIS8_S7_EEEEEEb:
   93|    191|    {
   94|    191|        ResourcePtr r = createOrRetrieve(name,group,isManual,loader,loadParams).first;
   95|       |        // ensure prepared
   96|    191|        r->prepare(backgroundThread);
   97|    191|        return r;
   98|    191|    }
_ZN4Ogre15ResourceManager4loadERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_bPNS_20ManualResourceLoaderEPKNS1_3mapIS7_S7_NS1_4lessIS7_EENS5_INS1_4pairIS8_S7_EEEEEEb:
  103|  16.0k|    {
  104|  16.0k|        ResourcePtr r = createOrRetrieve(name,group,isManual,loader,loadParams).first;
  105|       |        // ensure loaded
  106|  16.0k|        r->load(backgroundThread);
  107|       |
  108|  16.0k|        return r;
  109|  16.0k|    }
_ZN4Ogre15ResourceManager7addImplERNS_9SharedPtrINS_8ResourceEEE:
  112|  9.97k|    {
  113|  9.97k|            OGRE_LOCK_AUTO_MUTEX;
  114|       |
  115|  9.97k|            std::pair<ResourceMap::iterator, bool> result;
  116|  9.97k|        if(ResourceGroupManager::getSingleton().isResourceGroupInGlobalPool(res->getGroup()))
  ------------------
  |  Branch (116:12): [True: 9.97k, False: 0]
  ------------------
  117|  9.97k|        {
  118|  9.97k|            result = mResources.emplace(res->getName(), res);
  119|  9.97k|        }
  120|      0|        else
  121|      0|        {
  122|       |            // we will create the group if it doesn't exists in our list
  123|      0|            auto resgroup = mResourcesWithGroup.emplace(res->getGroup(), ResourceMap()).first;
  124|      0|            result = resgroup->second.emplace(res->getName(), res);
  125|      0|        }
  126|       |
  127|       |        // Attempt to resolve the collision
  128|  9.97k|        ResourceLoadingListener* listener = ResourceGroupManager::getSingleton().getLoadingListener();
  129|  9.97k|        if (!result.second && listener)
  ------------------
  |  Branch (129:13): [True: 0, False: 9.97k]
  |  Branch (129:31): [True: 0, False: 0]
  ------------------
  130|      0|        {
  131|      0|            if(listener->resourceCollision(res.get(), this) == false)
  ------------------
  |  Branch (131:16): [True: 0, False: 0]
  ------------------
  132|      0|            {
  133|       |                // explicitly use previous instance and destroy current
  134|      0|                res.reset();
  135|      0|                return;
  136|      0|            }
  137|       |
  138|       |            // Try to do the addition again, no seconds attempts to resolve collisions are allowed
  139|      0|            if(ResourceGroupManager::getSingleton().isResourceGroupInGlobalPool(res->getGroup()))
  ------------------
  |  Branch (139:16): [True: 0, False: 0]
  ------------------
  140|      0|            {
  141|      0|                result = mResources.emplace(res->getName(), res);
  142|      0|            }
  143|      0|            else
  144|      0|            {
  145|      0|                auto resgroup = mResourcesWithGroup.emplace(res->getGroup(), ResourceMap()).first;
  146|      0|                result = resgroup->second.emplace(res->getName(), res);
  147|      0|            }
  148|      0|        }
  149|       |
  150|  9.97k|        if (!result.second)
  ------------------
  |  Branch (150:13): [True: 0, False: 9.97k]
  ------------------
  151|      0|        {
  152|      0|            OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM, getResourceType()+" with the name " + res->getName() +
  153|      0|                " already exists.", "ResourceManager::add");
  154|      0|        }
  155|       |
  156|       |        // Insert the handle
  157|  9.97k|        std::pair<ResourceHandleMap::iterator, bool> resultHandle = mResourcesByHandle.emplace(res->getHandle(), res);
  158|  9.97k|        if (!resultHandle.second)
  ------------------
  |  Branch (158:13): [True: 0, False: 9.97k]
  ------------------
  159|      0|        {
  160|       |            OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM, getResourceType()+" with the handle " +
  161|      0|                StringConverter::toString((long) (res->getHandle())) +
  162|      0|                " already exists.", "ResourceManager::add");
  163|      0|        }
  164|  9.97k|    }
_ZN4Ogre15ResourceManager10removeImplERKNS_9SharedPtrINS_8ResourceEEE:
  167|  6.46k|    {
  168|  6.46k|        OgreAssert(res, "attempting to remove nullptr");
  ------------------
  |  Branch (168:9): [True: 0, False: 6.46k]
  ------------------
  169|       |
  170|  6.46k|#if OGRE_RESOURCEMANAGER_STRICT
  171|  6.46k|        if (res->getCreator() != this)
  ------------------
  |  Branch (171:13): [True: 0, False: 6.46k]
  ------------------
  172|  6.46k|            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Resource '" + res->getName() + "' was not created by the '" +
  173|  6.46k|                                                          getResourceType() + "' ResourceManager");
  174|  6.46k|#endif
  175|       |
  176|  6.46k|        OGRE_LOCK_AUTO_MUTEX;
  177|       |
  178|  6.46k|        if(ResourceGroupManager::getSingleton().isResourceGroupInGlobalPool(res->getGroup()))
  ------------------
  |  Branch (178:12): [True: 6.46k, False: 0]
  ------------------
  179|  6.46k|        {
  180|  6.46k|            ResourceMap::iterator nameIt = mResources.find(res->getName());
  181|  6.46k|            if (nameIt != mResources.end())
  ------------------
  |  Branch (181:17): [True: 6.46k, False: 0]
  ------------------
  182|  6.46k|            {
  183|  6.46k|                mResources.erase(nameIt);
  184|  6.46k|            }
  185|  6.46k|        }
  186|      0|        else
  187|      0|        {
  188|      0|            ResourceWithGroupMap::iterator groupIt = mResourcesWithGroup.find(res->getGroup());
  189|      0|            if (groupIt != mResourcesWithGroup.end())
  ------------------
  |  Branch (189:17): [True: 0, False: 0]
  ------------------
  190|      0|            {
  191|      0|                ResourceMap::iterator nameIt = groupIt->second.find(res->getName());
  192|      0|                if (nameIt != groupIt->second.end())
  ------------------
  |  Branch (192:21): [True: 0, False: 0]
  ------------------
  193|      0|                {
  194|      0|                    groupIt->second.erase(nameIt);
  195|      0|                }
  196|       |
  197|      0|                if (groupIt->second.empty())
  ------------------
  |  Branch (197:21): [True: 0, False: 0]
  ------------------
  198|      0|                {
  199|      0|                    mResourcesWithGroup.erase(groupIt);
  200|      0|                }
  201|      0|            }
  202|      0|        }
  203|       |
  204|  6.46k|        ResourceHandleMap::iterator handleIt = mResourcesByHandle.find(res->getHandle());
  205|  6.46k|        if (handleIt != mResourcesByHandle.end())
  ------------------
  |  Branch (205:13): [True: 6.46k, False: 0]
  ------------------
  206|  6.46k|        {
  207|  6.46k|            mResourcesByHandle.erase(handleIt);
  208|  6.46k|        }
  209|       |        // Tell resource group manager
  210|  6.46k|        ResourceGroupManager::getSingleton()._notifyResourceRemoved(res);
  211|  6.46k|    }
_ZN4Ogre15ResourceManager6removeERKNS_9SharedPtrINS_8ResourceEEE:
  298|  6.46k|    {
  299|  6.46k|        removeImpl(res);
  300|  6.46k|    }
_ZNK4Ogre15ResourceManager17getResourceByNameERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  368|   169k|    {
  369|   169k|        OGRE_LOCK_AUTO_MUTEX;
  370|       |
  371|       |        // resource should be in global pool
  372|   169k|        bool isGlobal = ResourceGroupManager::getSingleton().isResourceGroupInGlobalPool(groupName);
  373|       |
  374|   169k|        if(isGlobal)
  ------------------
  |  Branch (374:12): [True: 169k, False: 0]
  ------------------
  375|   169k|        {
  376|   169k|            auto it = mResources.find(name);
  377|   169k|            if( it != mResources.end())
  ------------------
  |  Branch (377:17): [True: 12.7k, False: 156k]
  ------------------
  378|  12.7k|            {
  379|  12.7k|                return it->second;
  380|  12.7k|            }
  381|   169k|        }
  382|       |
  383|       |        // look in all grouped pools
  384|   156k|        if (groupName == ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME)
  ------------------
  |  Branch (384:13): [True: 0, False: 156k]
  ------------------
  385|      0|        {
  386|      0|            for (auto& r : mResourcesWithGroup)
  ------------------
  |  Branch (386:26): [True: 0, False: 0]
  ------------------
  387|      0|            {
  388|      0|                auto resMapIt = r.second.find(name);
  389|       |
  390|      0|                if( resMapIt != r.second.end())
  ------------------
  |  Branch (390:21): [True: 0, False: 0]
  ------------------
  391|      0|                {
  392|      0|                    return resMapIt->second;
  393|      0|                }
  394|      0|            }
  395|      0|        }
  396|   156k|        else if (!isGlobal)
  ------------------
  |  Branch (396:18): [True: 0, False: 156k]
  ------------------
  397|      0|        {
  398|       |            // look in the grouped pool
  399|      0|            auto itGroup = mResourcesWithGroup.find(groupName);
  400|      0|            if (itGroup != mResourcesWithGroup.end())
  ------------------
  |  Branch (400:17): [True: 0, False: 0]
  ------------------
  401|      0|            {
  402|      0|                auto it = itGroup->second.find(name);
  403|       |
  404|      0|                if( it != itGroup->second.end())
  ------------------
  |  Branch (404:21): [True: 0, False: 0]
  ------------------
  405|      0|                {
  406|      0|                    return it->second;
  407|      0|                }
  408|      0|            }
  409|       |
  410|       |#if !OGRE_RESOURCEMANAGER_STRICT
  411|       |            // fall back to global
  412|       |            auto it = mResources.find(name);
  413|       |            if( it != mResources.end())
  414|       |            {
  415|       |                return it->second;
  416|       |            }
  417|       |#endif
  418|      0|        }
  419|       |    
  420|   156k|        return ResourcePtr();
  421|   156k|    }
_ZN4Ogre15ResourceManager13getNextHandleEv:
  431|  9.97k|    {
  432|       |        // This is an atomic operation and hence needs no locking
  433|  9.97k|        return mNextHandle++;
  434|  9.97k|    }
_ZN4Ogre15ResourceManager10checkUsageEv:
  437|  5.12k|    {
  438|  5.12k|        if (getMemoryUsage() > mMemoryBudget)
  ------------------
  |  Branch (438:13): [True: 0, False: 5.12k]
  ------------------
  439|      0|        {
  440|      0|            OGRE_LOCK_AUTO_MUTEX;
  441|       |            // unload unreferenced resources until we are within our budget again
  442|      0|            ResourceMap::iterator i, iend;
  443|      0|            iend = mResources.end();
  444|      0|            for (i = mResources.begin(); i != iend && getMemoryUsage() > mMemoryBudget; ++i)
  ------------------
  |  Branch (444:42): [True: 0, False: 0]
  |  Branch (444:55): [True: 0, False: 0]
  ------------------
  445|      0|            {
  446|       |                // A use count of 3 means that only RGM and RM have references
  447|       |                // RGM has one (this one) and RM has 2 (by name and by handle)
  448|      0|                if (i->second.use_count() == ResourceGroupManager::RESOURCE_SYSTEM_NUM_REFERENCE_COUNTS)
  ------------------
  |  Branch (448:21): [True: 0, False: 0]
  ------------------
  449|      0|                {
  450|      0|                    Resource* res = i->second.get();
  451|      0|                    if (res->isReloadable())
  ------------------
  |  Branch (451:25): [True: 0, False: 0]
  ------------------
  452|      0|                    {
  453|      0|                        res->unload();
  454|      0|                    }
  455|      0|                }
  456|      0|            }
  457|      0|        }
  458|  5.12k|    }
_ZN4Ogre15ResourceManager21_notifyResourceLoadedEPNS_8ResourceE:
  466|  5.12k|    {
  467|  5.12k|        mMemoryUsage += res->getSize();
  468|  5.12k|        checkUsage();
  469|  5.12k|    }
_ZN4Ogre15ResourceManager23_notifyResourceUnloadedEPNS_8ResourceE:
  472|  5.12k|    {
  473|  5.12k|        mMemoryUsage -= res->getSize();
  474|  5.12k|    }

_ZN4Ogre4Root15getSingletonPtrEv:
   86|   149k|    {
   87|   149k|        return msSingleton;
   88|   149k|    }

_ZN4Ogre10SerializerC2Ev:
   36|  32.9k|        mVersion("[Serializer_v1.00]"), // Version number
   37|  32.9k|        mFlipEndian(false)
   38|       |#if OGRE_SERIALIZER_VALIDATE_CHUNKSIZE
   39|       |        , mReportChunkErrors(true)
   40|       |#endif
   41|  32.9k|    {
   42|  32.9k|    }
_ZN4Ogre10SerializerD2Ev:
   46|  32.9k|    {
   47|  32.9k|    }
_ZN4Ogre10Serializer19determineEndiannessERKNS_9SharedPtrINS_10DataStreamEEE:
   50|  11.4k|    {
   51|  11.4k|        if (stream->tell() != 0)
  ------------------
  |  Branch (51:13): [True: 0, False: 11.4k]
  ------------------
   52|      0|        {
   53|      0|            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
   54|      0|                "Can only determine the endianness of the input stream if it "
   55|      0|                "is at the start", "Serializer::determineEndianness");
   56|      0|        }
   57|       |                
   58|  11.4k|        uint16 dest;
   59|       |        // read header id manually (no conversion)
   60|  11.4k|        size_t actually_read = stream->read(&dest, sizeof(uint16));
   61|       |        // skip back
   62|  11.4k|        stream->skip(0 - (long)actually_read);
   63|  11.4k|        if (actually_read != sizeof(uint16))
  ------------------
  |  Branch (63:13): [True: 4, False: 11.4k]
  ------------------
   64|      4|        {
   65|       |            // end of file?
   66|      4|            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
   67|      4|                        "Couldn't read 16 bit header value from input stream.",
   68|      4|                        "Serializer::determineEndianness");
   69|      4|        }
   70|  11.4k|        if (dest == HEADER_STREAM_ID)
  ------------------
  |  Branch (70:13): [True: 2.94k, False: 8.53k]
  ------------------
   71|  2.94k|        {
   72|  2.94k|            mFlipEndian = false;
   73|  2.94k|        }
   74|  8.53k|        else if (dest == OTHER_ENDIAN_HEADER_STREAM_ID)
  ------------------
  |  Branch (74:18): [True: 8.49k, False: 44]
  ------------------
   75|  8.49k|        {
   76|  8.49k|            mFlipEndian = true;
   77|  8.49k|        }
   78|     44|        else
   79|     44|        {
   80|       |            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
   81|     44|                "Header chunk didn't match either endian: Corrupted stream?",
   82|     44|                "Serializer::determineEndianness");
   83|     44|        }
   84|  11.4k|    }
_ZN4Ogre10Serializer14readFileHeaderERKNS_9SharedPtrINS_10DataStreamEEE:
  235|  5.02k|    {
  236|  5.02k|        unsigned short headerID;
  237|       |        
  238|       |        // Read header ID
  239|  5.02k|        readShorts(stream, &headerID, 1);
  240|       |        
  241|  5.02k|        if (headerID == HEADER_STREAM_ID)
  ------------------
  |  Branch (241:13): [True: 5.02k, False: 0]
  ------------------
  242|  5.02k|        {
  243|       |            // Read version
  244|  5.02k|            String ver = readString(stream);
  245|  5.02k|            if (ver != mVersion)
  ------------------
  |  Branch (245:17): [True: 0, False: 5.02k]
  ------------------
  246|      0|            {
  247|      0|                OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, 
  248|      0|                    "Invalid file: version incompatible, file reports " + String(ver) +
  249|      0|                    " Serializer is version " + mVersion,
  250|      0|                    "Serializer::readFileHeader");
  251|      0|            }
  252|  5.02k|        }
  253|      0|        else
  254|      0|        {
  255|      0|            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "Invalid file: no header", 
  256|      0|                "Serializer::readFileHeader");
  257|      0|        }
  258|       |
  259|  5.02k|    }
_ZN4Ogre10Serializer9readChunkERKNS_9SharedPtrINS_10DataStreamEEE:
  262|   871k|    {
  263|   871k|        size_t pos = stream->tell();
  264|   871k|        unsigned short id;
  265|   871k|        readShorts(stream, &id, 1);
  266|       |        
  267|   871k|        readInts(stream, &mCurrentstreamLen, 1);
  268|       |
  269|   871k|        if (!stream->eof())
  ------------------
  |  Branch (269:13): [True: 866k, False: 4.38k]
  ------------------
  270|   866k|        {
  271|       |            // chunk size cant be smaller than the header size, and must fit within the stream
  272|   866k|            if (mCurrentstreamLen < calcChunkHeaderSize() || pos + mCurrentstreamLen > stream->size())
  ------------------
  |  Branch (272:17): [True: 565, False: 866k]
  |  Branch (272:62): [True: 1.66k, False: 864k]
  ------------------
  273|   866k|                OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "Corrupt chunk length");
  274|   866k|        }
  275|       |
  276|       |#if OGRE_SERIALIZER_VALIDATE_CHUNKSIZE
  277|       |        if (!mChunkSizeStack.empty() && !stream->eof()){
  278|       |            if (pos != static_cast<size_t>(mChunkSizeStack.back()) && mReportChunkErrors){
  279|       |                LogManager::getSingleton().logMessage("Corrupted chunk detected! Stream name: '" + stream->getName() + "' Chunk id: " + StringConverter::toString(id));
  280|       |            }
  281|       |            mChunkSizeStack.back() = pos + mCurrentstreamLen;
  282|       |        }
  283|       |#endif
  284|   868k|        return id;
  285|   871k|    }
_ZN4Ogre10Serializer9readBoolsERKNS_9SharedPtrINS_10DataStreamEEEPbm:
  288|   367k|    {
  289|   367k|        static_assert(sizeof(bool) == 1, "add conversion to char for your platform");
  290|   367k|        stream->read(pDest, sizeof(bool) * count);
  291|       |        // Normalize raw bytes to canonical bool values (0 or 1).
  292|       |        // A non-zero byte that is not exactly 1 can cause miscompile bugs later
  293|   735k|        for (size_t i = 0; i < count; ++i)
  ------------------
  |  Branch (293:28): [True: 367k, False: 367k]
  ------------------
  294|   367k|        {
  295|   367k|            uint8_t raw;
  296|   367k|            memcpy(&raw, &pDest[i], 1);
  297|   367k|            pDest[i] = (raw != 0);
  298|   367k|        }
  299|   367k|    }
_ZN4Ogre10Serializer10readFloatsERKNS_9SharedPtrINS_10DataStreamEEEPfm:
  302|  47.3k|    {
  303|  47.3k|        stream->read(pDest, sizeof(float) * count);
  304|  47.3k|        flipFromLittleEndian(pDest, sizeof(float), count);
  305|  47.3k|    }
_ZN4Ogre10Serializer10readShortsERKNS_9SharedPtrINS_10DataStreamEEEPtm:
  323|  1.26M|    {
  324|  1.26M|        stream->read(pDest, sizeof(unsigned short) * count);
  325|  1.26M|        flipFromLittleEndian(pDest, sizeof(unsigned short), count);
  326|  1.26M|    }
_ZN4Ogre10Serializer8readIntsERKNS_9SharedPtrINS_10DataStreamEEEPjm:
  329|  1.24M|    {
  330|  1.24M|        stream->read(pDest, sizeof(uint32) * count);
  331|  1.24M|        flipFromLittleEndian(pDest, sizeof(uint32), count);
  332|  1.24M|    }
_ZN4Ogre10Serializer10readStringERKNS_9SharedPtrINS_10DataStreamEEE:
  335|   226k|    {
  336|   226k|        return stream->getLine(false);
  337|   226k|    }
_ZN4Ogre10Serializer10readObjectERKNS_9SharedPtrINS_10DataStreamEEERNS_6VectorILi3EfEE:
  356|  2.06k|    {
  357|  2.06k|        readFloats(stream, pDest.ptr(), 3);
  358|  2.06k|    }
_ZN4Ogre10Serializer10readObjectERKNS_9SharedPtrINS_10DataStreamEEERNS_10QuaternionE:
  361|  1.77k|    {
  362|  1.77k|        float tmp[4];
  363|  1.77k|        readFloats(stream, tmp, 4);
  364|  1.77k|        pDest.x = tmp[0];
  365|  1.77k|        pDest.y = tmp[1];
  366|  1.77k|        pDest.z = tmp[2];
  367|  1.77k|        pDest.w = tmp[3];
  368|  1.77k|    }
_ZN4Ogre10Serializer20flipFromLittleEndianEPvmm:
  381|  2.55M|    {
  382|  2.55M|        if(mFlipEndian)
  ------------------
  |  Branch (382:12): [True: 2.27M, False: 284k]
  ------------------
  383|  2.27M|        {
  384|  2.27M|	        Bitwise::bswapChunks(pData, size, count);
  385|  2.27M|        }
  386|  2.55M|    }
_ZN4Ogre10Serializer14pushInnerChunkERKNS_9SharedPtrINS_10DataStreamEEE:
  389|   402k|    {
  390|       |#if OGRE_SERIALIZER_VALIDATE_CHUNKSIZE
  391|       |        mChunkSizeStack.push_back(stream->tell());
  392|       |#endif
  393|   402k|    }
_ZN4Ogre10Serializer20backpedalChunkHeaderERKNS_9SharedPtrINS_10DataStreamEEE:
  395|   367k|    {
  396|   367k|        if (!stream->eof()){
  ------------------
  |  Branch (396:13): [True: 367k, False: 0]
  ------------------
  397|   367k|            stream->skip(-(int)calcChunkHeaderSize());
  398|   367k|        }
  399|       |#if OGRE_SERIALIZER_VALIDATE_CHUNKSIZE
  400|       |        mChunkSizeStack.back() = stream->tell();
  401|       |#endif
  402|   367k|    }
_ZN4Ogre10Serializer13popInnerChunkERKNS_9SharedPtrINS_10DataStreamEEE:
  404|   389k|    {
  405|       |#if OGRE_SERIALIZER_VALIDATE_CHUNKSIZE
  406|       |        if (!mChunkSizeStack.empty()){
  407|       |            size_t pos = stream->tell();
  408|       |            if (pos != static_cast<size_t>(mChunkSizeStack.back()) && !stream->eof() && mReportChunkErrors){
  409|       |                LogManager::getSingleton().logMessage("Corrupted chunk detected! Stream name: " + stream->getName());
  410|       |            }
  411|       |
  412|       |            mChunkSizeStack.pop_back();
  413|       |        }
  414|       |#endif
  415|   389k|    }

_ZN4Ogre8SkeletonC2EPNS_15ResourceManagerERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEmSB_bPNS_20ManualResourceLoaderE:
   49|  4.84k|        : Resource(creator, name, handle, group, isManual, loader), 
   50|  4.84k|        mBlendState(ANIMBLEND_AVERAGE)
   51|       |        // set animation blending to weighted, not cumulative
   52|  4.84k|    {
   53|  4.84k|        if (createParamDictionary("Skeleton"))
  ------------------
  |  Branch (53:13): [True: 1, False: 4.84k]
  ------------------
   54|      1|        {
   55|       |            // no custom params
   56|      1|        }
   57|  4.84k|    }
_ZN4Ogre8SkeletonD2Ev:
   60|  1.33k|    {
   61|       |        // have to call this here reather than in Resource destructor
   62|       |        // since calling virtual methods in base destructors causes crash
   63|  1.33k|        unload(); 
   64|  1.33k|    }
_ZN4Ogre8Skeleton11prepareImplEv:
   67|  16.2k|    {
   68|  16.2k|        SkeletonSerializer serializer;
   69|       |
   70|  16.2k|        if (getCreator()->getVerbose())
  ------------------
  |  Branch (70:13): [True: 16.2k, False: 0]
  ------------------
   71|  16.2k|            LogManager::getSingleton().stream() << "Skeleton: Loading " << mName;
   72|       |
   73|  16.2k|        DataStreamPtr stream = ResourceGroupManager::getSingleton().openResource(mName, mGroup, this);
   74|       |
   75|  16.2k|        serializer.importSkeleton(stream, this);
   76|       |
   77|       |        // Load any linked skeletons
   78|  16.2k|        for (auto& s : mLinkedSkeletonAnimSourceList)
  ------------------
  |  Branch (78:22): [True: 0, False: 16.2k]
  ------------------
   79|      0|        {
   80|      0|            s.pSkeleton = static_pointer_cast<Skeleton>(
   81|      0|                SkeletonManager::getSingleton().prepare(s.skeletonName, mGroup));
   82|      0|        }
   83|  16.2k|    }
_ZN4Ogre8Skeleton13unprepareImplEv:
   86|  17.5k|    {
   87|       |        // destroy bones
   88|  17.5k|        for (auto *b : mBoneList)
  ------------------
  |  Branch (88:22): [True: 814, False: 17.5k]
  ------------------
   89|    814|        {
   90|    814|            OGRE_DELETE b;
   91|    814|        }
   92|  17.5k|        mBoneList.clear();
   93|  17.5k|        mBoneListByName.clear();
   94|  17.5k|        mRootBones.clear();
   95|  17.5k|        mManualBones.clear();
   96|  17.5k|        mManualBonesDirty = false;
   97|       |
   98|       |        // Destroy animations
   99|  17.5k|        for (auto& ai : mAnimationsList)
  ------------------
  |  Branch (99:23): [True: 2.63k, False: 17.5k]
  ------------------
  100|  2.63k|        {
  101|  2.63k|            OGRE_DELETE ai.second;
  102|  2.63k|        }
  103|  17.5k|        mAnimationsList.clear();
  104|       |
  105|       |        // Remove all linked skeletons
  106|  17.5k|        mLinkedSkeletonAnimSourceList.clear();
  107|  17.5k|    }
_ZN4Ogre8Skeleton10createBoneERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEt:
  125|    822|    {
  126|    822|        OgreAssert(handle < OGRE_MAX_NUM_BONES, "Exceeded the maximum number of bones per skeleton");
  ------------------
  |  Branch (126:9): [True: 0, False: 822]
  ------------------
  127|       |        // Check handle not used
  128|    822|        if (handle < mBoneList.size() && mBoneList[handle] != NULL)
  ------------------
  |  Branch (128:13): [True: 5, False: 817]
  |  Branch (128:42): [True: 5, False: 0]
  ------------------
  129|      5|        {
  130|      5|            OGRE_EXCEPT(
  131|      5|                Exception::ERR_DUPLICATE_ITEM,
  132|      5|                "A bone with the handle " + StringConverter::toString(handle) + " already exists",
  133|      5|                "Skeleton::createBone" );
  134|      5|        }
  135|       |        // Check name not used
  136|    817|        if (mBoneListByName.find(name) != mBoneListByName.end())
  ------------------
  |  Branch (136:13): [True: 3, False: 814]
  ------------------
  137|      3|        {
  138|      3|            OGRE_EXCEPT(
  139|      3|                Exception::ERR_DUPLICATE_ITEM,
  140|      3|                "A bone with the name " + name + " already exists",
  141|      3|                "Skeleton::createBone" );
  142|      3|        }
  143|    814|        Bone* ret = OGRE_NEW Bone(name, handle, this);
  144|    814|        if (mBoneList.size() <= handle)
  ------------------
  |  Branch (144:13): [True: 814, False: 0]
  ------------------
  145|    814|        {
  146|    814|            mBoneList.resize(handle+1);
  147|    814|        }
  148|    814|        mBoneList[handle] = ret;
  149|    814|        mBoneListByName[name] = ret;
  150|    814|        return ret;
  151|    817|    }
_ZN4Ogre8Skeleton14setBindingPoseEv:
  223|    742|    {
  224|       |        // Update the derived transforms
  225|    742|        _updateTransforms();
  226|       |
  227|    742|        for (auto *b : mBoneList)
  ------------------
  |  Branch (227:22): [True: 667, False: 742]
  ------------------
  228|    667|        {            
  229|    667|            b->setBindingPose();
  230|    667|        }
  231|    742|    }
_ZN4Ogre8Skeleton15createAnimationERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEf:
  243|  2.63k|    {
  244|       |        // Check name not used
  245|  2.63k|        if (mAnimationsList.find(name) != mAnimationsList.end())
  ------------------
  |  Branch (245:13): [True: 4, False: 2.63k]
  ------------------
  246|      4|        {
  247|      4|            OGRE_EXCEPT(
  248|      4|                Exception::ERR_DUPLICATE_ITEM,
  249|      4|                "An animation with the name " + name + " already exists",
  250|      4|                "Skeleton::createAnimation");
  251|      4|        }
  252|       |
  253|  2.63k|        Animation* ret = OGRE_NEW Animation(name, length);
  254|  2.63k|        ret->_notifyContainer(this);
  255|       |
  256|       |        // Add to list
  257|  2.63k|        mAnimationsList[name] = ret;
  258|       |
  259|  2.63k|        return ret;
  260|       |
  261|  2.63k|    }
_ZN4Ogre8Skeleton17_updateTransformsEv:
  548|    742|    {
  549|    742|        for (auto *b : mRootBones)
  ------------------
  |  Branch (549:22): [True: 0, False: 742]
  ------------------
  550|      0|        {
  551|      0|            b->_update(true, false);
  552|      0|        }
  553|    742|        mManualBonesDirty = false;
  554|    742|    }
_ZN4Ogre8Skeleton32addLinkedSkeletonAnimationSourceERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEf:
  591|    191|    {
  592|       |        // Check not already linked
  593|    191|        for (auto& l : mLinkedSkeletonAnimSourceList)
  ------------------
  |  Branch (593:22): [True: 0, False: 191]
  ------------------
  594|      0|        {
  595|      0|            if (skelName == l.skeletonName)
  ------------------
  |  Branch (595:17): [True: 0, False: 0]
  ------------------
  596|      0|                return; // don't bother
  597|      0|        }
  598|       |
  599|    191|        if (isPrepared() || isLoaded())
  ------------------
  |  Branch (599:13): [True: 191, False: 0]
  |  Branch (599:29): [True: 0, False: 0]
  ------------------
  600|    191|        {
  601|       |            // Load immediately
  602|    191|            SkeletonPtr skelPtr = static_pointer_cast<Skeleton>(
  603|    191|                SkeletonManager::getSingleton().prepare(skelName, mGroup));
  604|    191|            mLinkedSkeletonAnimSourceList.push_back(
  605|    191|                LinkedSkeletonAnimationSource(skelName, scale, skelPtr));
  606|       |
  607|    191|        }
  608|      0|        else
  609|      0|        {
  610|       |            // Load later
  611|      0|            mLinkedSkeletonAnimSourceList.push_back(
  612|      0|                LinkedSkeletonAnimationSource(skelName, scale));
  613|      0|        }
  614|       |
  615|    191|    }

_ZN4Ogre15SkeletonManager12getSingletonEv:
   40|  18.8k|    {  
   41|       |        assert( msSingleton );  return ( *msSingleton );  
   42|  18.8k|    }
_ZN4Ogre15SkeletonManagerC2Ev:
   45|      1|    {
   46|      1|        mLoadOrder = 300.0f;
   47|      1|        mResourceType = "Skeleton";
   48|       |
   49|      1|        ResourceGroupManager::getSingleton()._registerResourceManager(mResourceType, this);
   50|      1|    }
_ZN4Ogre15SkeletonManager6createERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_bPNS_20ManualResourceLoaderEPKNS1_3mapIS7_S7_NS1_4lessIS7_EENS5_INS1_4pairIS8_S7_EEEEEE:
   60|  1.33k|    {
   61|  1.33k|        return static_pointer_cast<Skeleton>(createResource(name,group,isManual,loader,createParams));
   62|  1.33k|    }
_ZN4Ogre15SkeletonManager10createImplERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEmS9_bPNS_20ManualResourceLoaderEPKNS1_3mapIS7_S7_NS1_4lessIS7_EENS5_INS1_4pairIS8_S7_EEEEEE:
   72|  4.84k|    {
   73|       |        return OGRE_NEW Skeleton(this, name, handle, group, isManual, loader);
   74|  4.84k|    }

_ZN4Ogre18SkeletonSerializerC2Ev:
   42|  17.5k|    {
   43|       |        // Version number
   44|       |        // NB changed to include bone names in 1.1
   45|  17.5k|        mVersion = "[Unknown]";
   46|  17.5k|    }
_ZN4Ogre18SkeletonSerializer14importSkeletonERNS_9SharedPtrINS_10DataStreamEEEPNS_8SkeletonE:
  105|  1.33k|    {
  106|       |        // Determine endianness (must be the first thing we do!)
  107|  1.33k|        determineEndianness(stream);
  108|       |
  109|       |        // Check header
  110|  1.33k|        unsigned short headerID;
  111|  1.33k|        readShorts(stream, &headerID, 1);
  112|  1.33k|        if (headerID != HEADER_STREAM_ID_EXT)
  ------------------
  |  Branch (112:13): [True: 0, False: 1.33k]
  ------------------
  113|      0|        {
  114|      0|            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "File header not found",
  115|      0|                "SkeletonSerializer::importSkeleton");
  116|      0|        }
  117|       |
  118|       |        // Read version
  119|  1.33k|        String ver = readString(stream);
  120|  1.33k|        if ((ver != "[Serializer_v1.10]") &&
  ------------------
  |  Branch (120:13): [True: 1.26k, False: 70]
  ------------------
  121|  1.26k|            (ver != "[Serializer_v1.80]"))
  ------------------
  |  Branch (121:13): [True: 122, False: 1.14k]
  ------------------
  122|    122|        {
  123|    122|            OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR,
  124|    122|                "Invalid file: version incompatible, file reports " + String(ver),
  125|    122|                "SkeletonSerializer::importSkeleton");
  126|    122|        }
  127|  1.21k|        mVersion = ver;
  128|       |
  129|  1.21k|        pushInnerChunk(stream);
  130|  1.21k|        unsigned short streamID = readChunk(stream);
  131|       |
  132|  5.18k|        while(!stream->eof())
  ------------------
  |  Branch (132:15): [True: 4.30k, False: 878]
  ------------------
  133|  4.30k|        {
  134|  4.30k|            switch (streamID)
  135|  4.30k|            {
  136|    247|            case SKELETON_BLENDMODE:
  ------------------
  |  Branch (136:13): [True: 247, False: 4.06k]
  ------------------
  137|    247|            {
  138|       |                // Optional blend mode
  139|    247|                uint16 blendMode;
  140|    247|                readShorts(stream, &blendMode, 1);
  141|    247|                pSkel->setBlendMode(static_cast<SkeletonAnimationBlendMode>(blendMode));
  142|    247|                break;
  143|      0|            }
  144|    842|            case SKELETON_BONE:
  ------------------
  |  Branch (144:13): [True: 842, False: 3.46k]
  ------------------
  145|    842|                readBone(stream, pSkel);
  146|    842|                break;
  147|     41|            case SKELETON_BONE_PARENT:
  ------------------
  |  Branch (147:13): [True: 41, False: 4.26k]
  ------------------
  148|     41|                readBoneParent(stream, pSkel);
  149|     41|                break;
  150|  2.63k|            case SKELETON_ANIMATION:
  ------------------
  |  Branch (150:13): [True: 2.63k, False: 1.67k]
  ------------------
  151|  2.63k|                readAnimation(stream, pSkel);
  152|  2.63k|                break;
  153|    191|            case SKELETON_ANIMATION_LINK:
  ------------------
  |  Branch (153:13): [True: 191, False: 4.11k]
  ------------------
  154|    191|                readSkeletonAnimationLink(stream, pSkel);
  155|    191|                break;
  156|    349|            default:
  ------------------
  |  Branch (156:13): [True: 349, False: 3.95k]
  ------------------
  157|    349|                break;
  158|  4.30k|            }
  159|       |
  160|  3.96k|            streamID = readChunk(stream);
  161|  3.96k|        }
  162|       |        // Assume bones are stored in the binding pose
  163|    878|        pSkel->setBindingPose();
  164|    878|        popInnerChunk(stream);
  165|       |
  166|    878|    }
_ZN4Ogre18SkeletonSerializer24calcBoneSizeWithoutScaleEPKNS_8SkeletonEPKNS_4BoneE:
  337|    814|    {
  338|    814|        size_t size = SSTREAM_OVERHEAD_SIZE;
  339|       |
  340|       |        // TODO: Add this for next skeleton format!
  341|       |        // Currently it is broken, because to determine that we have scale, it will compare chunk size.
  342|       |        //size += calcStringSize(pBone->getName());
  343|       |
  344|       |        // handle
  345|    814|        size += sizeof(unsigned short);
  346|       |
  347|       |        // position
  348|    814|        size += sizeof(float) * 3;
  349|       |
  350|       |        // orientation
  351|    814|        size += sizeof(float) * 4;
  352|       |
  353|    814|        return size;
  354|    814|    }
_ZN4Ogre18SkeletonSerializer28calcKeyFrameSizeWithoutScaleEPKNS_8SkeletonEPKNS_17TransformKeyFrameE:
  432|    962|    {
  433|    962|        size_t size = SSTREAM_OVERHEAD_SIZE;
  434|       |
  435|       |        // float time                    : The time position (seconds)
  436|    962|        size += sizeof(float);
  437|       |        // Quaternion rotate            : Rotation to apply at this keyframe
  438|    962|        size += sizeof(float) * 4;
  439|       |        // Vector3 translate            : Translation to apply at this keyframe
  440|    962|        size += sizeof(float) * 3;
  441|       |
  442|    962|        return size;
  443|    962|    }
_ZN4Ogre18SkeletonSerializer8readBoneERNS_9SharedPtrINS_10DataStreamEEEPNS_8SkeletonE:
  446|    842|    {
  447|       |        // char* name
  448|    842|        String name = readString(stream);
  449|       |        // unsigned short handle            : handle of the bone, should be contiguous & start at 0
  450|    842|        unsigned short handle;
  451|    842|        readShorts(stream, &handle, 1);
  452|       |
  453|    842|        if (handle > pSkel->getNumBones())
  ------------------
  |  Branch (453:13): [True: 20, False: 822]
  ------------------
  454|    842|            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Bone handles must be contiguous");
  455|       |
  456|       |        // Create new bone
  457|    822|        Bone* pBone = pSkel->createBone(name, handle);
  458|       |
  459|       |        // Vector3 position                 : position of this bone relative to parent 
  460|    822|        Vector3 pos;
  461|    822|        readObject(stream, pos);
  462|    822|        pBone->setPosition(pos);
  463|       |        // Quaternion orientation           : orientation of this bone relative to parent 
  464|    822|        Quaternion q;
  465|    822|        readObject(stream, q);
  466|    822|        pBone->setOrientation(q);
  467|       |
  468|       |#if OGRE_SERIALIZER_VALIDATE_CHUNKSIZE
  469|       |        // Hack to fix chunk size validation:
  470|       |        mChunkSizeStack.back() += calcStringSize(name);
  471|       |#endif
  472|       |        // TODO: don't depend on mCurrentstreamLen in next skeleton format!
  473|       |        // Currently we use wrong chunk sizes, but we can't fix it, because we depend on mCurrentstreamLen
  474|       |        // Do we have scale?
  475|    822|        if (mCurrentstreamLen > calcBoneSizeWithoutScale(pSkel, pBone))
  ------------------
  |  Branch (475:13): [True: 23, False: 799]
  ------------------
  476|     23|        {
  477|     23|            Vector3 scale;
  478|     23|            readObject(stream, scale);
  479|     23|            pBone->setScale(scale);
  480|     23|        }
  481|       |        
  482|    822|    }
_ZN4Ogre18SkeletonSerializer14readBoneParentERNS_9SharedPtrINS_10DataStreamEEEPNS_8SkeletonE:
  485|     41|    {
  486|       |        // All bones have been created by this point
  487|     41|        Bone *child, *parent;
  488|     41|        unsigned short childHandle, parentHandle;
  489|       |
  490|       |        // unsigned short handle             : child bone
  491|     41|        readShorts(stream, &childHandle, 1);
  492|       |        // unsigned short parentHandle   : parent bone
  493|     41|        readShorts(stream, &parentHandle, 1);
  494|       |
  495|     41|        auto numBones = pSkel->getBones().size();
  496|     41|        if (parentHandle >= numBones || childHandle >= numBones)
  ------------------
  |  Branch (496:13): [True: 12, False: 29]
  |  Branch (496:41): [True: 13, False: 16]
  ------------------
  497|     41|            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Bone handle out of range");
  498|       |
  499|     16|        if (childHandle == parentHandle)
  ------------------
  |  Branch (499:13): [True: 3, False: 13]
  ------------------
  500|     16|            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "A bone cannot be parent of itself");
  501|       |
  502|       |        // Find bones
  503|     13|        parent = pSkel->getBone(parentHandle);
  504|     13|        child = pSkel->getBone(childHandle);
  505|       |
  506|       |        // attach
  507|     13|        parent->addChild(child);
  508|       |
  509|     13|    }
_ZN4Ogre18SkeletonSerializer13readAnimationERNS_9SharedPtrINS_10DataStreamEEEPNS_8SkeletonE:
  512|  2.63k|    {
  513|       |        // char* name                       : Name of the animation
  514|  2.63k|        String name;
  515|  2.63k|        name = readString(stream);
  516|       |        // float length                      : Length of the animation in seconds
  517|  2.63k|        float len;
  518|  2.63k|        readFloats(stream, &len, 1);
  519|       |
  520|  2.63k|        Animation *pAnim = pSkel->createAnimation(name, len);
  521|       |        // Read all tracks
  522|  2.63k|        if (!stream->eof())
  ------------------
  |  Branch (522:13): [True: 2.40k, False: 237]
  ------------------
  523|  2.40k|        {
  524|  2.40k|            pushInnerChunk(stream);
  525|  2.40k|            unsigned short streamID = readChunk(stream);
  526|       |            // Optional base info is possible
  527|  2.40k|            if (streamID == SKELETON_ANIMATION_BASEINFO)
  ------------------
  |  Branch (527:17): [True: 89, False: 2.31k]
  ------------------
  528|     89|            {
  529|       |                // char baseAnimationName
  530|     89|                String baseAnimName = readString(stream);
  531|       |                // float baseKeyFrameTime
  532|     89|                float baseKeyTime;
  533|     89|                readFloats(stream, &baseKeyTime, 1);
  534|       |                
  535|     89|                pAnim->setUseBaseKeyFrame(true, baseKeyTime, baseAnimName);
  536|       |                
  537|     89|                if (!stream->eof())
  ------------------
  |  Branch (537:21): [True: 83, False: 6]
  ------------------
  538|     83|                {
  539|       |                    // Get next stream
  540|     83|                    streamID = readChunk(stream);
  541|     83|                }
  542|     89|            }
  543|       |            
  544|  2.62k|            while(streamID == SKELETON_ANIMATION_TRACK && !stream->eof())
  ------------------
  |  Branch (544:19): [True: 281, False: 2.33k]
  |  Branch (544:59): [True: 219, False: 62]
  ------------------
  545|    219|            {
  546|    219|                readAnimationTrack(stream, pAnim, pSkel);
  547|       |
  548|    219|                if (!stream->eof())
  ------------------
  |  Branch (548:21): [True: 129, False: 90]
  ------------------
  549|    129|                {
  550|       |                    // Get next stream
  551|    129|                    streamID = readChunk(stream);
  552|    129|                }
  553|    219|            }
  554|  2.40k|            if (!stream->eof())
  ------------------
  |  Branch (554:17): [True: 2.18k, False: 213]
  ------------------
  555|  2.18k|            {
  556|       |                // Backpedal back to start of this stream if we've found a non-track
  557|  2.18k|                backpedalChunkHeader(stream);
  558|  2.18k|            }
  559|  2.40k|            popInnerChunk(stream);
  560|  2.40k|        }
  561|  2.63k|    }
_ZN4Ogre18SkeletonSerializer18readAnimationTrackERNS_9SharedPtrINS_10DataStreamEEEPNS_9AnimationEPNS_8SkeletonE:
  565|    219|    {
  566|       |        // unsigned short boneIndex     : Index of bone to apply to
  567|    219|        unsigned short boneHandle;
  568|    219|        readShorts(stream, &boneHandle, 1);
  569|       |
  570|       |        // Find bone
  571|    219|        if (boneHandle >= pSkel->getBones().size())
  ------------------
  |  Branch (571:13): [True: 18, False: 201]
  ------------------
  572|    219|            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Animation track boneHandle out of range");
  573|    201|        Bone* targetBone = pSkel->getBone(boneHandle);
  574|       |
  575|       |        // Create track
  576|    201|        NodeAnimationTrack* pTrack = anim->createNodeTrack(boneHandle, targetBone);
  577|       |
  578|       |        // Keep looking for nested keyframes
  579|    201|        if (!stream->eof())
  ------------------
  |  Branch (579:13): [True: 196, False: 5]
  ------------------
  580|    196|        {
  581|    196|            pushInnerChunk(stream);
  582|    196|            unsigned short streamID = readChunk(stream);
  583|  1.15k|            while(streamID == SKELETON_ANIMATION_TRACK_KEYFRAME && !stream->eof())
  ------------------
  |  Branch (583:19): [True: 994, False: 164]
  |  Branch (583:68): [True: 962, False: 32]
  ------------------
  584|    962|            {
  585|    962|                readKeyFrame(stream, pTrack, pSkel);
  586|       |
  587|    962|                if (!stream->eof())
  ------------------
  |  Branch (587:21): [True: 934, False: 28]
  ------------------
  588|    934|                {
  589|       |                    // Get next stream
  590|    934|                    streamID = readChunk(stream);
  591|    934|                }
  592|    962|            }
  593|    196|            if (!stream->eof())
  ------------------
  |  Branch (593:17): [True: 129, False: 67]
  ------------------
  594|    129|            {
  595|       |                // Backpedal back to start of this stream if we've found a non-keyframe
  596|    129|                backpedalChunkHeader(stream);
  597|    129|            }
  598|    196|            popInnerChunk(stream);
  599|    196|        }
  600|       |
  601|       |
  602|    201|    }
_ZN4Ogre18SkeletonSerializer12readKeyFrameERNS_9SharedPtrINS_10DataStreamEEEPNS_18NodeAnimationTrackEPNS_8SkeletonE:
  606|    962|    {
  607|       |        // float time                    : The time position (seconds)
  608|    962|        float time;
  609|    962|        readFloats(stream, &time, 1);
  610|       |
  611|    962|        TransformKeyFrame *kf = track->createNodeKeyFrame(time);
  612|       |
  613|       |        // Quaternion rotate            : Rotation to apply at this keyframe
  614|    962|        Quaternion rot;
  615|    962|        readObject(stream, rot);
  616|    962|        kf->setRotation(rot);
  617|       |        // Vector3 translate            : Translation to apply at this keyframe
  618|    962|        Vector3 trans;
  619|    962|        readObject(stream, trans);
  620|    962|        kf->setTranslate(trans);
  621|       |        // Do we have scale?
  622|    962|        if (mCurrentstreamLen > calcKeyFrameSizeWithoutScale(pSkel, kf))
  ------------------
  |  Branch (622:13): [True: 266, False: 696]
  ------------------
  623|    266|        {
  624|    266|            Vector3 scale;
  625|    266|            readObject(stream, scale);
  626|    266|            kf->setScale(scale);
  627|    266|        }
  628|    962|    }
_ZN4Ogre18SkeletonSerializer25readSkeletonAnimationLinkERNS_9SharedPtrINS_10DataStreamEEEPNS_8SkeletonE:
  659|    191|    {
  660|       |        // char* skeletonName
  661|    191|        String skelName = readString(stream);
  662|       |        // float scale
  663|    191|        float scale;
  664|    191|        readFloats(stream, &scale, 1);
  665|       |
  666|    191|        pSkel->addLinkedSkeletonAnimationSource(skelName, scale);
  667|       |
  668|    191|    }

_ZN4Ogre16StreamSerialiserC2ERKNS_9SharedPtrINS_10DataStreamEEENS0_6EndianEbNS0_17RealStorageFormatE:
  109|    418|        : mStream(stream)
  110|    418|        , mEndian(endianMode)
  111|    418|        , mFlipEndian(false)
  112|    418|        , mReadWriteHeader(autoHeader)
  113|    418|        , mRealFormat(realFormat)
  114|    418|    {
  115|    418|        if (mEndian != ENDIAN_AUTO)
  ------------------
  |  Branch (115:13): [True: 0, False: 418]
  ------------------
  116|      0|        {
  117|       |#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
  118|       |            if (mEndian == ENDIAN_LITTLE)
  119|       |                mFlipEndian = true;
  120|       |#else
  121|      0|            if (mEndian == ENDIAN_BIG)
  ------------------
  |  Branch (121:17): [True: 0, False: 0]
  ------------------
  122|      0|                mFlipEndian = true;
  123|      0|#endif
  124|       |
  125|      0|        }
  126|       |
  127|       |        OgreAssert(mStream, "Stream is null");
  ------------------
  |  Branch (127:9): [True: 0, False: 418]
  ------------------
  128|    418|    }
_ZN4Ogre16StreamSerialiserD2Ev:
  131|    418|    {
  132|       |        // really this should be empty if read/write was complete, but be tidy
  133|    418|        if (!mChunkStack.empty())
  ------------------
  |  Branch (133:13): [True: 3, False: 415]
  ------------------
  134|      3|        {
  135|      3|            LogManager::getSingleton().stream(LML_WARNING) <<
  136|      3|                "Warning: stream " << mStream->getName() << " was not fully read / written; " <<
  137|      3|                mChunkStack.size() << " chunks remain unterminated.";
  138|      3|        }
  139|    418|        for (auto & i : mChunkStack)
  ------------------
  |  Branch (139:23): [True: 3, False: 418]
  ------------------
  140|      3|            delete i;
  141|    418|        mChunkStack.clear();
  142|       |
  143|    418|    }
_ZN4Ogre16StreamSerialiser14makeIdentifierERA5_Kc:
  146|      2|    {
  147|      2|        uint32 ret = 0;
  148|     10|        for (size_t i = 0; i < 4; ++i)
  ------------------
  |  Branch (148:28): [True: 8, False: 2]
  ------------------
  149|      8|        {
  150|      8|            ret += (code[i] << (i * 8));
  151|      8|        }
  152|      2|        return ret;
  153|       |
  154|      2|    }
_ZN4Ogre16StreamSerialiser14readChunkBeginEv:
  165|  1.57k|    {
  166|       |        // Have we figured out the endian mode yet?
  167|  1.57k|        if (mReadWriteHeader)
  ------------------
  |  Branch (167:13): [True: 418, False: 1.15k]
  ------------------
  168|    418|            readHeader();
  169|       |
  170|  1.57k|        OgreAssert(mEndian != ENDIAN_AUTO,
  ------------------
  |  Branch (170:9): [True: 0, False: 1.57k]
  ------------------
  171|  1.57k|                   "Endian mode has not been determined, did you disable header without setting?");
  172|       |
  173|  1.57k|        Chunk* chunk = readChunkImpl();
  174|  1.57k|        mChunkStack.push_back(chunk);
  175|       |
  176|  1.57k|        return chunk;
  177|       |
  178|  1.57k|    }
_ZN4Ogre16StreamSerialiser12readChunkEndEj:
  239|  1.03k|    {
  240|  1.03k|        Chunk* c = popChunk(id);
  241|       |
  242|  1.03k|        OgreAssert(mStream, "Stream is null");
  ------------------
  |  Branch (242:9): [True: 0, False: 1.03k]
  ------------------
  243|       |
  244|       |        // skip to the end of the chunk if we were not there already
  245|       |        // this lets us quite reading a chunk anywhere and have the read marker
  246|       |        // automatically skip to the next one
  247|  1.03k|        if (mStream->tell() < (c->offset + CHUNK_HEADER_SIZE + c->length))
  ------------------
  |  Branch (247:13): [True: 110, False: 927]
  ------------------
  248|    110|            mStream->seek(c->offset + CHUNK_HEADER_SIZE + c->length);
  249|       |
  250|       |        OGRE_DELETE c;
  251|  1.03k|    }
_ZN4Ogre16StreamSerialiser10readHeaderEv:
  261|    418|    {
  262|    418|        uint32 headerid = 0;
  263|    418|        size_t actually_read = mStream->read(&headerid, sizeof(uint32));
  264|       |        // skip back
  265|    418|        mStream->skip(0 - (long)actually_read);
  266|       |        // validate that this is a header chunk
  267|    418|        if (headerid == REVERSE_HEADER_ID)
  ------------------
  |  Branch (267:13): [True: 31, False: 387]
  ------------------
  268|     31|        {
  269|     31|            mFlipEndian = true;
  270|     31|        }
  271|    387|        else if (headerid == HEADER_ID)
  ------------------
  |  Branch (271:18): [True: 298, False: 89]
  ------------------
  272|    298|        {
  273|    298|            mFlipEndian = false;
  274|    298|        }
  275|     89|        else
  276|     89|        {
  277|       |            // no good
  278|     89|            OGRE_EXCEPT(Exception::ERR_INVALID_STATE, 
  279|     89|                "Cannot determine endian mode because header is missing", 
  280|     89|                "StreamSerialiser::readHeader");
  281|     89|        }
  282|    329|        determineEndianness();
  283|       |
  284|    329|        mReadWriteHeader = false;
  285|       |
  286|    329|        const Chunk* c = readChunkBegin();
  287|       |        // endian should be flipped now
  288|    329|        assert(c->id == HEADER_ID);
  289|    329|        (void)c; // Silence warning
  290|       |
  291|       |        // read real storage format
  292|    329|        bool realIsDouble;
  293|    329|        read(&realIsDouble);
  294|    329|        mRealFormat = realIsDouble? REAL_DOUBLE : REAL_FLOAT;
  ------------------
  |  Branch (294:23): [True: 55, False: 274]
  ------------------
  295|       |
  296|    329|        readChunkEnd(HEADER_ID);
  297|       |
  298|    329|    }
_ZN4Ogre16StreamSerialiser19determineEndiannessEv:
  301|    329|    {
  302|       |#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
  303|       |        if (mFlipEndian)
  304|       |            mEndian = ENDIAN_LITTLE;
  305|       |        else
  306|       |            mEndian = ENDIAN_BIG;
  307|       |#else
  308|    329|        if (mFlipEndian)
  ------------------
  |  Branch (308:13): [True: 31, False: 298]
  ------------------
  309|     31|            mEndian = ENDIAN_BIG;
  310|    298|        else
  311|    298|            mEndian = ENDIAN_LITTLE;
  312|    329|#endif
  313|    329|    }
_ZNK4Ogre16StreamSerialiser11checkStreamEbbb:
  330|  8.58k|    {
  331|  8.58k|        OgreAssert(mStream, "Stream is null");
  ------------------
  |  Branch (331:9): [True: 0, False: 8.58k]
  ------------------
  332|       |
  333|  8.58k|        if (failOnEof && mStream->eof())
  ------------------
  |  Branch (333:13): [True: 8.58k, False: 0]
  |  Branch (333:26): [True: 398, False: 8.18k]
  ------------------
  334|  8.58k|            OGRE_EXCEPT(Exception::ERR_INVALID_STATE, "Invalid operation, end of file on stream");
  335|       |
  336|  8.18k|        if (validateReadable && !mStream->isReadable())
  ------------------
  |  Branch (336:13): [True: 8.18k, False: 0]
  |  Branch (336:33): [True: 0, False: 8.18k]
  ------------------
  337|  8.18k|            OGRE_EXCEPT(Exception::ERR_INVALID_STATE, "Invalid operation, file is not readable");
  338|       |
  339|  8.18k|        if (validateWriteable && !mStream->isWriteable())
  ------------------
  |  Branch (339:13): [True: 0, False: 8.18k]
  |  Branch (339:34): [True: 0, False: 0]
  ------------------
  340|       |            OGRE_EXCEPT(Exception::ERR_INVALID_STATE, "Invalid operation, file is not writeable");
  341|  8.18k|    }
_ZN4Ogre16StreamSerialiser13readChunkImplEv:
  421|  1.36k|    {
  422|  1.36k|        auto chunk = std::make_unique<Chunk>();
  423|  1.36k|        chunk->offset = static_cast<uint32>(mStream->tell());
  424|  1.36k|        read(&chunk->id);
  425|  1.36k|        read(&chunk->version);
  426|  1.36k|        read(&chunk->length);
  427|       |
  428|  1.36k|        if (chunk->length > mStream->size() - mStream->tell())
  ------------------
  |  Branch (428:13): [True: 44, False: 1.31k]
  ------------------
  429|  1.36k|            OGRE_EXCEPT(Exception::ERR_INVALID_STATE, "Chunk length field exceeds remaining stream data");
  430|       |
  431|  1.31k|        uint32 checksum;
  432|  1.31k|        read(&checksum);
  433|       |        
  434|  1.31k|        if (checksum != calculateChecksum(chunk.get()))
  ------------------
  |  Branch (434:13): [True: 124, False: 1.19k]
  ------------------
  435|    124|        {
  436|       |            // no good, this is an invalid chunk
  437|    124|            uint32 off = chunk->offset;
  438|    124|            OGRE_EXCEPT(Exception::ERR_INVALID_STATE, 
  439|    124|                "Corrupt chunk detected in stream " + mStream->getName() + " at byte "
  440|    124|                + StringConverter::toString(off), 
  441|    124|                "StreamSerialiser::readChunkImpl");
  442|    124|        }
  443|       |
  444|  1.19k|        return chunk.release();
  445|       |
  446|       |
  447|  1.31k|    }
_ZN4Ogre16StreamSerialiser8readDataEPvmm:
  617|  8.58k|    {
  618|  8.58k|        checkStream(true, true, false);
  619|       |
  620|  8.58k|        size_t totSize = size * count;
  621|  8.58k|        mStream->read(buf, totSize);
  622|       |
  623|  8.58k|        if (mFlipEndian)
  ------------------
  |  Branch (623:13): [True: 111, False: 8.47k]
  ------------------
  624|    111|			Bitwise::bswapChunks(buf, size, count);
  625|       |
  626|  8.58k|    }
_ZN4Ogre16StreamSerialiser4readEPNS_6VectorILi3EfEEm:
  637|    827|    {
  638|  1.65k|        for (size_t i = 0; i < count; ++i, ++vec)
  ------------------
  |  Branch (638:28): [True: 827, False: 827]
  ------------------
  639|    827|        {
  640|    827|            read(vec->ptr(), 3);
  641|    827|        }
  642|    827|    }
_ZN4Ogre16StreamSerialiser4readEPNS_6VectorILi4EfEEm:
  645|    827|    {
  646|  1.65k|        for (size_t i = 0; i < count; ++i, ++vec)
  ------------------
  |  Branch (646:28): [True: 827, False: 827]
  ------------------
  647|    827|        {
  648|    827|            read(vec->ptr(), 4);
  649|    827|        }
  650|    827|    }
_ZN4Ogre16StreamSerialiser4readEPNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  677|    827|    {
  678|       |        // String is stored as a uint32 character count, then string
  679|    827|        uint32 len;
  680|    827|        read(&len);
  681|       |
  682|       |        // Guard against OOM from corrupt/malicious input: cap len to remaining chunk bytes
  683|    827|        OgreAssertDbg(mChunkStack.size(), "Not currently in a chunk, cannot read string length");
  684|    827|        if (len > mChunkStack.back()->length)
  ------------------
  |  Branch (684:13): [True: 587, False: 240]
  ------------------
  685|    827|            OGRE_EXCEPT(Exception::ERR_INVALID_STATE, "String length field exceeds remaining chunk data");
  686|       |
  687|    240|        string->resize(len);
  688|    240|        if (len)
  ------------------
  |  Branch (688:13): [True: 89, False: 151]
  ------------------
  689|     89|            read(&(*string->begin()), len);
  690|    240|    }
_ZN4Ogre16StreamSerialiser4readEPfm:
  693|  2.48k|    {
  694|       |#if OGRE_DOUBLE_PRECISION
  695|       |        if (mRealFormat == REAL_DOUBLE)
  696|       |            readData(val, sizeof(double), count);
  697|       |        else
  698|       |            readFloatsAsDoubles(val, count);
  699|       |#else
  700|  2.48k|        if (mRealFormat == REAL_FLOAT)
  ------------------
  |  Branch (700:13): [True: 1.81k, False: 669]
  ------------------
  701|  1.81k|            readData(val, sizeof(float), count);
  702|    669|        else
  703|    669|            readDoublesAsFloats(val, count);
  704|  2.48k|#endif
  705|       |
  706|  2.48k|    }
_ZN4Ogre16StreamSerialiser4readEPbm:
  785|    211|    {
  786|    422|        for (size_t i = 0; i < count; ++i, ++val)
  ------------------
  |  Branch (786:28): [True: 211, False: 211]
  ------------------
  787|    211|        {
  788|    211|            char c;
  789|    211|            read(&c);
  790|    211|            *val = (c == 1);
  791|    211|        }
  792|    211|    }
_ZN4Ogre16StreamSerialiser19readDoublesAsFloatsEPfm:
  813|    669|    {
  814|    669|        double t = 0;
  815|    669|        readConverted(val, t, count);
  816|    669|    }
_ZN4Ogre16StreamSerialiser17calculateChecksumEPNS0_5ChunkE:
  819|  1.16k|    {
  820|       |        // Always calculate checksums in little endian to make sure they match 
  821|       |        // Otherwise checksums for the same data on different endians will not match
  822|  1.16k|        uint32 id = c->id;
  823|  1.16k|        uint16 version = c->version;
  824|  1.16k|        uint32 length = c->length;
  825|       |#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
  826|       |		Bitwise::bswapBuffer(&id, sizeof(uint32));
  827|       |		Bitwise::bswapBuffer(&version, sizeof(uint16));
  828|       |		Bitwise::bswapBuffer(&length, sizeof(uint32));
  829|       |#endif
  830|       |
  831|       |		// we cannot switch to murmur3 like everywhere else to allow loading legacy files
  832|  1.16k|        uint32 hashVal = SuperFastHash((const char*)&id, sizeof(uint32), 0);
  833|  1.16k|        hashVal = SuperFastHash((const char*)&version, sizeof(uint16), hashVal);
  834|  1.16k|        hashVal = SuperFastHash((const char*)&length, sizeof(uint32), hashVal);
  835|       |
  836|  1.16k|        return hashVal;
  837|  1.16k|    }
_ZN4Ogre16StreamSerialiser8popChunkEj:
  840|  1.03k|    {
  841|  1.03k|        OgreAssert(!mChunkStack.empty(), "No active chunk!");
  ------------------
  |  Branch (841:9): [True: 0, False: 1.03k]
  ------------------
  842|       |
  843|  1.03k|        const Chunk* chunk = mChunkStack.back();
  844|  1.03k|        OgreAssert(chunk->id == id, "Incorrect chunk id!");
  ------------------
  |  Branch (844:9): [True: 2, False: 1.03k]
  ------------------
  845|       |
  846|  1.03k|        Chunk* c = mChunkStack.back();
  847|  1.03k|        mChunkStack.pop_back();
  848|  1.03k|        return c;
  849|       |
  850|  1.03k|    }
OgreStreamSerialiser.cpp:_ZN4OgreL13SuperFastHashEPKcij:
   40|  3.48k|    {
   41|  3.48k|#if OGRE_ENDIAN == OGRE_ENDIAN_LITTLE
   42|  3.48k|#  define OGRE_GET16BITS(d) (*((const uint16 *) (d)))
   43|       |#else
   44|       |    // Cast to uint16 in little endian means first byte is least significant
   45|       |    // replicate that here
   46|       |#  define OGRE_GET16BITS(d) (*((const uint8 *) (d)) + (*((const uint8 *) (d+1))<<8))
   47|       |#endif
   48|  3.48k|        uint32 hash;
   49|  3.48k|        int rem;
   50|       |
   51|  3.48k|        if (hashSoFar)
  ------------------
  |  Branch (51:13): [True: 2.32k, False: 1.16k]
  ------------------
   52|  2.32k|            hash = hashSoFar;
   53|  1.16k|        else
   54|  1.16k|            hash = len;
   55|       |
   56|  3.48k|        if (len <= 0 || data == NULL) return 0;
  ------------------
  |  Branch (56:13): [True: 0, False: 3.48k]
  |  Branch (56:25): [True: 0, False: 3.48k]
  ------------------
   57|       |
   58|  3.48k|        rem = len & 3;
   59|  3.48k|        len >>= 2;
   60|       |
   61|       |        /* Main loop */
   62|  5.81k|        for (;len > 0; len--) {
  ------------------
  |  Branch (62:15): [True: 2.32k, False: 3.48k]
  ------------------
   63|  2.32k|            hash  += OGRE_GET16BITS (data);
  ------------------
  |  |   42|  2.32k|#  define OGRE_GET16BITS(d) (*((const uint16 *) (d)))
  ------------------
   64|  2.32k|            uint32 tmp    = (OGRE_GET16BITS (data+2) << 11) ^ hash;
  ------------------
  |  |   42|  2.32k|#  define OGRE_GET16BITS(d) (*((const uint16 *) (d)))
  ------------------
   65|  2.32k|            hash   = (hash << 16) ^ tmp;
   66|  2.32k|            data  += 2*sizeof (uint16);
   67|  2.32k|            hash  += hash >> 11;
   68|  2.32k|        }
   69|       |
   70|       |        /* Handle end cases */
   71|  3.48k|        switch (rem) {
  ------------------
  |  Branch (71:17): [True: 1.16k, False: 2.32k]
  ------------------
   72|      0|        case 3: hash += OGRE_GET16BITS (data);
  ------------------
  |  |   42|      0|#  define OGRE_GET16BITS(d) (*((const uint16 *) (d)))
  ------------------
  |  Branch (72:9): [True: 0, False: 3.48k]
  ------------------
   73|      0|            hash ^= hash << 16;
   74|      0|            hash ^= data[sizeof (uint16)] << 18;
   75|      0|            hash += hash >> 11;
   76|      0|            break;
   77|  1.16k|        case 2: hash += OGRE_GET16BITS (data);
  ------------------
  |  |   42|  1.16k|#  define OGRE_GET16BITS(d) (*((const uint16 *) (d)))
  ------------------
  |  Branch (77:9): [True: 1.16k, False: 2.32k]
  ------------------
   78|  1.16k|            hash ^= hash << 11;
   79|  1.16k|            hash += hash >> 17;
   80|  1.16k|            break;
   81|      0|        case 1: hash += *data;
  ------------------
  |  Branch (81:9): [True: 0, False: 3.48k]
  ------------------
   82|      0|            hash ^= hash << 10;
   83|      0|            hash += hash >> 1;
   84|  3.48k|        }
   85|       |
   86|       |        /* Force "avalanching" of final 127 bits */
   87|  3.48k|        hash ^= hash << 3;
   88|  3.48k|        hash += hash >> 5;
   89|  3.48k|        hash ^= hash << 4;
   90|  3.48k|        hash += hash >> 17;
   91|  3.48k|        hash ^= hash << 25;
   92|  3.48k|        hash += hash >> 6;
   93|       |
   94|  3.48k|        return hash;
   95|  3.48k|#undef OGRE_GET16BITS
   96|  3.48k|    }

_ZN4Ogre10StringUtil4trimERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbb:
   42|  69.6k|    {
   43|       |        /*
   44|       |        size_t lspaces, rspaces, len = length(), i;
   45|       |
   46|       |        lspaces = rspaces = 0;
   47|       |
   48|       |        if( left )
   49|       |        {
   50|       |            // Find spaces / tabs on the left
   51|       |            for( i = 0;
   52|       |                i < len && ( at(i) == ' ' || at(i) == '\t' || at(i) == '\r');
   53|       |                ++lspaces, ++i );
   54|       |        }
   55|       |        
   56|       |        if( right && lspaces < len )
   57|       |        {
   58|       |            // Find spaces / tabs on the right
   59|       |            for( i = len - 1;
   60|       |                i >= 0 && ( at(i) == ' ' || at(i) == '\t' || at(i) == '\r');
   61|       |                rspaces++, i-- );
   62|       |        }
   63|       |
   64|       |        *this = substr(lspaces, len-lspaces-rspaces);
   65|       |        */
   66|  69.6k|        static const String delims = " \t\r\n";
   67|  69.6k|        if(right)
  ------------------
  |  Branch (67:12): [True: 69.6k, False: 0]
  ------------------
   68|  69.6k|            str.erase(str.find_last_not_of(delims)+1); // trim right
   69|  69.6k|        if(left)
  ------------------
  |  Branch (69:12): [True: 69.6k, False: 0]
  ------------------
   70|  69.6k|            str.erase(0, str.find_first_not_of(delims)); // trim left
   71|  69.6k|    }
_ZN4Ogre10StringUtil6formatEPKcz:
  488|   152k|    {
  489|       |        // try to use a stack buffer and fall back to heap for large strings
  490|   152k|        char sbuf[1024];
  491|   152k|        size_t bsize = sizeof(sbuf);
  492|   152k|        std::vector<char> hbuf;
  493|   152k|        char* pbuf = sbuf;
  494|       |
  495|   153k|        while (true)
  ------------------
  |  Branch (495:16): [True: 153k, Folded]
  ------------------
  496|   153k|        {
  497|   153k|            va_list va;
  498|   153k|            va_start(va, fmt);
  499|   153k|            int len = vsnprintf(pbuf, bsize, fmt, va);
  500|   153k|            va_end(va);
  501|       |
  502|   153k|            OgreAssert(len >= 0, "Check format string for errors");
  ------------------
  |  Branch (502:13): [True: 0, False: 153k]
  ------------------
  503|   153k|            if (size_t(len) >= bsize)
  ------------------
  |  Branch (503:17): [True: 255, False: 152k]
  ------------------
  504|    255|            {
  505|    255|                hbuf.resize(len + 1);
  506|    255|                pbuf = hbuf.data();
  507|    255|                bsize = hbuf.size();
  508|    255|                continue;
  509|    255|            }
  510|   152k|            pbuf[bsize - 1] = 0;
  511|   152k|            return String(pbuf, len);
  512|   153k|        }
  513|   152k|    }

_ZN4Ogre15ParamDictionaryC2Ev:
   36|      2|    ParamDictionary::ParamDictionary() {}
_ZN4Ogre15ParamDictionaryD2Ev:
   37|      4|    ParamDictionary::~ParamDictionary() {}
_ZN4Ogre15StringInterface21createParamDictionaryERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   72|  4.85k|    {
   73|  4.85k|        OGRE_LOCK_MUTEX( msDictionaryMutex );
   74|       |
   75|  4.85k|        ParamDictionaryMap::iterator it = msDictionary.find(className);
   76|       |
   77|  4.85k|        if ( it == msDictionary.end() )
  ------------------
  |  Branch (77:14): [True: 2, False: 4.84k]
  ------------------
   78|      2|        {
   79|      2|            mParamDict = &msDictionary.insert( std::make_pair( className, ParamDictionary() ) ).first->second;
   80|      2|            mParamDictName = className;
   81|      2|            return true;
   82|      2|        }
   83|  4.84k|        else
   84|  4.84k|        {
   85|  4.84k|            mParamDict = &it->second;
   86|  4.84k|            mParamDictName = className;
   87|  4.84k|            return false;
   88|  4.84k|        }
   89|  4.85k|    }

_ZN4Ogre7SubMeshC2Ev:
   33|   152k|        : vertexData(0)
   34|   152k|        , parent(0)
   35|   152k|        , useSharedVertices(true)
   36|   152k|        , operationType(RenderOperation::OT_TRIANGLE_LIST)
   37|   152k|        , mBoneAssignmentsOutOfDate(false)
   38|   152k|        , mVertexAnimationType(VAT_NONE)
   39|   152k|        , mVertexAnimationIncludesNormals(false)
   40|   152k|        , mBuildEdgesEnabled(true)
   41|   152k|    {
   42|       |        indexData = OGRE_NEW IndexData();
   43|   152k|    }
_ZN4Ogre7SubMeshD2Ev:
   46|   152k|    {
   47|   152k|        removeLodLevels();
   48|   152k|        OGRE_DELETE vertexData;
   49|       |        OGRE_DELETE indexData;
   50|   152k|    }
_ZN4Ogre7SubMesh17addBoneAssignmentERKNS_20VertexBoneAssignmentE:
   81|  1.60k|    {
   82|  1.60k|        OgreAssert(!useSharedVertices,
  ------------------
  |  Branch (82:9): [True: 2, False: 1.59k]
  ------------------
   83|  1.59k|                   "This SubMesh uses shared geometry, you must assign bones to the Mesh, not the SubMesh");
   84|  1.59k|        mBoneAssignments.emplace(vertBoneAssign.vertexIndex, vertBoneAssign);
   85|  1.59k|        mBoneAssignmentsOutOfDate = true;
   86|  1.59k|    }
_ZN4Ogre7SubMesh15removeLodLevelsEv:
  116|   152k|    {
  117|   152k|        LODFaceList::iterator lodi, lodend;
  118|   152k|        lodend = mLodFaceList.end();
  119|  1.62M|        for (lodi = mLodFaceList.begin(); lodi != lodend; ++lodi)
  ------------------
  |  Branch (119:43): [True: 1.47M, False: 152k]
  ------------------
  120|  1.47M|        {
  121|  1.47M|            OGRE_DELETE *lodi;
  122|  1.47M|        }
  123|       |
  124|   152k|        mLodFaceList.clear();
  125|       |
  126|   152k|    }

_ZN4Ogre9TechniqueC2EPNS_8MaterialE:
   35|      3|        : mParent(parent), mIlluminationPassesCompilationPhase(IPS_NOT_COMPILED), mIsSupported(false), mLodIndex(0), mSchemeIndex(0)
   36|      3|    {
   37|       |        // See above, defaults to unsupported until examined
   38|      3|    }
_ZNK4Ogre9Technique11isSupportedEv:
   54|      2|    {
   55|      2|        return mIsSupported;
   56|      2|    }
_ZN4Ogre9Technique10createPassEv:
  310|      1|    {
  311|       |        Pass* newPass = OGRE_NEW Pass(this, static_cast<unsigned short>(mPasses.size()));
  312|      1|        mPasses.push_back(newPass);
  313|      1|        return newPass;
  314|      1|    }
_ZN4Ogre9Technique15removeAllPassesEv:
  341|      2|    {
  342|      2|        for (auto *p : mPasses)
  ------------------
  |  Branch (342:22): [True: 0, False: 2]
  ------------------
  343|      0|        {
  344|      0|            p->queueForDeletion();
  345|      0|        }
  346|      2|        mPasses.clear();
  347|      2|    }
_ZN4Ogre9TechniqueaSERKS0_:
  398|      2|    {
  399|      2|        if (this == &rhs)
  ------------------
  |  Branch (399:13): [True: 0, False: 2]
  ------------------
  400|      0|            return *this;
  401|       |
  402|      2|        mName = rhs.mName;
  403|      2|        this->mIsSupported = rhs.mIsSupported;
  404|      2|        this->mLodIndex = rhs.mLodIndex;
  405|      2|        this->mSchemeIndex = rhs.mSchemeIndex;
  406|      2|        this->mShadowCasterMaterial = rhs.mShadowCasterMaterial;
  407|      2|        this->mShadowCasterMaterialName = rhs.mShadowCasterMaterialName;
  408|      2|        this->mShadowReceiverMaterial = rhs.mShadowReceiverMaterial;
  409|      2|        this->mShadowReceiverMaterialName = rhs.mShadowReceiverMaterialName;
  410|      2|        this->mGPUVendorRules = rhs.mGPUVendorRules;
  411|      2|        this->mGPUDeviceNameRules = rhs.mGPUDeviceNameRules;
  412|       |
  413|       |        // copy passes
  414|      2|        removeAllPasses();
  415|      2|        for (auto *rp : rhs.mPasses)
  ------------------
  |  Branch (415:23): [True: 2, False: 2]
  ------------------
  416|      2|        {
  417|      2|            Pass* p = OGRE_NEW Pass(this, rp->getIndex(), *(rp));
  418|      2|            mPasses.push_back(p);
  419|      2|        }
  420|       |        // Compile for categorised illumination on demand
  421|      2|        clearIlluminationPasses();
  422|      2|        mIlluminationPassesCompilationPhase = IPS_NOT_COMPILED;
  423|      2|        return *this;
  424|      2|    }
_ZN4Ogre9Technique18setLightingEnabledEb:
  631|      1|    void Technique::setLightingEnabled(bool enabled) { ALL_PASSES(setLightingEnabled(enabled)); }
  ------------------
  |  |  581|      1|    #define ALL_PASSES(fncall) for(auto p : mPasses) p->fncall
  |  |  ------------------
  |  |  |  Branch (581:43): [True: 1, False: 1]
  |  |  ------------------
  ------------------
_ZN4Ogre9Technique23clearIlluminationPassesEv:
  958|      2|    {
  959|      2|        if(MaterialManager::getSingletonPtr())
  ------------------
  |  Branch (959:12): [True: 2, False: 0]
  ------------------
  960|      2|            MaterialManager::getSingleton()._notifyBeforeIlluminationPassesCleared(this);
  961|       |
  962|      2|        for (auto *i : mIlluminationPasses)
  ------------------
  |  Branch (962:22): [True: 0, False: 2]
  ------------------
  963|      0|        {
  964|      0|            if (i->destroyOnShutdown)
  ------------------
  |  Branch (964:17): [True: 0, False: 0]
  ------------------
  965|      0|            {
  966|      0|                i->pass->queueForDeletion();
  967|      0|            }
  968|       |            OGRE_DELETE i;
  969|      0|        }
  970|      2|        mIlluminationPasses.clear();
  971|      2|    }

_ZN4Ogre7SamplerC2Ev:
   40|      2|        : mBorderColour(ColourValue::Black)
   41|      2|        , mMaxAniso(1)
   42|      2|        , mMipmapBias(0)
   43|      2|        , mMinFilter(FO_LINEAR)
   44|      2|        , mMagFilter(FO_LINEAR)
   45|      2|        , mMipFilter(FO_POINT)
   46|      2|        , mCompareFunc(CMPF_GREATER_EQUAL)
   47|      2|        , mCompareEnabled(false)
   48|      2|        , mDirty(true)
   49|      2|    {
   50|      2|        setAddressingMode(TAM_WRAP);
   51|      2|    }
_ZN4Ogre7Sampler17setAddressingModeERKNS0_17UVWAddressingModeE:
   55|      2|    {
   56|      2|        mAddressMode = uvw;
   57|      2|        mDirty = true;
   58|      2|    }

_ZN4Ogre10VertexDataC2EPNS_25HardwareBufferManagerBaseE:
  172|   147k|    {
  173|   147k|        mMgr = mgr ? mgr : HardwareBufferManager::getSingletonPtr();
  ------------------
  |  Branch (173:16): [True: 0, False: 147k]
  ------------------
  174|   147k|        vertexBufferBinding = mMgr->createVertexBufferBinding();
  175|   147k|        vertexDeclaration = mMgr->createVertexDeclaration();
  176|   147k|        mDeleteDclBinding = true;
  177|   147k|        vertexCount = 0;
  178|   147k|        vertexStart = 0;
  179|   147k|        hwAnimDataItemsUsed = 0;
  180|       |
  181|   147k|    }
_ZN4Ogre10VertexDataD2Ev:
  196|   147k|    {
  197|   147k|        if (mDeleteDclBinding)
  ------------------
  |  Branch (197:13): [True: 147k, False: 0]
  ------------------
  198|   147k|        {
  199|   147k|            mMgr->destroyVertexBufferBinding(vertexBufferBinding);
  200|   147k|            mMgr->destroyVertexDeclaration(vertexDeclaration);
  201|   147k|        }
  202|   147k|    }
_ZN4Ogre10VertexData20convertVertexElementENS_21VertexElementSemanticENS_17VertexElementTypeEt:
  269|   104k|    {
  270|   104k|        auto elem = vertexDeclaration->findElementBySemantic(semantic, index);
  271|       |
  272|   104k|        if(!elem)
  ------------------
  |  Branch (272:12): [True: 102k, False: 2.12k]
  ------------------
  273|   102k|            return; // nothing to do
  274|       |
  275|  2.12k|        auto srcBaseType = VertexElement::getBaseType(elem->getType());
  276|  2.12k|        if (srcBaseType == VET_FLOAT1 && srcBaseType == VertexElement::getBaseType(dstType))
  ------------------
  |  Branch (276:13): [True: 346, False: 1.77k]
  |  Branch (276:42): [True: 346, False: 0]
  ------------------
  277|    346|            return; // silently ignore floatX > floatY conversions
  278|       |
  279|  1.77k|        auto srcType = elem->getType();
  280|  1.77k|        auto vbuf = vertexBufferBinding->getBuffer(elem->getSource());
  281|       |
  282|  1.77k|        uint32 newElemSize = VertexElement::getTypeSize(dstType);
  283|  1.77k|        size_t newVertexSize = vbuf->getVertexSize() - elem->getSize() + newElemSize;
  284|  1.77k|        auto newVBuf = vbuf->getManager()->createVertexBuffer(newVertexSize, vbuf->getNumVertices(), vbuf->getUsage(),
  285|  1.77k|                                                              vbuf->hasShadowBuffer());
  286|       |
  287|  1.77k|        {
  288|  1.77k|            HardwareBufferLockGuard dst(newVBuf, HardwareBuffer::HBL_DISCARD);
  289|  1.77k|            auto pDst = static_cast<uint8*>(dst.pData);
  290|       |
  291|  1.77k|            if(dstType == VET_INT_10_10_10_2_NORM)
  ------------------
  |  Branch (291:16): [True: 0, False: 1.77k]
  ------------------
  292|      0|            {
  293|      0|                if(srcType == VET_FLOAT3)
  ------------------
  |  Branch (293:20): [True: 0, False: 0]
  ------------------
  294|      0|                    spliceElement(elem, vbuf, pDst, pDst, newElemSize, pack_10_10_10_2<false>);
  295|      0|                else
  296|      0|                {
  297|      0|                    OgreAssert(srcType == VET_FLOAT4, "unsupported conversion");
  ------------------
  |  Branch (297:21): [True: 0, False: 0]
  ------------------
  298|      0|                    spliceElement(elem, vbuf, pDst, pDst, newElemSize, pack_10_10_10_2<true>);
  299|      0|                }
  300|      0|            }
  301|  1.77k|            else if(dstType == VET_FLOAT3)
  ------------------
  |  Branch (301:21): [True: 716, False: 1.05k]
  ------------------
  302|    716|            {
  303|    716|                OgreAssert(srcType == VET_INT_10_10_10_2_NORM, "unsupported conversion");
  ------------------
  |  Branch (303:17): [True: 12, False: 704]
  ------------------
  304|    704|                spliceElement(elem, vbuf, pDst, pDst, newElemSize, unpack_10_10_10_2<false>);
  305|    704|            }
  306|  1.05k|            else if(dstType == VET_FLOAT4)
  ------------------
  |  Branch (306:21): [True: 1.02k, False: 32]
  ------------------
  307|  1.02k|            {
  308|  1.02k|                OgreAssert(srcType == VET_INT_10_10_10_2_NORM, "unsupported conversion");
  ------------------
  |  Branch (308:17): [True: 15, False: 1.01k]
  ------------------
  309|  1.01k|                spliceElement(elem, vbuf, pDst, pDst, newElemSize, unpack_10_10_10_2<true>);
  310|  1.01k|            }
  311|     32|            else if(dstType == VET_HALF3)
  ------------------
  |  Branch (311:21): [True: 0, False: 32]
  ------------------
  312|      0|            {
  313|      0|                OgreAssert(srcType == VET_FLOAT3, "unsupported conversion");
  ------------------
  |  Branch (313:17): [True: 0, False: 0]
  ------------------
  314|      0|                spliceElement(elem, vbuf, pDst, pDst, newElemSize, float_to_half_3);
  315|      0|            }
  316|     32|            else if(dstType == VET_HALF4 || dstType == VET_SHORT4 || dstType == VET_USHORT4)
  ------------------
  |  Branch (316:21): [True: 32, False: 0]
  |  Branch (316:45): [True: 0, False: 0]
  |  Branch (316:70): [True: 0, False: 0]
  ------------------
  317|      0|            {
  318|       |                // pad 16x3 formats to 16x4
  319|      0|                OgreAssert(srcType == VET_HALF3 || srcType == VET_SHORT3 || srcType == VET_USHORT3, "unsupported conversion");
  ------------------
  |  Branch (319:17): [True: 0, False: 0]
  |  Branch (319:17): [True: 0, False: 0]
  |  Branch (319:17): [True: 0, False: 0]
  ------------------
  320|      0|                spliceElement(elem, vbuf, pDst, pDst, newElemSize, pad_16x3);
  321|      0|            }
  322|     32|            else
  323|     32|            {
  324|     32|                OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "unsupported dstType");
  325|     32|            }
  326|  1.77k|        }
  327|       |
  328|       |        // Bind the new buffer
  329|  1.71k|        vertexBufferBinding->setBinding(elem->getSource(), newVBuf);
  330|  1.71k|        updateVertexDeclaration(vertexDeclaration, elem, dstType, elem->getSource());
  331|  1.71k|    }
_ZN4Ogre10VertexData19convertPackedColourENS_17VertexElementTypeES1_:
  645|   143k|    {
  646|   143k|        OgreAssert(destType == VET_UBYTE4_NORM, "Not supported");
  ------------------
  |  Branch (646:9): [True: 0, False: 143k]
  ------------------
  647|       |
  648|   143k|        const VertexBufferBinding::VertexBufferBindingMap& bindMap = 
  649|   143k|            vertexBufferBinding->getBindings();
  650|   143k|        for (auto& m : bindMap)
  ------------------
  |  Branch (650:22): [True: 7.06k, False: 143k]
  ------------------
  651|  7.06k|        {
  652|  7.06k|            const auto& elems =
  653|  7.06k|                vertexDeclaration->findElementsBySource(m.first);
  654|  7.06k|            bool conversionNeeded = false;
  655|  7.06k|            for (auto& e : elems)
  ------------------
  |  Branch (655:26): [True: 11.3k, False: 7.06k]
  ------------------
  656|  11.3k|            {
  657|  11.3k|                if (e.getType() == _DETAIL_SWAP_RB)
  ------------------
  |  Branch (657:21): [True: 1.74k, False: 9.64k]
  ------------------
  658|  1.74k|                {
  659|  1.74k|                    conversionNeeded = true;
  660|  1.74k|                }
  661|  11.3k|            }
  662|       |
  663|  7.06k|            if (conversionNeeded)
  ------------------
  |  Branch (663:17): [True: 1.51k, False: 5.54k]
  ------------------
  664|  1.51k|            {
  665|  1.51k|                void* pBase = m.second->lock(HardwareBuffer::HBL_NORMAL);
  666|       |
  667|  8.98k|                for (size_t v = 0; v < m.second->getNumVertices(); ++v)
  ------------------
  |  Branch (667:36): [True: 7.46k, False: 1.51k]
  ------------------
  668|  7.46k|                {
  669|       |
  670|  7.46k|                    for (auto& e : elems)
  ------------------
  |  Branch (670:34): [True: 15.1k, False: 7.46k]
  ------------------
  671|  15.1k|                    {
  672|  15.1k|                        if (e.getType() == _DETAIL_SWAP_RB)
  ------------------
  |  Branch (672:29): [True: 7.46k, False: 7.68k]
  ------------------
  673|  7.46k|                        {
  674|  7.46k|                            uint32* pRGBA;
  675|  7.46k|                            e.baseVertexPointerToElement(pBase, &pRGBA);
  676|  7.46k|                            swapPackedRB(pRGBA);
  677|  7.46k|                        }
  678|  15.1k|                    }
  679|  7.46k|                    pBase = static_cast<void*>(
  680|  7.46k|                        static_cast<char*>(pBase) + m.second->getVertexSize());
  681|  7.46k|                }
  682|  1.51k|                m.second->unlock();
  683|       |
  684|       |                // Modify the elements to reflect the changed type
  685|  1.51k|                const VertexDeclaration::VertexElementList& allelems = 
  686|  1.51k|                    vertexDeclaration->getElements();
  687|  1.51k|                unsigned short elemIndex = 0;
  688|  1.51k|                for (auto& e : allelems)
  ------------------
  |  Branch (688:30): [True: 11.2k, False: 1.51k]
  ------------------
  689|  11.2k|                {
  690|  11.2k|                    if (e.getType() == _DETAIL_SWAP_RB)
  ------------------
  |  Branch (690:25): [True: 2.17k, False: 9.09k]
  ------------------
  691|  2.17k|                    {
  692|  2.17k|                        vertexDeclaration->modifyElement(elemIndex,
  693|  2.17k|                            e.getSource(), e.getOffset(), destType,
  694|  2.17k|                            e.getSemantic(), e.getIndex());
  695|  2.17k|                    }
  696|  11.2k|                    ++elemIndex;
  697|  11.2k|                }
  698|  1.51k|            }
  699|  7.06k|        } // each buffer
  700|   143k|    }
_ZN4Ogre9IndexDataC2Ev:
  770|   164k|    {
  771|   164k|        indexCount = 0;
  772|   164k|        indexStart = 0;
  773|       |        
  774|   164k|    }
_ZN4Ogre9IndexDataD2Ev:
  777|   164k|    {
  778|   164k|    }
OgreVertexIndexData.cpp:_ZN4OgreL13spliceElementEPKNS_13VertexElementERKNS_9SharedPtrINS_20HardwareVertexBufferEEEPhS8_jPFvS8_S8_iE:
  103|  1.71k|    {
  104|  1.71k|        auto vertexSize = srcBuf->getVertexSize();
  105|  1.71k|        auto numVerts = srcBuf->getNumVertices();
  106|       |
  107|  1.71k|        auto elemSize = elem->getSize();
  108|  1.71k|        int elemOffset = elem->getOffset();
  109|       |
  110|  1.71k|        auto postVertexOffset = elemOffset + elemSize;
  111|  1.71k|        auto postVertexSize = vertexSize - postVertexOffset;
  112|       |
  113|  1.71k|        auto elemDstSize = pDst == pElemDst ? newElemSize : 0;
  ------------------
  |  Branch (113:28): [True: 1.71k, False: 0]
  ------------------
  114|  1.71k|        size_t newVertexSize = vertexSize - elemSize + elemDstSize;
  115|  1.71k|        auto elemDstStep = pDst == pElemDst ? newVertexSize : newElemSize;
  ------------------
  |  Branch (115:28): [True: 1.71k, False: 0]
  ------------------
  116|       |
  117|  1.71k|        HardwareBufferLockGuard srcLock(srcBuf, HardwareBuffer::HBL_READ_ONLY);
  118|  1.71k|        uint8* pSrc = static_cast<uint8*>(srcLock.pData);
  119|       |
  120|  4.11k|        for (uint32 v = 0; v < numVerts; ++v)
  ------------------
  |  Branch (120:28): [True: 2.39k, False: 1.71k]
  ------------------
  121|  2.39k|        {
  122|       |            // copy and convert element from vertex
  123|  2.39k|            elemConvert(pElemDst, pSrc, elemOffset);
  124|  2.39k|            pElemDst += elemDstStep;
  125|       |
  126|       |            // copy over other data
  127|  2.39k|            if (elemOffset)
  ------------------
  |  Branch (127:17): [True: 785, False: 1.61k]
  ------------------
  128|    785|                memcpy(pDst, pSrc, elemOffset);
  129|  2.39k|            if (postVertexSize)
  ------------------
  |  Branch (129:17): [True: 1.73k, False: 666]
  ------------------
  130|  1.73k|                memcpy(pDst + elemOffset + elemDstSize, pSrc + postVertexOffset, postVertexSize);
  131|       |
  132|  2.39k|            pSrc += vertexSize;
  133|  2.39k|            pDst += newVertexSize;
  134|  2.39k|        }
  135|  1.71k|    }
OgreVertexIndexData.cpp:_ZN4OgreL23updateVertexDeclarationEPNS_17VertexDeclarationEPKNS_13VertexElementENS_17VertexElementTypeEt:
  138|  1.71k|    {
  139|  1.71k|        auto elemSize = elem->getSize();
  140|  1.71k|        auto oldElemOffset = elem->getOffset();
  141|  1.71k|        auto newElemOffset = oldElemOffset;
  142|       |
  143|  1.71k|        auto newElemSize = VertexElement::getTypeSize(newType);
  144|  1.71k|        auto oldSource = elem->getSource();
  145|       |
  146|  1.71k|        if(newSource != oldSource)
  ------------------
  |  Branch (146:12): [True: 0, False: 1.71k]
  ------------------
  147|      0|        {
  148|      0|            newElemOffset = 0;
  149|      0|            newElemSize = 0;
  150|      0|        }
  151|       |
  152|  1.71k|        uint16 idx = 0;
  153|  1.71k|        for (const auto& e : decl->getElements())
  ------------------
  |  Branch (153:28): [True: 5.23k, False: 1.71k]
  ------------------
  154|  5.23k|        {
  155|  5.23k|            if (&e == elem)
  ------------------
  |  Branch (155:17): [True: 1.71k, False: 3.51k]
  ------------------
  156|  1.71k|            {
  157|       |                // Modify element
  158|  1.71k|                decl->modifyElement(idx, newSource, newElemOffset, newType, elem->getSemantic(), elem->getIndex());
  159|  1.71k|            }
  160|  3.51k|            else if (e.getSource() == oldSource && e.getOffset() > oldElemOffset)
  ------------------
  |  Branch (160:22): [True: 1.71k, False: 1.79k]
  |  Branch (160:52): [True: 679, False: 1.03k]
  ------------------
  161|    679|            {
  162|       |                // shift elements after this one
  163|    679|                decl->modifyElement(idx, e.getSource(), e.getOffset() - elemSize + newElemSize, e.getType(),
  164|    679|                                    e.getSemantic(), e.getIndex());
  165|    679|            }
  166|  5.23k|            idx++;
  167|  5.23k|        }
  168|  1.71k|    }
OgreVertexIndexData.cpp:_ZN4OgreL12swapPackedRBEPj:
   36|  7.46k|    {
   37|  7.46k|        auto cptr = (uint8*)ptr;
   38|  7.46k|        std::swap(cptr[0], cptr[2]);
   39|  7.46k|    }
OgreVertexIndexData.cpp:_ZN4OgreL17unpack_10_10_10_2ILi0EEEvPhS1_i:
   61|    947|    {
   62|    947|        int_10_10_10_2* pPacked = (int_10_10_10_2*)(pSrc + elemOffset);
   63|    947|        float* pFloat = (float*)(pDst + elemOffset);
   64|       |
   65|    947|        pFloat[0] = float(pPacked->x) / INT10_MAX;
  ------------------
  |  |   32|    947|#define INT10_MAX ((1 << 9) - 1)
  ------------------
   66|    947|        pFloat[1] = float(pPacked->y) / INT10_MAX;
  ------------------
  |  |   32|    947|#define INT10_MAX ((1 << 9) - 1)
  ------------------
   67|    947|        pFloat[2] = float(pPacked->z) / INT10_MAX;
  ------------------
  |  |   32|    947|#define INT10_MAX ((1 << 9) - 1)
  ------------------
   68|    947|        if(INCLUDE_W)
  ------------------
  |  Branch (68:12): [Folded, False: 947]
  ------------------
   69|      0|            pFloat[3] = pPacked->w;
   70|    947|    }
OgreVertexIndexData.cpp:_ZN4OgreL17unpack_10_10_10_2ILi1EEEvPhS1_i:
   61|  1.45k|    {
   62|  1.45k|        int_10_10_10_2* pPacked = (int_10_10_10_2*)(pSrc + elemOffset);
   63|  1.45k|        float* pFloat = (float*)(pDst + elemOffset);
   64|       |
   65|  1.45k|        pFloat[0] = float(pPacked->x) / INT10_MAX;
  ------------------
  |  |   32|  1.45k|#define INT10_MAX ((1 << 9) - 1)
  ------------------
   66|  1.45k|        pFloat[1] = float(pPacked->y) / INT10_MAX;
  ------------------
  |  |   32|  1.45k|#define INT10_MAX ((1 << 9) - 1)
  ------------------
   67|  1.45k|        pFloat[2] = float(pPacked->z) / INT10_MAX;
  ------------------
  |  |   32|  1.45k|#define INT10_MAX ((1 << 9) - 1)
  ------------------
   68|  1.45k|        if(INCLUDE_W)
  ------------------
  |  Branch (68:12): [True: 1.45k, Folded]
  ------------------
   69|  1.45k|            pFloat[3] = pPacked->w;
   70|  1.45k|    }

LLVMFuzzerTestOneInput:
  167|  7.96k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  168|  7.96k|  if (size < 2)
  ------------------
  |  Branch (168:7): [True: 1, False: 7.95k]
  ------------------
  169|      1|    return 0;
  170|       |
  171|  7.95k|  global_init();
  172|       |
  173|  7.95k|  FuzzedDataProvider provider(data, size);
  174|  7.95k|  uint8_t target = provider.ConsumeIntegral<uint8_t>() % FUZZ_TARGET_COUNT;
  175|  7.95k|  auto remaining = provider.ConsumeRemainingBytes<uint8_t>();
  176|       |
  177|  7.95k|  if (remaining.empty())
  ------------------
  |  Branch (177:7): [True: 0, False: 7.95k]
  ------------------
  178|      0|    return 0;
  179|       |
  180|  7.95k|  switch (target) {
  ------------------
  |  Branch (180:11): [True: 7.95k, False: 0]
  ------------------
  181|  5.12k|  case FUZZ_MESH:
  ------------------
  |  Branch (181:3): [True: 5.12k, False: 2.83k]
  ------------------
  182|  5.12k|    fuzz_mesh(remaining.data(), remaining.size());
  183|  5.12k|    break;
  184|  1.33k|  case FUZZ_SKELETON:
  ------------------
  |  Branch (184:3): [True: 1.33k, False: 6.62k]
  ------------------
  185|  1.33k|    fuzz_skeleton(remaining.data(), remaining.size());
  186|  1.33k|    break;
  187|  1.07k|  case FUZZ_CONFIG:
  ------------------
  |  Branch (187:3): [True: 1.07k, False: 6.88k]
  ------------------
  188|  1.07k|    fuzz_config(remaining.data(), remaining.size());
  189|  1.07k|    break;
  190|    418|  case FUZZ_STREAM_SERIALISER:
  ------------------
  |  Branch (190:3): [True: 418, False: 7.54k]
  ------------------
  191|    418|    fuzz_stream_serialiser(remaining.data(), remaining.size());
  192|    418|    break;
  193|  7.95k|  }
  194|       |
  195|  7.95k|  return 0;
  196|  7.95k|}
ogre_deep_fuzz.cpp:_ZL11global_initv:
   57|  7.95k|static void global_init() {
   58|  7.95k|  if (g_initialized)
  ------------------
  |  Branch (58:7): [True: 7.95k, False: 1]
  ------------------
   59|  7.95k|    return;
   60|       |
   61|       |  /* Suppress all log output */
   62|      1|  auto *logMgr = new Ogre::LogManager();
   63|      1|  logMgr->createLog("fuzz.log", true, false, true); /* suppressFileOutput */
   64|      1|  logMgr->setMinLogLevel(Ogre::LML_CRITICAL);
   65|       |
   66|       |  /* Create singletons needed for Mesh/Skeleton operations */
   67|      1|  new Ogre::ResourceGroupManager();
   68|      1|  new Ogre::LodStrategyManager();
   69|      1|  new Ogre::DefaultHardwareBufferManager();
   70|      1|  new Ogre::MeshManager();
   71|      1|  new Ogre::SkeletonManager();
   72|      1|  auto *matMgr = new Ogre::MaterialManager();
   73|      1|  matMgr->initialise();
   74|       |
   75|      1|  g_initialized = true;
   76|      1|}
ogre_deep_fuzz.cpp:_ZL9fuzz_meshPKhm:
   78|  5.12k|static void fuzz_mesh(const uint8_t *data, size_t size) {
   79|       |  // manual, so we can load it from memory without a file
   80|  5.12k|  auto mesh = Ogre::MeshManager::getSingleton().create("fuzz.mesh", "General", true);
   81|  5.12k|  mesh->load(); // ensure cleanup runs
   82|       |
   83|  5.12k|  Ogre::DataStreamPtr stream(
   84|  5.12k|      new Ogre::MemoryDataStream(const_cast<uint8_t *>(data), size, false, true));
   85|       |
   86|  5.12k|  Ogre::MeshSerializer serializer;
   87|  5.12k|  try {
   88|  5.12k|    serializer.importMesh(stream, mesh.get());
   89|  5.12k|  } catch (std::exception &) {
   90|  2.65k|  }
   91|       |
   92|  5.12k|  Ogre::MeshManager::getSingleton().remove(mesh);
   93|  5.12k|}
ogre_deep_fuzz.cpp:_ZL13fuzz_skeletonPKhm:
   95|  1.33k|static void fuzz_skeleton(const uint8_t *data, size_t size) {
   96|       |  // manual, so we can load it from memory without a file
   97|  1.33k|  auto skeleton = Ogre::SkeletonManager::getSingleton().create("fuzz.skeleton", "General", true);
   98|  1.33k|  skeleton->prepare();   // ensure cleanup runs
   99|       |
  100|  1.33k|  Ogre::DataStreamPtr stream(
  101|  1.33k|      new Ogre::MemoryDataStream(const_cast<uint8_t *>(data), size, false, true));
  102|       |
  103|  1.33k|  Ogre::SkeletonSerializer serializer;
  104|  1.33k|  try {
  105|  1.33k|    serializer.importSkeleton(stream, skeleton.get());
  106|  1.33k|  } catch (std::exception &) {
  107|    597|  }
  108|       |
  109|  1.33k|  Ogre::SkeletonManager::getSingleton().remove(skeleton);
  110|  1.33k|}
ogre_deep_fuzz.cpp:_ZL11fuzz_configPKhm:
  112|  1.07k|static void fuzz_config(const uint8_t *data, size_t size) {
  113|  1.07k|  Ogre::DataStreamPtr stream(new Ogre::MemoryDataStream(
  114|  1.07k|      "fuzz.cfg", const_cast<uint8_t *>(data), size, false, true));
  115|       |
  116|  1.07k|  Ogre::ConfigFile cf;
  117|  1.07k|  try {
  118|  1.07k|    cf.load(stream);
  119|       |
  120|       |    /* Exercise iteration over parsed sections and settings */
  121|  6.03k|    for (auto &sec : cf.getSettingsBySection()) {
  ------------------
  |  Branch (121:20): [True: 6.03k, False: 1.07k]
  ------------------
  122|  18.9k|      for (auto &kv : sec.second) {
  ------------------
  |  Branch (122:21): [True: 18.9k, False: 6.03k]
  ------------------
  123|  18.9k|        volatile const char *k = kv.first.c_str();
  124|  18.9k|        volatile const char *v = kv.second.c_str();
  125|  18.9k|        (void)k;
  126|  18.9k|        (void)v;
  127|  18.9k|      }
  128|  6.03k|    }
  129|  1.07k|  } catch (Ogre::Exception &) {
  130|      0|  } catch (std::exception &) {
  131|      0|  }
  132|  1.07k|}
ogre_deep_fuzz.cpp:_ZL22fuzz_stream_serialiserPKhm:
  134|    418|static void fuzz_stream_serialiser(const uint8_t *data, size_t size) {
  135|    418|  Ogre::DataStreamPtr stream(
  136|    418|      new Ogre::MemoryDataStream(const_cast<uint8_t *>(data), size, false, true));
  137|       |
  138|    418|  try {
  139|    418|    Ogre::StreamSerialiser serialiser(stream);
  140|       |
  141|       |    /* Try to read multiple chunks, exercising the chunk state machine */
  142|  1.24k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (142:21): [True: 1.24k, False: 3]
  ------------------
  143|  1.24k|      const Ogre::StreamSerialiser::Chunk *c = serialiser.readChunkBegin();
  144|  1.24k|      if (!c)
  ------------------
  |  Branch (144:11): [True: 0, False: 1.24k]
  ------------------
  145|      0|        break;
  146|       |
  147|       |      /* Try reading various data types from the chunk */
  148|  1.24k|      Ogre::String str;
  149|  1.24k|      try { serialiser.read(&str); } catch (...) {}
  150|       |
  151|  1.24k|      Ogre::Real r;
  152|    827|      try { serialiser.read(&r); } catch (...) {}
  153|       |
  154|    827|      Ogre::Vector3 v3;
  155|    827|      try { serialiser.read(&v3); } catch (...) {}
  156|       |
  157|    827|      Ogre::Vector4 v4;
  158|    827|      try { serialiser.read(&v4); } catch (...) {}
  159|       |
  160|    827|      serialiser.readChunkEnd(c->id);
  161|    827|    }
  162|    418|  } catch (Ogre::Exception &) {
  163|    415|  } catch (std::exception &) {
  164|      0|  }
  165|    418|}

