Windows fixes

This commit is contained in:
Jack Andersen 2019-01-28 22:25:51 -10:00
parent 7542cb9650
commit f35285b076
3 changed files with 7 additions and 7 deletions

2
hecl/extern/athena vendored

@ -1 +1 @@
Subproject commit 1014a3ccdab4e312952a4a5f1fd7151b3c9f8970 Subproject commit af7d73f9bd5815a8896f1611e4eb457369010f69

View File

@ -68,7 +68,7 @@ private:
virtual std::string EmitVec3(const atVec4f& vec) const = 0; virtual std::string EmitVec3(const atVec4f& vec) const = 0;
virtual std::string EmitVec3(const std::string& a, const std::string& b, const std::string& c) const = 0; virtual std::string EmitVec3(const std::string& a, const std::string& b, const std::string& c) const = 0;
std::string EmitVal(float val) const { return hecl::Format("%g", val); } std::string EmitVal(float val) const { return hecl::Format("%f", val); }
std::string EmitAdd(const std::string& a, const std::string& b) const { return '(' + a + '+' + b + ')'; } std::string EmitAdd(const std::string& a, const std::string& b) const { return '(' + a + '+' + b + ')'; }

View File

@ -163,9 +163,9 @@ std::string HLSL::makeVert(unsigned col, unsigned uv, unsigned w, unsigned s, si
" float4 objNorm = float4(0.0,0.0,0.0,0.0);\n"; " float4 objNorm = float4(0.0,0.0,0.0,0.0);\n";
for (size_t i = 0; i < s; ++i) for (size_t i = 0; i < s; ++i)
retval += hecl::Format( retval += hecl::Format(
" objPos += mul(mv[%" PRISize "], float4(v.posIn, 1.0)) * v.weightIn[%" PRISize "][%" PRISize " objPos += mul(objs[%" PRISize "], float4(v.posIn, 1.0)) * v.weightIn[%" PRISize "][%" PRISize
"];\n" "];\n"
" objNorm += mul(mvInv[%" PRISize "], float4(v.normIn, 1.0)) * v.weightIn[%" PRISize "][%" PRISize "];\n", " objNorm += mul(objsInv[%" PRISize "], float4(v.normIn, 1.0)) * v.weightIn[%" PRISize "][%" PRISize "];\n",
i, i / 4, i % 4, i, i / 4, i % 4); i, i / 4, i % 4, i, i / 4, i % 4);
retval += retval +=
" objPos[3] = 1.0;\n" " objPos[3] = 1.0;\n"
@ -176,11 +176,11 @@ std::string HLSL::makeVert(unsigned col, unsigned uv, unsigned w, unsigned s, si
} else { } else {
/* non-skinned */ /* non-skinned */
retval += retval +=
" float4 objPos = float4(posIn, 1.0);\n" " float4 objPos = float4(v.posIn, 1.0);\n"
" float4 objNorm = float4(normIn, 0.0);\n" " float4 objNorm = float4(v.normIn, 0.0);\n"
" vtf.mvPos = mul(mv, objPos);\n" " vtf.mvPos = mul(mv, objPos);\n"
" vtf.mvNorm = mul(mvInv, objNorm);\n" " vtf.mvNorm = mul(mvInv, objNorm);\n"
" gl_Position = mul(proj, vtf.mvPos);\n"; " vtf.mvpPos = mul(proj, vtf.mvPos);\n";
} }
retval += " float4 tmpProj;\n"; retval += " float4 tmpProj;\n";