Windows build fixes

This commit is contained in:
Jack Andersen 2019-07-27 15:21:31 -10:00
parent 5acf9ecbcf
commit 0ab08daae7
19 changed files with 55 additions and 43880 deletions

View File

@ -6,6 +6,7 @@
<mapping directory="$PROJECT_DIR$/NESEmulator/fixNES" vcs="Git" />
<mapping directory="$PROJECT_DIR$/amuse" vcs="Git" />
<mapping directory="$PROJECT_DIR$/assetnameparser/tinyxml2" vcs="Git" />
<mapping directory="$PROJECT_DIR$/cotire" vcs="Git" />
<mapping directory="$PROJECT_DIR$/discord-rpc" vcs="Git" />
<mapping directory="$PROJECT_DIR$/hecl" vcs="Git" />
<mapping directory="$PROJECT_DIR$/hecl-gui" vcs="Git" />

View File

@ -41,7 +41,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Force shared libs off" FORCE)
set(BUILD_STATIC_LIBS ON CACHE BOOL "Force static libs on" FORCE)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/sanitizers-cmake/cmake" "${CMAKE_SOURCE_DIR}/cotire/CMake" ${CMAKE_MODULE_PATH})
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/sanitizers-cmake/cmake")
find_package(Sanitizers)
if (NX)

View File

@ -453,6 +453,6 @@ struct hash<DataSpec::UniqueID128> {
};
} // namespace std
FMT_CUSTOM_FORMATTER(DataSpec::UniqueID32, fmt("{:08X}"), obj.toUint32())
FMT_CUSTOM_FORMATTER(DataSpec::UniqueID64, fmt("{:016X}"), obj.toUint64())
FMT_CUSTOM_FORMATTER(DataSpec::UniqueID128, fmt("{:016X}{:016X}"), obj.toHighUint64(), obj.toLowUint64())
FMT_CUSTOM_FORMATTER(DataSpec::UniqueID32, "{:08X}", obj.toUint32())
FMT_CUSTOM_FORMATTER(DataSpec::UniqueID64, "{:016X}", obj.toUint64())
FMT_CUSTOM_FORMATTER(DataSpec::UniqueID128, "{:016X}{:016X}", obj.toHighUint64(), obj.toLowUint64())

View File

@ -124,7 +124,7 @@ bool SpecBase::canExtract(const ExtractPassInfo& info, std::vector<ExtractReport
if (!memcmp(gameID, "R3O", 3)) {
std::srand(std::time(0));
int r = std::rand() % MomErrCount;
Log.report(logvisor::Fatal, fmt("{}"), MomErr[r]);
Log.report(logvisor::Fatal, fmt(_SYS_STR("{}")), MomErr[r]);
}
m_standalone = true;

View File

@ -137,9 +137,10 @@ static void SetupBasics(bool logging) {
auto result = zeus::validateCPU();
if (!result.first) {
#if _WIN32 && !WINDOWS_STORE
std::string msg = fmt::format(fmt("ERROR: This build of URDE requires the following CPU features:\n{}\n"),
std::wstring msg = fmt::format(
fmt(L"ERROR: This build of URDE requires the following CPU features:\n{}\n"),
urde::CPUFeatureString(result.second));
MessageBoxA(nullptr, msg.c_str(), "CPU error", MB_OK | MB_ICONERROR);
MessageBoxW(nullptr, msg.c_str(), L"CPU error", MB_OK | MB_ICONERROR);
#else
fmt::print(stderr, fmt("ERROR: This build of URDE requires the following CPU features:\n{}\n"),
urde::CPUFeatureString(result.second));

View File

@ -122,10 +122,12 @@ void CSpaceWarpFilter::draw(const zeus::CVector3f& pt) {
m_uniform.m_matrix[3][1] = pt.y() + (1.f / vp.y());
if (CGraphics::g_BooPlatform == boo::IGraphicsDataFactory::Platform::OpenGL) {
m_uniform.m_matrix[3][2] = pt.z() * 2.f - 1.f;
} else {
} else if (CGraphics::g_BooPlatform == boo::IGraphicsDataFactory::Platform::Vulkan) {
m_uniform.m_matrix[1][1] *= -1.f;
m_uniform.m_matrix[3][1] *= -1.f;
m_uniform.m_matrix[3][2] = pt.z();
} else {
m_uniform.m_matrix[3][2] = pt.z();
}
if (clipRect.x4_left) {

View File

@ -171,30 +171,30 @@ struct hash<urde::CAssetId> {
};
} // namespace std
FMT_CUSTOM_FORMATTER(urde::CAssetId, fmt("{:08X}"), obj.Value())
FMT_CUSTOM_FORMATTER(urde::TEditorId, fmt("{:08X}"), obj.id)
FMT_CUSTOM_FORMATTER(urde::TUniqueId, fmt("{:04X}"), obj.id)
FMT_CUSTOM_FORMATTER(urde::SObjectTag, fmt("{} {}"), obj.type, obj.id)
FMT_CUSTOM_FORMATTER(urde::CAssetId, "{:08X}", obj.Value())
FMT_CUSTOM_FORMATTER(urde::TEditorId, "{:08X}", obj.id)
FMT_CUSTOM_FORMATTER(urde::TUniqueId, "{:04X}", obj.id)
FMT_CUSTOM_FORMATTER(urde::SObjectTag, "{} {}", obj.type, obj.id)
FMT_CUSTOM_FORMATTER(zeus::CVector3f, fmt("({} {} {})"), float(obj.x()), float(obj.y()), float(obj.z()))
FMT_CUSTOM_FORMATTER(zeus::CVector2f, fmt("({} {})"), float(obj.x()), float(obj.y()))
FMT_CUSTOM_FORMATTER(zeus::CMatrix3f, fmt("\n({} {} {})"
FMT_CUSTOM_FORMATTER(zeus::CVector3f, "({} {} {})", float(obj.x()), float(obj.y()), float(obj.z()))
FMT_CUSTOM_FORMATTER(zeus::CVector2f, "({} {})", float(obj.x()), float(obj.y()))
FMT_CUSTOM_FORMATTER(zeus::CMatrix3f, "\n({} {} {})"
"\n({} {} {})"
"\n({} {} {})"),
"\n({} {} {})",
float(obj[0][0]), float(obj[1][0]), float(obj[2][0]),
float(obj[0][1]), float(obj[1][1]), float(obj[2][1]),
float(obj[0][2]), float(obj[1][2]), float(obj[2][2]))
FMT_CUSTOM_FORMATTER(zeus::CMatrix4f, fmt("\n({} {} {} {})"
FMT_CUSTOM_FORMATTER(zeus::CMatrix4f, "\n({} {} {} {})"
"\n({} {} {} {})"
"\n({} {} {} {})"
"\n({} {} {} {})"),
"\n({} {} {} {})",
float(obj[0][0]), float(obj[1][0]), float(obj[2][0]), float(obj[3][0]),
float(obj[0][1]), float(obj[1][1]), float(obj[2][1]), float(obj[3][1]),
float(obj[0][2]), float(obj[1][2]), float(obj[2][2]), float(obj[3][2]),
float(obj[0][3]), float(obj[1][3]), float(obj[2][3]), float(obj[3][3]))
FMT_CUSTOM_FORMATTER(zeus::CTransform, fmt("\n({} {} {} {})"
FMT_CUSTOM_FORMATTER(zeus::CTransform, "\n({} {} {} {})"
"\n({} {} {} {})"
"\n({} {} {} {})"),
"\n({} {} {} {})",
float(obj.basis[0][0]), float(obj.basis[1][0]), float(obj.basis[2][0]), float(obj.origin[0]),
float(obj.basis[0][1]), float(obj.basis[1][1]), float(obj.basis[2][1]), float(obj.origin[1]),
float(obj.basis[0][2]), float(obj.basis[1][2]), float(obj.basis[2][2]), float(obj.origin[2]))

View File

@ -1,6 +1,7 @@
SamplerState samp : register(s0);
SamplerState clampSamp : register(s1);
SamplerState reflectSamp : register(s2);
SamplerState clampEdgeSamp : register(s3);
Texture2D lightmap : register(t0);
Texture2D diffuse : register(t1);
Texture2D emissive : register(t2);
@ -287,8 +288,8 @@ float4 PostFunc(in VertToFrag vtf, float4 colorIn) {
#if defined(URDE_MB_SHADOW)
float4 PostFunc(in VertToFrag vtf, float4 colorIn) {
float idTexel = extTex0.Sample(samp, vtf.extUvs[0]).a;
float sphereTexel = extTex1.Sample(clampSamp, vtf.extUvs[1]).r;
float fadeTexel = extTex2.Sample(clampSamp, vtf.extUvs[2]).a;
float sphereTexel = extTex1.Sample(clampEdgeSamp, vtf.extUvs[1]).r;
float fadeTexel = extTex2.Sample(clampEdgeSamp, vtf.extUvs[2]).a;
float val = ((abs(idTexel - shadowId) < 0.001) ?
(dot(vtf.mvNorm.xyz, shadowUp.xyz) * shadowUp.w) : 0.0) *
sphereTexel * fadeTexel;

View File

@ -246,7 +246,7 @@ float4 FogFunc(thread VertToFrag& vtf, constant LightingUniform& lu, float4 colo
#if defined(URDE_LIGHTING) || defined(URDE_LIGHTING_SHADOW) || defined(URDE_LIGHTING_CUBE_REFLECTION) || defined(URDE_LIGHTING_CUBE_REFLECTION_SHADOW)
float4 PostFunc(thread VertToFrag& vtf, constant LightingUniform& lu,
texture2d<float> extTex0, texture2d<float> extTex1, texture2d<float> extTex2,
sampler samp, sampler clampSamp, float4 colorIn) {
sampler samp, sampler clampSamp, sampler clampEdgeSamp, float4 colorIn) {
return FogFunc(vtf, lu, colorIn) * lu.mulColor + lu.addColor;
}
#endif
@ -254,7 +254,7 @@ float4 PostFunc(thread VertToFrag& vtf, constant LightingUniform& lu,
#if defined(URDE_THERMAL_HOT)
float4 PostFunc(thread VertToFrag& vtf, constant LightingUniform& lu,
texture2d<float> extTex0, texture2d<float> extTex1, texture2d<float> extTex2,
sampler samp, sampler clampSamp, float4 colorIn) {
sampler samp, sampler clampSamp, sampler clampEdgeSamp, float4 colorIn) {
return extTex0.sample(samp, vtf.extUvs0).rrrr * lu.tmulColor + lu.taddColor;
}
#endif
@ -262,7 +262,7 @@ float4 PostFunc(thread VertToFrag& vtf, constant LightingUniform& lu,
#if defined(URDE_THERMAL_COLD)
float4 PostFunc(thread VertToFrag& vtf, constant LightingUniform& lu,
texture2d<float> extTex0, texture2d<float> extTex1, texture2d<float> extTex2,
sampler samp, sampler clampSamp, float4 colorIn) {
sampler samp, sampler clampSamp, sampler clampEdgeSamp, float4 colorIn) {
return colorIn * float4(0.75, 0.75, 0.75, 0.75);
}
#endif
@ -270,7 +270,7 @@ float4 PostFunc(thread VertToFrag& vtf, constant LightingUniform& lu,
#if defined(URDE_SOLID)
float4 PostFunc(thread VertToFrag& vtf, constant LightingUniform& lu,
texture2d<float> extTex0, texture2d<float> extTex1, texture2d<float> extTex2,
sampler samp, sampler clampSamp, float4 colorIn) {
sampler samp, sampler clampSamp, sampler clampEdgeSamp, float4 colorIn) {
return lu.solidColor;
}
#endif
@ -278,10 +278,10 @@ float4 PostFunc(thread VertToFrag& vtf, constant LightingUniform& lu,
#if defined(URDE_MB_SHADOW)
float4 PostFunc(thread VertToFrag& vtf, constant LightingUniform& lu,
texture2d<float> extTex0, texture2d<float> extTex1, texture2d<float> extTex2,
sampler samp, sampler clampSamp, float4 colorIn) {
sampler samp, sampler clampSamp, sampler clampEdgeSamp, float4 colorIn) {
float idTexel = extTex0.sample(samp, vtf.extUvs0).a;
float sphereTexel = extTex1.sample(clampSamp, vtf.extUvs1).r;
float fadeTexel = extTex2.sample(clampSamp, vtf.extUvs2).a;
float sphereTexel = extTex1.sample(clampEdgeSamp, vtf.extUvs1).r;
float fadeTexel = extTex2.sample(clampEdgeSamp, vtf.extUvs2).a;
float val = ((abs(idTexel - lu.shadowId) < 0.001) ?
(dot(vtf.mvNorm.xyz, lu.shadowUp.xyz) * lu.shadowUp.w) : 0.0) *
sphereTexel * fadeTexel;
@ -292,7 +292,7 @@ float4 PostFunc(thread VertToFrag& vtf, constant LightingUniform& lu,
#if defined(URDE_DISINTEGRATE)
float4 PostFunc(thread VertToFrag& vtf, constant LightingUniform& lu,
texture2d<float> extTex0, texture2d<float> extTex1, texture2d<float> extTex2,
sampler samp, sampler clampSamp, float4 colorIn) {
sampler samp, sampler clampSamp, sampler clampEdgeSamp, float4 colorIn) {
float4 texel0 = extTex0.sample(samp, vtf.extUvs0);
float4 texel1 = extTex0.sample(samp, vtf.extUvs1);
colorIn = mix(float4(0.0, 0.0, 0.0, 0.0), texel1, texel0);
@ -322,6 +322,7 @@ fragment float4 fmain(VertToFrag vtf [[ stage_in ]],
sampler samp [[ sampler(0) ]],
sampler clampSamp [[ sampler(1) ]],
sampler reflectSamp [[ sampler(2) ]],
sampler clampEdgeSamp [[ sampler(3) ]],
texture2d<float> lightmap [[ texture(0) ]],
texture2d<float> diffuse [[ texture(1) ]],
texture2d<float> emissive [[ texture(2) ]],
@ -371,7 +372,7 @@ fragment float4 fmain(VertToFrag vtf [[ stage_in ]],
SampleTexture_reflection() + ReflectionFunc();
tmp.a = SampleTextureAlpha_alpha();
#endif
float4 colorOut = PostFunc(vtf, lu, extTex0, extTex1, extTex2, samp, clampSamp, tmp);
float4 colorOut = PostFunc(vtf, lu, extTex0, extTex1, extTex2, samp, clampSamp, clampEdgeSamp, tmp);
#if defined(URDE_ALPHA_TEST)
if (colorOut.a < 0.25)
discard_fragment();

View File

@ -400,6 +400,7 @@ static std::string _BuildFS(const SFluidPlaneShaderInfo& info) {
lightmapUv = nextTCG;
fmt::print(out, fmt("vtf.uvs[{}] = mul(texMtxs[{}], pos).xy;"), nextTCG++, nextMtx++);
}
out << '\n';
out << "#define COMBINER_EXPRS ";
switch (info.m_type) {

2
amuse

@ -1 +1 @@
Subproject commit b0e4973c6485e79bb9d24c96de7a6cea53b1b986
Subproject commit 1e35db90aa9f3a737c66947323e7eabff299d7ab

2
hecl

@ -1 +1 @@
Subproject commit 056c2f330e2dc1c5b5f93bfca848e73036046a0f
Subproject commit 920fcb3c3d90f3db95f097c235597aff211227bc

@ -1 +1 @@
Subproject commit 34394f67ead4d822e0fa0f0d6705c0a005fbfb73
Subproject commit 0ed3cda78bbf70d79b45167dac8a02860132f650

2
nod

@ -1 +1 @@
Subproject commit 37792ba116513e1fae11c57602d1e640342f67db
Subproject commit ac6f2a1ed2e1405462bce2eae6da0bb81f6de8e2

@ -1 +1 @@
Subproject commit cd88683372cbc59140a66ee98587058f8bdb985f
Subproject commit 8c17f7c154cabf9505818a49700ce5102c169561

View File

@ -13,7 +13,7 @@ else()
endif()
if(APPLE)
set(PLAT_SRCS MainMac.mm glew.c)
set(PLAT_SRCS MainMac.mm)
set_source_files_properties(MainMac.mm PROPERTIES COMPILE_FLAGS -fobjc-arc)
elseif(WIN32)
set(PLAT_SRCS MainWin.cpp)
@ -32,6 +32,6 @@ if(APPLE)
set(PLAT_LIBS ${OPENGL_LIBRARY})
endif()
target_link_libraries(visigen logvisor athena-core zeus boo
target_link_libraries(visigen logvisor athena-core zeus glew
xxhash ${ZLIB_LIBRARIES} lzokay hecl-light ${PLAT_LIBS})
endif()

View File

@ -8,11 +8,9 @@
#include <thread>
static logvisor::Module AthenaLog("Athena");
static void AthenaExc(athena::error::Level level, const char* file, const char*, int line, const char* fmt, ...) {
va_list ap;
va_start(ap, fmt);
AthenaLog.report(logvisor::Level(level), fmt, ap);
va_end(ap);
static void AthenaExc(athena::error::Level level, const char* /*file*/, const char*, int /*line*/,
fmt::string_view fmt, fmt::format_args args) {
AthenaLog.vreport(logvisor::Level(level), fmt, args);
}
static float s_Percent = 0.f;
@ -125,11 +123,12 @@ int wmain(int argc, const hecl::SystemChar** argv) {
/* Quit message from client thread */
PostQuitMessage(0);
continue;
case WM_USER + 1:
case WM_USER + 1: {
/* Update window title from client thread */
std::wstring title = fmt::format(fmt(L"VISIGen [{:g}%]"), s_Percent * 100.f);
SetWindowTextW(window, title.c_str());
continue;
}
default:
break;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff