Compile fixes, update submodules

This commit is contained in:
Phillip Stephens 2020-10-08 19:20:42 -07:00
parent 733faf2bb1
commit 4831847197
Signed by: Antidote
GPG Key ID: F8BEE4C83DACA60D
8 changed files with 71 additions and 35 deletions

2
externals/LibCommon vendored

@ -1 +1 @@
Subproject commit b37fc9a516ad09be5484f343f730e8642c3495a3
Subproject commit 2c2e2bad43b4566e1de5452a23673f0c9d5202f7

View File

@ -89,7 +89,7 @@ TString CGameInfo::GetDefaultGameInfoPath(EGame Game)
return "";
const TString GameName = GetGameShortName(Game);
return TString::Format("%s/%s/GameInfo%s.%s", *gDataDir, *gkGameInfoDir, *GameName, *gkGameInfoExt);
return TString::Format("%s/%s/GameInfo%s.%s", gDataDir.ToStdString().c_str(), gkGameInfoDir, GameName.ToStdString().c_str(), gkGameInfoExt);
}
TString CGameInfo::GetExtension()

View File

@ -444,12 +444,12 @@ bool CPackage::ContainsAsset(const CAssetID& rkID) const
TString CPackage::DefinitionPath(bool Relative) const
{
const TString RelPath = mPakPath + mPakName + ".pkd";
TString RelPath = mPakPath + mPakName + ".pkd";
return Relative ? RelPath : mpProject->PackagesDir(false) + RelPath;
}
TString CPackage::CookedPackagePath(bool Relative) const
{
const TString RelPath = mPakPath + mPakName + ".pak";
TString RelPath = mPakPath + mPakName + ".pak";
return Relative ? RelPath : mpProject->DiscFilesystemRoot(false) + RelPath;
}

View File

@ -1,6 +1,7 @@
#include "CAnimationLoader.h"
#include <Common/Macros.h>
#include <Common/Log.h>
#include <cmath>
#include <Common/Math/MathUtil.h>
bool CAnimationLoader::UncompressedCheckEchoes()
@ -236,8 +237,10 @@ void CAnimationLoader::ReadCompressedANIM()
{
CBitStreamInWrapper BitStream(mpInput);
for (auto& flag : mKeyFlags)
flag = BitStream.ReadBit();
for (size_t i = 0; i < mKeyFlags.size(); ++i)
{
mKeyFlags[i] = BitStream.ReadBit();
}
}
mpInput->Seek(mGame == EGame::Prime ? 0x8 : 0x4, SEEK_CUR);
@ -462,9 +465,9 @@ CQuaternion CAnimationLoader::DequantizeRotation(bool Sign, int16 X, int16 Y, in
const float Multiplier = Math::skHalfPi / static_cast<float>(mRotationDivisor);
CQuaternion Out;
Out.X = std::sinf(static_cast<float>(X) * Multiplier);
Out.Y = std::sinf(static_cast<float>(Y) * Multiplier);
Out.Z = std::sinf(static_cast<float>(Z) * Multiplier);
Out.X = sinf(static_cast<float>(X) * Multiplier);
Out.Y = sinf(static_cast<float>(Y) * Multiplier);
Out.Z = sinf(static_cast<float>(Z) * Multiplier);
Out.W = Math::Sqrt(std::fmax(1.f - ((Out.X * Out.X) + (Out.Y * Out.Y) + (Out.Z * Out.Z)), 0.f));
if (Sign)

View File

@ -73,7 +73,7 @@ public:
}
friend bool operator!=(const IProperty* pLeft, const TPropertyRef& kRight)
{
return !operator==(pLeft, kRight);
return !(*pLeft == *kRight);
}
friend bool operator==(const TPropertyRef& left, const IProperty* right)
@ -82,7 +82,7 @@ public:
}
friend bool operator!=(const TPropertyRef& left, const IProperty* right)
{
return !operator==(left, right);
return !(left.Property() == right);
}
};

View File

@ -94,16 +94,21 @@ private:
// Model parts
struct SModelPart
{
FAxes ModelAxes{EAxis::None};
FAxes ModelAxes;
bool EnableRayCast = false;
bool IsBillboard = false;
TResPtr<CModel> pModel;
SModelPart() = default;
SModelPart() :
ModelAxes(EAxis::None)
{};
SModelPart(FAxes Axes, bool RayCastOn, bool Billboard, TResPtr<CModel> _pModel) :
ModelAxes(Axes), EnableRayCast(RayCastOn), IsBillboard(Billboard), pModel(_pModel) {}
ModelAxes(Axes), EnableRayCast(RayCastOn), IsBillboard(Billboard), pModel(_pModel)
{}
};
SModelPart *mpCurrentParts = nullptr;
SModelPart* mpCurrentParts = nullptr;
uint32 mNumCurrentParts = 0;
// Static
@ -116,7 +121,7 @@ public:
CGizmo();
~CGizmo() override;
void AddToRenderer(CRenderer *pRenderer, const SViewInfo& rkViewInfo) override;
void AddToRenderer(CRenderer* pRenderer, const SViewInfo& rkViewInfo) override;
void Draw(FRenderOptions Options, int ComponentIndex, ERenderCommand Command, const SViewInfo& rkViewInfo) override;
void IncrementSize();
@ -130,22 +135,51 @@ public:
void EndTransform();
// Accessors
EGizmoMode Mode() const { return mMode; }
ETransformSpace TransformSpace() const { return mTransformSpace; }
CVector3f Position() const { return mPosition; }
CVector3f DeltaTranslation() const { return mDeltaTranslation; }
CVector3f TotalTranslation() const { return mTotalTranslation; }
CQuaternion Rotation() const { return mRotation; }
CQuaternion DeltaRotation() const { return mDeltaRotation; }
CVector3f TotalRotation() const { return mTotalRotation; }
CVector3f Scale() const { return mScale; }
CVector3f DeltaScale() const { return mDeltaScale; }
CVector3f TotalScale() const { return mTotalScale; }
bool IsTransforming() const { return mIsTransforming; }
bool HasTransformed() const { return mHasTransformed; }
EGizmoMode Mode() const
{ return mMode; }
ETransformSpace TransformSpace() const
{ return mTransformSpace; }
CVector3f Position() const
{ return mPosition; }
CVector3f DeltaTranslation() const
{ return mDeltaTranslation; }
CVector3f TotalTranslation() const
{ return mTotalTranslation; }
CQuaternion Rotation() const
{ return mRotation; }
CQuaternion DeltaRotation() const
{ return mDeltaRotation; }
CVector3f TotalRotation() const
{ return mTotalRotation; }
CVector3f Scale() const
{ return mScale; }
CVector3f DeltaScale() const
{ return mDeltaScale; }
CVector3f TotalScale() const
{ return mTotalScale; }
bool IsTransforming() const
{ return mIsTransforming; }
bool HasTransformed() const
{ return mHasTransformed; }
void SetPosition(const CVector3f& rkPosition)
{ mPosition = rkPosition; }
void EnableCursorWrap(bool Enable)
{ mEnableCursorWrap = Enable; }
void SetPosition(const CVector3f& rkPosition) { mPosition = rkPosition; }
void EnableCursorWrap(bool Enable) { mEnableCursorWrap = Enable; }
void SetMode(EGizmoMode mode);
void SetTransformSpace(ETransformSpace Space);
void SetLocalRotation(const CQuaternion& rkOrientation);

View File

@ -16,15 +16,14 @@
class INodeEditor : public IEditor
{
Q_OBJECT
protected:
public:
enum class ECloneState
{
NotCloning,
ReadyToClone,
Cloning
};
protected:
// Node management
CScene mScene;
CNodeSelection *mpSelection;

View File

@ -222,7 +222,7 @@ void CWorldTreeModel::OnProjectChanged(CGameProject *pProj)
// Metroid Prime series; fetch all world assets
std::list<CAssetID> WorldIDs;
pProj->GetWorldList(WorldIDs);
QList<CAssetID> QWorldIDs = QList<CAssetID>::fromStdList(WorldIDs);
QList<CAssetID> QWorldIDs = QList<CAssetID>(WorldIDs.begin(), WorldIDs.end());
for (const CAssetID& rkID : QWorldIDs)
{