Windows Fixes

This commit is contained in:
Jack Andersen 2016-09-18 15:04:26 -10:00
parent b9baa84b1d
commit 22c3ce608d
7 changed files with 70 additions and 7 deletions

View File

@ -1,5 +1,4 @@
#include "ATBL.hpp"
#include "Athena/Athena/DNAYaml.hpp"
namespace DataSpec
{

View File

@ -3,6 +3,7 @@
#include "DNACommon.hpp"
#include "boo/ThreadLocalPtr.hpp"
#include <array>
namespace DataSpec
{
@ -91,18 +92,18 @@ struct ResExtractor
ResExtractor() = default;
ResExtractor(std::function<bool(PAKEntryReadStream&, const hecl::ProjectPath&)>&& func,
ResExtractor(std::function<bool(PAKEntryReadStream&, const hecl::ProjectPath&)> func,
std::array<const hecl::SystemChar*, 6>&& fileExtsIn, unsigned weightin=0,
std::function<void(const SpecBase&, PAKEntryReadStream&, PAKRouter<PAKBRIDGE>&,
typename PAKBRIDGE::PAKType::Entry&)>&& nfunc={})
typename PAKBRIDGE::PAKType::Entry&)> nfunc={})
: func_a(std::move(func)), fileExts(std::move(fileExtsIn)), weight(weightin), func_name(std::move(nfunc)) {}
ResExtractor(std::function<bool(const SpecBase&, PAKEntryReadStream&, const hecl::ProjectPath&, PAKRouter<PAKBRIDGE>&,
const typename PAKBRIDGE::PAKType::Entry&, bool, hecl::BlenderToken&,
std::function<void(const hecl::SystemChar*)>)>&& func,
std::function<void(const hecl::SystemChar*)>)> func,
std::array<const hecl::SystemChar*, 6>&& fileExtsIn, unsigned weightin=0,
std::function<void(const SpecBase&, PAKEntryReadStream&, PAKRouter<PAKBRIDGE>&,
typename PAKBRIDGE::PAKType::Entry&)>&& nfunc={})
typename PAKBRIDGE::PAKType::Entry&)> nfunc={})
: func_b(std::move(func)), fileExts(std::move(fileExtsIn)), weight(weightin), func_name(std::move(nfunc)) {}
};

View File

@ -3,6 +3,9 @@
#include <clocale>
#include <algorithm>
#undef min
#undef max
extern "C" const uint8_t L_en_US[];
extern "C" size_t L_en_US_SZ;

View File

@ -34,10 +34,12 @@ u16 CSfxManager::TranslateSFXID(u16 id)
CSfxHandle CSfxManager::SfxStop(const CSfxHandle& handle)
{
return {};
}
CSfxHandle CSfxManager::SfxStart(u16 id, s16 vol, s16 pan, bool active, s16 prio, bool inArea, s32 areaId)
{
return {};
}
}

View File

@ -51,6 +51,22 @@ static const char* FS =
" return vtf.color * float4(tex.Sample(samp, vtf.uv).rgb, 1.0);\n"
"}\n";
static const char* FSAlpha =
"struct VertToFrag\n"
"{\n"
" float4 position : SV_Position;\n"
" float4 color : COLOR;\n"
" float2 uv : UV;\n"
"};\n"
"\n"
"Texture2D tex : register(t0);\n"
"SamplerState samp : register(s0);\n"
"\n"
"float4 main(in VertToFrag vtf) : SV_Target0\n"
"{\n"
" return vtf.color * tex.Sample(samp, vtf.uv);\n"
"}\n";
URDE_DECL_SPECIALIZE_MULTI_BLEND_SHADER(CTexturedQuadFilter)
struct CTexturedQuadFilterD3DDataBindingFactory : TMultiBlendShader<CTexturedQuadFilter>::IDataBindingFactory
@ -95,4 +111,46 @@ CTexturedQuadFilter::Initialize(boo::ID3DDataFactory::Context& ctx,
return new CTexturedQuadFilterD3DDataBindingFactory;
}
struct CTexturedQuadFilterAlphaD3DDataBindingFactory : TMultiBlendShader<CTexturedQuadFilterAlpha>::IDataBindingFactory
{
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
boo::IShaderPipeline* pipeline,
boo::IVertexFormat* vtxFmt,
CTexturedQuadFilterAlpha& filter)
{
boo::ID3DDataFactory::Context& cctx = static_cast<boo::ID3DDataFactory::Context&>(ctx);
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
boo::ITexture* texs[] = {filter.m_booTex};
return cctx.newShaderDataBinding(pipeline, vtxFmt,
filter.m_vbo, nullptr, nullptr, 1, bufs,
nullptr, nullptr, nullptr, 1, texs);
}
};
TMultiBlendShader<CTexturedQuadFilterAlpha>::IDataBindingFactory*
CTexturedQuadFilterAlpha::Initialize(boo::ID3DDataFactory::Context& ctx,
boo::IShaderPipeline*& alphaPipeOut,
boo::IShaderPipeline*& additivePipeOut,
boo::IShaderPipeline*& colorMultiplyPipeOut,
boo::IVertexFormat*& vtxFmtOut)
{
const boo::VertexElementDescriptor VtxVmt[] =
{
{nullptr, nullptr, boo::VertexSemantic::Position4},
{nullptr, nullptr, boo::VertexSemantic::UV4}
};
vtxFmtOut = ctx.newVertexFormat(2, VtxVmt);
alphaPipeOut = ctx.newShaderPipeline(VS, FSAlpha, ComPtr<ID3DBlob>(), ComPtr<ID3DBlob>(), ComPtr<ID3DBlob>(),
vtxFmtOut, boo::BlendFactor::SrcAlpha,
boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, false, false, false);
additivePipeOut = ctx.newShaderPipeline(VS, FSAlpha, ComPtr<ID3DBlob>(), ComPtr<ID3DBlob>(), ComPtr<ID3DBlob>(),
vtxFmtOut, boo::BlendFactor::SrcAlpha,
boo::BlendFactor::One, boo::Primitive::TriStrips, false, false, false);
colorMultiplyPipeOut = ctx.newShaderPipeline(VS, FSAlpha, ComPtr<ID3DBlob>(), ComPtr<ID3DBlob>(), ComPtr<ID3DBlob>(),
vtxFmtOut, boo::BlendFactor::SrcColor,
boo::BlendFactor::DstColor, boo::Primitive::TriStrips, false, false, false);
return new CTexturedQuadFilterAlphaD3DDataBindingFactory;
}
}

2
hecl

@ -1 +1 @@
Subproject commit a0748dc4e2232491db9dad971819c7a93f2a5691
Subproject commit 262a74e1d5b3888677cfcf380d9e75ee7ea94b9d

@ -1 +1 @@
Subproject commit 5234b60d7ce9be7f219bd147b80820816efe2a5f
Subproject commit 067c86a585cc43513c3e2c667612d82aacf9809f