2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 11:07:44 +00:00

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

View File

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

View File

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

View File

@@ -21,18 +21,22 @@ CAnimTreeBlend::CAnimTreeBlend(bool b1,
SAdvancementResults CAnimTreeBlend::VAdvanceView(const CCharAnimTime& a) SAdvancementResults CAnimTreeBlend::VAdvanceView(const CCharAnimTime& a)
{ {
return {};
} }
CCharAnimTime CAnimTreeBlend::VGetTimeRemaining() const CCharAnimTime CAnimTreeBlend::VGetTimeRemaining() const
{ {
return {};
} }
CSteadyStateAnimInfo CAnimTreeBlend::VGetSteadyStateAnimInfo() const CSteadyStateAnimInfo CAnimTreeBlend::VGetSteadyStateAnimInfo() const
{ {
return {};
} }
std::shared_ptr<IAnimReader> CAnimTreeBlend::VClone() const std::shared_ptr<IAnimReader> CAnimTreeBlend::VClone() const
{ {
return {};
} }
void CAnimTreeBlend::SetBlendingWeight(float w) void CAnimTreeBlend::SetBlendingWeight(float w)
@@ -41,6 +45,7 @@ void CAnimTreeBlend::SetBlendingWeight(float w)
float CAnimTreeBlend::VGetBlendingWeight() const 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) SAdvancementResults CAnimTreeDoubleChild::VAdvanceView(const CCharAnimTime& a)
{ {
return {};
} }
u32 CAnimTreeDoubleChild::VGetBoolPOIList(const CCharAnimTime& time, CBoolPOINode* listOut, u32 CAnimTreeDoubleChild::VGetBoolPOIList(const CCharAnimTime& time, CBoolPOINode* listOut,
u32 capacity, u32 iterator, u32) const u32 capacity, u32 iterator, u32) const
{ {
return 0;
} }
u32 CAnimTreeDoubleChild::VGetInt32POIList(const CCharAnimTime& time, CInt32POINode* listOut, u32 CAnimTreeDoubleChild::VGetInt32POIList(const CCharAnimTime& time, CInt32POINode* listOut,
u32 capacity, u32 iterator, u32) const u32 capacity, u32 iterator, u32) const
{ {
return 0;
} }
u32 CAnimTreeDoubleChild::VGetParticlePOIList(const CCharAnimTime& time, CParticlePOINode* listOut, u32 CAnimTreeDoubleChild::VGetParticlePOIList(const CCharAnimTime& time, CParticlePOINode* listOut,
u32 capacity, u32 iterator, u32) const u32 capacity, u32 iterator, u32) const
{ {
return 0;
} }
u32 CAnimTreeDoubleChild::VGetSoundPOIList(const CCharAnimTime& time, CSoundPOINode* listOut, u32 CAnimTreeDoubleChild::VGetSoundPOIList(const CCharAnimTime& time, CSoundPOINode* listOut,
u32 capacity, u32 iterator, u32) const u32 capacity, u32 iterator, u32) const
{ {
return 0;
} }
bool CAnimTreeDoubleChild::VGetBoolPOIState(const char* name) const bool CAnimTreeDoubleChild::VGetBoolPOIState(const char* name) const
{ {
return false;
} }
s32 CAnimTreeDoubleChild::VGetInt32POIState(const char* name) const s32 CAnimTreeDoubleChild::VGetInt32POIState(const char* name) const
{ {
return 0;
} }
CParticleData::EParentedMode CAnimTreeDoubleChild::VGetParticlePOIState(const char* name) const CParticleData::EParentedMode CAnimTreeDoubleChild::VGetParticlePOIState(const char* name) const
{ {
return CParticleData::EParentedMode::Initial;
} }
void CAnimTreeDoubleChild::VSetPhase(float) void CAnimTreeDoubleChild::VSetPhase(float)
@@ -52,22 +60,27 @@ void CAnimTreeDoubleChild::VSetPhase(float)
SAdvancementResults CAnimTreeDoubleChild::VGetAdvancementResults(const CCharAnimTime& a, const CCharAnimTime& b) const SAdvancementResults CAnimTreeDoubleChild::VGetAdvancementResults(const CCharAnimTime& a, const CCharAnimTime& b) const
{ {
return {};
} }
u32 CAnimTreeDoubleChild::Depth() const u32 CAnimTreeDoubleChild::Depth() const
{ {
return 0;
} }
CAnimTreeEffectiveContribution CAnimTreeDoubleChild::VGetContributionOfHighestInfluence() const CAnimTreeEffectiveContribution CAnimTreeDoubleChild::VGetContributionOfHighestInfluence() const
{ {
return {0.f, "", CSteadyStateAnimInfo(), CCharAnimTime(), 0};
} }
u32 CAnimTreeDoubleChild::VGetNumChildren() const u32 CAnimTreeDoubleChild::VGetNumChildren() const
{ {
return 0;
} }
std::shared_ptr<IAnimReader> CAnimTreeDoubleChild::VGetBestUnblendedChild() const std::shared_ptr<IAnimReader> CAnimTreeDoubleChild::VGetBestUnblendedChild() const
{ {
return {};
} }
void CAnimTreeDoubleChild::VGetWeightedReaders(std::vector<std::pair<float, std::weak_ptr<IAnimReader>>>& out, float w) const 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, void CAnimTreeTweenBase::VGetSegStatementSet(const CSegIdList& list, CSegStatementSet& setOut,
const CCharAnimTime& time) const const CCharAnimTime& time) const
{ {
} }
bool CAnimTreeTweenBase::VHasOffset(const CSegId& seg) const {} bool CAnimTreeTweenBase::VHasOffset(const CSegId& seg) const
{
zeus::CVector3f CAnimTreeTweenBase::VGetOffset(const CSegId& seg) const {} return false;
}
zeus::CQuaternion CAnimTreeTweenBase::VGetRotation(const CSegId& seg) const {}
zeus::CVector3f CAnimTreeTweenBase::VGetOffset(const CSegId& seg) const
std::shared_ptr<IAnimReader> CAnimTreeTweenBase::VSimplified() {} {
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 CTransitionDatabaseGame;
class CSimplePool; class CSimplePool;
class CAnimTreeNode; class CAnimTreeNode;
class CMetaAnimTreeBuildOrders; struct CMetaAnimTreeBuildOrders;
class IMetaAnim; class IMetaAnim;
class CAnimationManager class CAnimationManager

View File

@@ -85,7 +85,7 @@ public:
class CSegIdToIndexConverter class CSegIdToIndexConverter
{ {
u32 x0_indices[96] = {-1}; u32 x0_indices[96] = {u32(-1)};
public: public:
CSegIdToIndexConverter(const CFBStreamedAnimReaderTotals& totals); CSegIdToIndexConverter(const CFBStreamedAnimReaderTotals& totals);
u32 SegIdToIndex(const CSegId& id) const { return x0_indices[id]; } 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 std::weak_ptr<CAnimTreeNode>& b,
const CAnimSysContext& animSys) const const CAnimSysContext& animSys) const
{ {
return {};
} }
} }

View File

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

View File

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

View File

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

View File

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

2
amuse

Submodule amuse updated: 38f24ce3e4...bfe6668d0c

2
hecl

Submodule hecl updated: 43015f5e69...bb374c97f4

2
nod

Submodule nod updated: e55a4322ab...df3fff72a2

Submodule specter updated: 2ec24ac74c...ae97855307