跳转至

增加Logger对四元数和万向锁的支持

template<typename OStream, glm::length_t L, typename T, glm::qualifier Q>
inline OStream& operator<<(OStream& os, const glm::vec<L, T, Q>& vector)
{
    return os << glm::to_string(vector);
}

template<typename OStream, glm::length_t C, glm::length_t R, typename T, glm::qualifier Q>
inline OStream& operator<<(OStream& os, const glm::mat<C, R, T, Q>& matrix)
{
    return os << glm::to_string(matrix);
}

template<typename OStream, typename T, glm::qualifier Q>
inline OStream& operator<<(OStream& os, glm::qua<T, Q> quaternio)
{
    return os << glm::to_string(quaternio);
}

在Texture中添加isLoaded来判断纹理数据是否被重载

        virtual bool IsLoaded() const override { return m_IsLoaded; }
OpenGLTexture实现就暂且省略

EditorLayer

Ref<Texture2D> texture = Texture2D::Create(texturePath.string());
if (texture->IsLoaded())
component.Texture = texture;
else
HZ_WARN("Could not load texture {0}", texturePath.filename().string());

反序列化捕获yaml异常

        YAML::Node data;
        try
        {
            data = YAML::LoadFile(filepath);
        }
        catch (YAML::ParserException e)
        {
            return false;
        }

在OpenScene增加对.crydust的文件判断

    void EditorLayer::OpenScene(const std::filesystem::path& path)
    {
        if (path.extension().string() != ".crydust")
        {
            DEBUG_WARN("Could not load {0} - not a scene file", path.filename().string());
            return;
        }

        Ref<Scene> newScene = CreateRef<Scene>();
        SceneSerializer serializer(newScene);
        if (serializer.Deserialize(path.string()))
        {
            m_ActiveScene = newScene;
            m_ActiveScene->OnViewportResize((uint32_t)m_ViewportSize.x, (uint32_t)m_ViewportSize.y);
            m_SceneHierarchyPanel.SetContext(m_ActiveScene);
        };
    }