Пример #1
0
void cyg_hal_user_break( CYG_ADDRWORD *regs )
{

#if defined(CYGSEM_HAL_USE_ROM_MONITOR_GDB_stubs)

        {
            extern CYG_ADDRESS hal_virtual_vector_table[64];        
            typedef void install_bpt_fn(void *pc);
            CYG_WORD32 retpc = ((CYG_WORD32 *)(&regs))[-1];
            CYG_WORD32 pc;
            HAL_SavedRegisters *sreg = (HAL_SavedRegisters *)regs;
            install_bpt_fn *ibp = (install_bpt_fn *)hal_virtual_vector_table[35];

            if( regs == NULL ) pc = retpc;
            else pc = sreg->pc;

            if( ibp != NULL ) ibp((void *)pc);
        }
    
#elif defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS)

    {
        extern void breakpoint(void);
        breakpoint();
    }
    
#else

    HAL_BREAKPOINT(breakinst);

#endif
}
Пример #2
0
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
 bool Mesh::Build(const MeshDescriptor& in_meshDesc)
 {
     bool bSuccess = true;
     
     //set the bounds
     SetBounds(in_meshDesc.mvMinBounds, in_meshDesc.mvMaxBounds);
     
     if (in_meshDesc.mFeatures.mbHasAnimationData == true)
     {
         m_skeleton = SkeletonUPtr(new Skeleton());
         m_skeleton->Build(in_meshDesc.m_skeletonDesc);
     }
     
     //iterate through each mesh
     int count = 0;
     for (auto it = in_meshDesc.mMeshes.begin(); it != in_meshDesc.mMeshes.end(); ++it)
     {
         //caclulate the mesh capacities
         u32 udwVertexDataCapacity = it->mudwNumVertices * in_meshDesc.mVertexDeclaration.GetTotalSize();
         u32 udwIndexDataCapacity  = it->mudwNumIndices * in_meshDesc.mudwIndexSize;
         
         //prepare the mesh if it needs it, otherwise just update the vertex and index declarations.
         SubMesh* newSubMesh = CreateSubMesh(it->mstrName);
         newSubMesh->Prepare(Core::Application::Get()->GetRenderSystem(), in_meshDesc.mVertexDeclaration, in_meshDesc.mudwIndexSize, udwVertexDataCapacity, udwIndexDataCapacity, BufferAccess::k_read, it->ePrimitiveType);
         
         //check that the buffers are big enough to hold this data. if not throw an error.
         if (udwVertexDataCapacity <= newSubMesh->GetInternalMeshBuffer()->GetVertexCapacity() &&
             udwIndexDataCapacity <= newSubMesh->GetInternalMeshBuffer()->GetIndexCapacity())
         {
             newSubMesh->Build(it->mpVertexData, it->mpIndexData, it->mudwNumVertices, it->mudwNumIndices, it->mvMinBounds, it->mvMaxBounds);
         }
         else
         {
             CS_LOG_ERROR("Sub mesh data exceeds its buffer capacity. Mesh will return empty!");
             bSuccess = false;
         }
         
         //add the skeleton controller
         if (in_meshDesc.mFeatures.mbHasAnimationData == true)
         {
             InverseBindPosePtr ibp(new InverseBindPose());
             ibp->mInverseBindPoseMatrices = it->mInverseBindPoseMatrices;
             newSubMesh->SetInverseBindPose(ibp);
         }
         
         count++;
     }
     
     CalcVertexAndIndexCounts();
     
     //return success
     return bSuccess;
 }