Skip to content

Commit

Permalink
fix WSL build
Browse files Browse the repository at this point in the history
  • Loading branch information
stohrendorf committed Apr 3, 2021
1 parent 3cf2636 commit 98de768
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion cmake/get_glm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ else()
target_include_directories( glm SYSTEM BEFORE INTERFACE ${GLM_INCLUDE_DIR} )
endif()
endif()
target_compile_definitions( glm INTERFACE -DGLM_ENABLE_EXPERIMENTAL -DGLM_FORCE_RADIANS )
target_compile_definitions( glm INTERFACE -DGLM_ENABLE_EXPERIMENTAL -DGLM_FORCE_RADIANS -DGLM_FORCE_CXX${CMAKE_CXX_STANDARD} )
17 changes: 9 additions & 8 deletions src/engine/skeletalmodelnode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "world/rendermeshdata.h"
#include "world/transition.h"

#include <glm/gtc/matrix_transform.hpp>
#include <stack>
#include <utility>

Expand Down Expand Up @@ -102,7 +103,7 @@ void SkeletalModelNode::updatePose(const InterpolationInfo& framePair)

const auto angleDataFirst = framePair.firstFrame->getAngleData();
std::stack<glm::mat4> transformsFirst;
transformsFirst.push(translate(glm::mat4{1.0f}, framePair.firstFrame->pos.toGl())
transformsFirst.push(glm::translate(glm::mat4{1.0f}, framePair.firstFrame->pos.toGl())
* core::fromPackedAngles(angleDataFirst[0]) * m_meshParts[0].patch);

const auto angleDataSecond = framePair.secondFrame->getAngleData();
Expand Down Expand Up @@ -232,11 +233,11 @@ std::vector<SkeletalModelNode::Sphere> SkeletalModelNode::getBoneCollisionSphere
}

transforms.top()
= translate(transforms.top(), frame.pos.toGl()) * core::fromPackedAngles(angleData[0]) * m_meshParts[0].patch;
= glm::translate(transforms.top(), frame.pos.toGl()) * core::fromPackedAngles(angleData[0]) * m_meshParts[0].patch;

std::vector<Sphere> result;
result.emplace_back(translate(glm::mat4{1.0f}, pos.toRenderSystem())
+ translate(transforms.top(), m_model->bones[0].center.toRenderSystem()),
result.emplace_back(glm::translate(glm::mat4{1.0f}, pos.toRenderSystem())
+ glm::translate(transforms.top(), m_model->bones[0].center.toRenderSystem()),
m_model->bones[0].collisionSize);

for(gsl::index i = 1; i < m_model->bones.size(); ++i)
Expand All @@ -251,12 +252,12 @@ std::vector<SkeletalModelNode::Sphere> SkeletalModelNode::getBoneCollisionSphere
}

if(frame.numValues < i)
transforms.top() *= translate(glm::mat4{1.0f}, m_model->bones[i].position) * m_meshParts[i].patch;
transforms.top() *= glm::translate(glm::mat4{1.0f}, m_model->bones[i].position) * m_meshParts[i].patch;
else
transforms.top() *= translate(glm::mat4{1.0f}, m_model->bones[i].position) * core::fromPackedAngles(angleData[i])
* m_meshParts[i].patch;
transforms.top() *= glm::translate(glm::mat4{1.0f}, m_model->bones[i].position)
* core::fromPackedAngles(angleData[i]) * m_meshParts[i].patch;

auto m = translate(transforms.top(), m_model->bones[i].center.toRenderSystem());
auto m = glm::translate(transforms.top(), m_model->bones[i].center.toRenderSystem());
m[3] += glm::vec4(pos.toRenderSystem(), 0);
result.emplace_back(m, m_model->bones[i].collisionSize);
}
Expand Down
2 changes: 1 addition & 1 deletion src/engine/world/world.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ struct UVRect
xy1.y = std::max(t0.y, t1.y);
}

constexpr bool operator==(const UVRect& rhs) const noexcept
bool operator==(const UVRect& rhs) const noexcept
{
return xy0 == rhs.xy0 && xy1 == rhs.xy1;
}
Expand Down
1 change: 1 addition & 0 deletions src/render/scene/shadercache.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <filesystem>
#include <gsl/gsl-lite.hpp>
#include <unordered_map>
#include <vector>

namespace render::scene
{
Expand Down
1 change: 1 addition & 0 deletions src/soglb/gl/pixel.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "typetraits.h"

#include <algorithm>
#include <glm/glm.hpp>

namespace gl
Expand Down
4 changes: 3 additions & 1 deletion src/video/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ struct FilterGraph
stream.stream->time_base.den,
stream.stream->codecpar->sample_aspect_ratio.num,
stream.stream->codecpar->sample_aspect_ratio.den);
gsl::ensure_z(filterGraphArgs.data(), filterGraphArgs.size());
{
[[maybe_unused]] const auto check = gsl::ensure_z(filterGraphArgs.data(), filterGraphArgs.size());
}

if(avfilter_graph_create_filter(
&input, avfilter_get_by_name("buffer"), "in", filterGraphArgs.data(), nullptr, graph)
Expand Down

0 comments on commit 98de768

Please sign in to comment.