Windows fixes

This commit is contained in:
Jack Andersen 2016-09-10 15:25:59 -10:00
parent 2563b78a82
commit 64b85786de
17 changed files with 82 additions and 93 deletions

View File

@ -75,11 +75,7 @@ PAKBridge::PAKBridge(hecl::Database::Project& project,
static hecl::SystemString LayerName(const std::string& name)
{
#if HECL_UCS2
hecl::SystemString ret = hecl::UTF8ToWide(name);
#else
hecl::SystemString ret = name;
#endif
hecl::SystemString ret = hecl::SystemStringView(name).sys_str();
for (auto& ch : ret)
if (ch == _S('/') || ch == _S('\\'))
ch = _S('-');
@ -101,11 +97,8 @@ void PAKBridge::build()
mlvl.read(rs);
}
bool named;
#if HECL_UCS2
level.name = hecl::UTF8ToWide(m_pak.bestEntryName(entry, named));
#else
level.name = m_pak.bestEntryName(entry, named);
#endif
std::string bestName = m_pak.bestEntryName(entry, named);
level.name = hecl::SystemStringView(bestName).sys_str();
level.areas.reserve(mlvl.areaCount);
unsigned layerIdx = 0;
@ -158,21 +151,14 @@ void PAKBridge::build()
}
if (areaDeps.name.empty())
{
#if HECL_UCS2
areaDeps.name = _S("MREA_") + hecl::UTF8ToWide(area.areaMREAId.toString());
#else
areaDeps.name = "MREA_" + area.areaMREAId.toString();
#endif
std::string idStr = area.areaMREAId.toString();
areaDeps.name = _S("MREA_") + hecl::SystemStringView(idStr).sys_str();
}
hecl::SystemChar num[16];
hecl::SNPrintf(num, 16, _S("%02u "), ai);
areaDeps.name = num + areaDeps.name;
#if HECL_UCS2
std::string lowerName = hecl::WideToUTF8(areaDeps.name);
#else
std::string lowerName(areaDeps.name);
#endif
std::string lowerName = hecl::SystemUTF8View(areaDeps.name).str();
for (char& ch : lowerName)
{
ch = tolower(ch);

View File

@ -61,11 +61,7 @@ PAKBridge::PAKBridge(hecl::Database::Project& project,
static hecl::SystemString LayerName(const std::string& name)
{
#if HECL_UCS2
hecl::SystemString ret = hecl::UTF8ToWide(name);
#else
hecl::SystemString ret = name;
#endif
hecl::SystemString ret = hecl::SystemStringView(name).sys_str();
for (auto& ch : ret)
if (ch == _S('/') || ch == _S('\\'))
ch = _S('-');
@ -87,11 +83,8 @@ void PAKBridge::build()
mlvl.read(rs);
}
bool named;
#if HECL_UCS2
level.name = hecl::UTF8ToWide(m_pak.bestEntryName(entry, named));
#else
level.name = m_pak.bestEntryName(entry, named);
#endif
std::string bestName = m_pak.bestEntryName(entry, named);
level.name = hecl::SystemStringView(bestName).sys_str();
level.areas.reserve(mlvl.areaCount);
unsigned layerIdx = 0;
@ -135,18 +128,11 @@ void PAKBridge::build()
}
if (areaDeps.name.empty())
{
#if HECL_UCS2
areaDeps.name = hecl::UTF8ToWide(area.internalAreaName);
#else
areaDeps.name = area.internalAreaName;
#endif
areaDeps.name = hecl::SystemStringView(area.internalAreaName).sys_str();
if (areaDeps.name.empty())
{
#if HECL_UCS2
areaDeps.name = _S("MREA_") + hecl::UTF8ToWide(area.areaMREAId.toString());
#else
areaDeps.name = "MREA_" + area.areaMREAId.toString();
#endif
std::string idStr = area.areaMREAId.toString();
areaDeps.name = _S("MREA_") + hecl::SystemStringView(idStr).sys_str();
}
}
hecl::SystemChar num[16];

View File

@ -70,11 +70,7 @@ PAKBridge::PAKBridge(hecl::Database::Project& project,
static hecl::SystemString LayerName(const std::string& name)
{
#if HECL_UCS2
hecl::SystemString ret = hecl::UTF8ToWide(name);
#else
hecl::SystemString ret = name;
#endif
hecl::SystemString ret = hecl::SystemStringView(name).sys_str();
for (auto& ch : ret)
if (ch == _S('/') || ch == _S('\\'))
ch = _S('-');
@ -96,11 +92,8 @@ void PAKBridge::build()
mlvl.read(rs);
}
bool named;
#if HECL_UCS2
level.name = hecl::UTF8ToWide(m_pak.bestEntryName(entry, named));
#else
level.name = m_pak.bestEntryName(entry, named);
#endif
std::string bestName = m_pak.bestEntryName(entry, named);
level.name = hecl::SystemStringView(bestName).sys_str();
level.areas.reserve(mlvl.areaCount);
unsigned layerIdx = 0;
@ -144,18 +137,11 @@ void PAKBridge::build()
}
if (areaDeps.name.empty())
{
#if HECL_UCS2
areaDeps.name = hecl::UTF8ToWide(area.internalAreaName);
#else
areaDeps.name = area.internalAreaName;
#endif
areaDeps.name = hecl::SystemStringView(area.internalAreaName).sys_str();
if (areaDeps.name.empty())
{
#if HECL_UCS2
areaDeps.name = _S("MREA_") + hecl::UTF8ToWide(area.areaMREAId.toString());
#else
areaDeps.name = "MREA_" + area.areaMREAId.toString();
#endif
std::string idStr = area.areaMREAId.toString();
areaDeps.name = _S("MREA_") + hecl::SystemStringView(idStr).sys_str();
}
}
hecl::SystemChar num[16];
@ -173,13 +159,13 @@ void PAKBridge::build()
layer.name = LayerName(mlvl.layerNames[layerIdx++]);
layer.active = layerFlags.flags >> (l-1) & 0x1;
/* Trim possible trailing whitespace */
#if HECL_UCS2
#if HECL_UCS2
while (layer.name.size() && iswspace(layer.name.back()))
layer.name.pop_back();
#else
#else
while (layer.name.size() && isspace(layer.name.back()))
layer.name.pop_back();
#endif
#endif
hecl::SNPrintf(num, 16, _S("%02u "), l-1);
layer.name = num + layer.name;
}

View File

@ -21,18 +21,22 @@ CAnimTreeBlend::CAnimTreeBlend(bool b1,
SAdvancementResults CAnimTreeBlend::VAdvanceView(const CCharAnimTime& a)
{
return {};
}
CCharAnimTime CAnimTreeBlend::VGetTimeRemaining() const
{
return {};
}
CSteadyStateAnimInfo CAnimTreeBlend::VGetSteadyStateAnimInfo() const
{
return {};
}
std::shared_ptr<IAnimReader> CAnimTreeBlend::VClone() const
{
return {};
}
void CAnimTreeBlend::SetBlendingWeight(float w)
@ -41,6 +45,7 @@ void CAnimTreeBlend::SetBlendingWeight(float w)
float CAnimTreeBlend::VGetBlendingWeight() const
{
return 0.f;
}
}

View File

@ -12,38 +12,46 @@ CAnimTreeDoubleChild::CAnimTreeDoubleChild(const std::weak_ptr<CAnimTreeNode>& a
SAdvancementResults CAnimTreeDoubleChild::VAdvanceView(const CCharAnimTime& a)
{
return {};
}
u32 CAnimTreeDoubleChild::VGetBoolPOIList(const CCharAnimTime& time, CBoolPOINode* listOut,
u32 capacity, u32 iterator, u32) const
{
return 0;
}
u32 CAnimTreeDoubleChild::VGetInt32POIList(const CCharAnimTime& time, CInt32POINode* listOut,
u32 capacity, u32 iterator, u32) const
{
return 0;
}
u32 CAnimTreeDoubleChild::VGetParticlePOIList(const CCharAnimTime& time, CParticlePOINode* listOut,
u32 capacity, u32 iterator, u32) const
{
return 0;
}
u32 CAnimTreeDoubleChild::VGetSoundPOIList(const CCharAnimTime& time, CSoundPOINode* listOut,
u32 capacity, u32 iterator, u32) const
{
return 0;
}
bool CAnimTreeDoubleChild::VGetBoolPOIState(const char* name) const
{
return false;
}
s32 CAnimTreeDoubleChild::VGetInt32POIState(const char* name) const
{
return 0;
}
CParticleData::EParentedMode CAnimTreeDoubleChild::VGetParticlePOIState(const char* name) const
{
return CParticleData::EParentedMode::Initial;
}
void CAnimTreeDoubleChild::VSetPhase(float)
@ -52,22 +60,27 @@ void CAnimTreeDoubleChild::VSetPhase(float)
SAdvancementResults CAnimTreeDoubleChild::VGetAdvancementResults(const CCharAnimTime& a, const CCharAnimTime& b) const
{
return {};
}
u32 CAnimTreeDoubleChild::Depth() const
{
return 0;
}
CAnimTreeEffectiveContribution CAnimTreeDoubleChild::VGetContributionOfHighestInfluence() const
{
return {0.f, "", CSteadyStateAnimInfo(), CCharAnimTime(), 0};
}
u32 CAnimTreeDoubleChild::VGetNumChildren() const
{
return 0;
}
std::shared_ptr<IAnimReader> CAnimTreeDoubleChild::VGetBestUnblendedChild() const
{
return {};
}
void CAnimTreeDoubleChild::VGetWeightedReaders(std::vector<std::pair<float, std::weak_ptr<IAnimReader>>>& out, float w) const

View File

@ -9,18 +9,33 @@ CAnimTreeTweenBase::CAnimTreeTweenBase(bool b1, const std::weak_ptr<CAnimTreeNod
{
}
void CAnimTreeTweenBase::VGetSegStatementSet(const CSegIdList& list, CSegStatementSet& setOut) const {}
void CAnimTreeTweenBase::VGetSegStatementSet(const CSegIdList& list, CSegStatementSet& setOut) const
{
}
void CAnimTreeTweenBase::VGetSegStatementSet(const CSegIdList& list, CSegStatementSet& setOut,
const CCharAnimTime& time) const
{
}
bool CAnimTreeTweenBase::VHasOffset(const CSegId& seg) const {}
zeus::CVector3f CAnimTreeTweenBase::VGetOffset(const CSegId& seg) const {}
zeus::CQuaternion CAnimTreeTweenBase::VGetRotation(const CSegId& seg) const {}
std::shared_ptr<IAnimReader> CAnimTreeTweenBase::VSimplified() {}
bool CAnimTreeTweenBase::VHasOffset(const CSegId& seg) const
{
return false;
}
zeus::CVector3f CAnimTreeTweenBase::VGetOffset(const CSegId& seg) const
{
return {};
}
zeus::CQuaternion CAnimTreeTweenBase::VGetRotation(const CSegId& seg) const
{
return {};
}
std::shared_ptr<IAnimReader> CAnimTreeTweenBase::VSimplified()
{
return {};
}
}

View File

@ -10,7 +10,7 @@ class CAnimationDatabaseGame;
class CTransitionDatabaseGame;
class CSimplePool;
class CAnimTreeNode;
class CMetaAnimTreeBuildOrders;
struct CMetaAnimTreeBuildOrders;
class IMetaAnim;
class CAnimationManager

View File

@ -85,7 +85,7 @@ public:
class CSegIdToIndexConverter
{
u32 x0_indices[96] = {-1};
u32 x0_indices[96] = {u32(-1)};
public:
CSegIdToIndexConverter(const CFBStreamedAnimReaderTotals& totals);
u32 SegIdToIndex(const CSegId& id) const { return x0_indices[id]; }

View File

@ -18,6 +18,7 @@ CMetaTransPhaseTrans::VGetTransitionTree(const std::weak_ptr<CAnimTreeNode>& a,
const std::weak_ptr<CAnimTreeNode>& b,
const CAnimSysContext& animSys) const
{
return {};
}
}

View File

@ -9,7 +9,7 @@
namespace urde
{
class CAnimSysContext;
struct CAnimSysContext;
class IMetaAnim;
class CTransitionDatabaseGame;

View File

@ -6,7 +6,7 @@
namespace urde
{
class CAnimTreeNode;
class CAnimSysContext;
struct CAnimSysContext;
class CTreeUtils
{

View File

@ -9,7 +9,7 @@ namespace urde
{
class CAnimTreeNode;
struct CAnimSysContext;
class CMetaAnimTreeBuildOrders;
struct CMetaAnimTreeBuildOrders;
class CPrimitive;
class IAnimReader;

View File

@ -3,9 +3,6 @@
#include "zeus/Math.hpp"
#include "CTimeProvider.hpp"
#undef near
#undef far
namespace urde
{
@ -163,16 +160,16 @@ static const zeus::CMatrix4f PlusOneZFlip(1.f, 0.f, 0.f, 0.f,
0.f, 0.f, 0.f, 1.f);
zeus::CMatrix4f CGraphics::CalculatePerspectiveMatrix(float fovy, float aspect,
float near, float far,
float znear, float zfar,
bool forRenderer)
{
CProjectionState st;
float tfov = std::tan(zeus::degToRad(fovy * 0.5f));
st.x14_near = near;
st.x18_far = far;
st.xc_top = near * tfov;
st.x14_near = znear;
st.x18_far = zfar;
st.xc_top = znear * tfov;
st.x10_bottom = -st.xc_top;
st.x8_right = aspect * near * tfov;
st.x8_right = aspect * znear * tfov;
st.x4_left = -st.x8_right;
float rml = st.x8_right - st.x4_left;
@ -280,17 +277,17 @@ void CGraphics::SetProjectionState(const CGraphics::CProjectionState& proj)
FlushProjection();
}
void CGraphics::SetPerspective(float fovy, float aspect, float near, float far)
void CGraphics::SetPerspective(float fovy, float aspect, float znear, float zfar)
{
g_ProjAspect = aspect;
float tfov = std::tan(zeus::degToRad(fovy * 0.5f));
g_Proj.x0_persp = true;
g_Proj.x14_near = near;
g_Proj.x18_far = far;
g_Proj.xc_top = near * tfov;
g_Proj.x14_near = znear;
g_Proj.x18_far = zfar;
g_Proj.xc_top = znear * tfov;
g_Proj.x10_bottom = -g_Proj.xc_top;
g_Proj.x8_right = aspect * near * tfov;
g_Proj.x8_right = aspect * znear * tfov;
g_Proj.x4_left = -g_Proj.x8_right;
FlushProjection();

2
amuse

@ -1 +1 @@
Subproject commit 38f24ce3e43200a1dde31f97fa37c2cf4a816ba0
Subproject commit bfe6668d0c2d9aa075db516bf645b3ea529fdd5b

2
hecl

@ -1 +1 @@
Subproject commit 43015f5e696a75f8604ff535eeffb55c33c873e5
Subproject commit bb374c97f4a22694ce3bb75d306a767a08ae75b4

2
nod

@ -1 +1 @@
Subproject commit e55a4322abc3954d3a4ea89de45f95515d8ca76a
Subproject commit df3fff72a21efcb1ab0e35bb4b9dc1cd5e827eec

@ -1 +1 @@
Subproject commit 2ec24ac74cf269d29926c6e78372a279eeb1cd74
Subproject commit ae97855307f23bfd128df18359d14e9e68b98b3d