Refactor so PWE compiles with the newly externalized LibCommon

This commit is contained in:
Aruki
2018-12-11 22:50:46 -07:00
parent dacd21d7fc
commit 2287b05bc3
298 changed files with 3192 additions and 3184 deletions

View File

@@ -1,14 +1,14 @@
#include "CDamageableTriggerExtra.h"
#include "Core/Render/CDrawUtil.h"
#include "Core/Render/CRenderer.h"
#include <Common/AssertMacro.h>
#include <Math/MathUtil.h>
#include <Common/Macros.h>
#include <Common/Math/MathUtil.h>
CDamageableTriggerExtra::CDamageableTriggerExtra(CScriptObject *pInstance, CScene *pScene, CScriptNode *pParent)
: CScriptExtra(pInstance, pScene, pParent)
, mpMat(nullptr)
{
for (u32 iTex = 0; iTex < 3; iTex++)
for (uint32 iTex = 0; iTex < 3; iTex++)
mpTextures[iTex] = nullptr;
SetInheritance(true, false, false);
@@ -25,7 +25,7 @@ CDamageableTriggerExtra::CDamageableTriggerExtra(CScriptObject *pInstance, CScen
if (mPlaneSize.IsValid()) PropertyModified(mPlaneSize.Property());
// Fetch textures
for (u32 TextureIdx = 0; TextureIdx < 3; TextureIdx++)
for (uint32 TextureIdx = 0; TextureIdx < 3; TextureIdx++)
{
mTextureAssets[TextureIdx] = CAssetRef(pInstance->PropertyData(), pProperties->ChildByIndex(6 + TextureIdx));
if (mTextureAssets[TextureIdx].IsValid()) PropertyModified(mTextureAssets[TextureIdx].Property());
@@ -134,7 +134,7 @@ CDamageableTriggerExtra::ERenderSide CDamageableTriggerExtra::RenderSideForDirec
{
// Get the index of the largest XYZ component
CVector3f AbsDir(Math::Abs(rkDir.X), Math::Abs(rkDir.Y), Math::Abs(rkDir.Z));
u32 Max = (AbsDir.X > AbsDir.Y ? 0 : 1);
uint32 Max = (AbsDir.X > AbsDir.Y ? 0 : 1);
Max = (AbsDir[Max] > AbsDir.Z ? Max : 2);
// Check whether the direction is positive or negative. If the absolute value of the component matches the input one, then it's positive.
@@ -187,7 +187,7 @@ void CDamageableTriggerExtra::PropertyModified(IProperty* pProperty)
else
{
for (u32 TextureIdx = 0; TextureIdx < 3; TextureIdx++)
for (uint32 TextureIdx = 0; TextureIdx < 3; TextureIdx++)
{
if (pProperty == mTextureAssets[TextureIdx].Property())
{
@@ -280,7 +280,7 @@ void CDamageableTriggerExtra::RayAABoxIntersectTest(CRayCollisionTester& rTester
}
}
SRayIntersection CDamageableTriggerExtra::RayNodeIntersectTest(const CRay& rkRay, u32 /*ComponentIndex*/, const SViewInfo& /*rkViewInfo*/)
SRayIntersection CDamageableTriggerExtra::RayNodeIntersectTest(const CRay& rkRay, uint32 /*ComponentIndex*/, const SViewInfo& /*rkViewInfo*/)
{
// The bounding box and all other tests already passed in RayAABoxIntersectTest, so we
// already know that we have a positive.

View File

@@ -41,7 +41,7 @@ public:
void Draw(FRenderOptions Options, int ComponentIndex, ERenderCommand Command, const SViewInfo& rkViewInfo);
void DrawSelection();
void RayAABoxIntersectTest(CRayCollisionTester& rTester, const SViewInfo& rkViewInfo);
SRayIntersection RayNodeIntersectTest(const CRay& rkRay, u32 ComponentIndex, const SViewInfo& rkViewInfo);
SRayIntersection RayNodeIntersectTest(const CRay& rkRay, uint32 ComponentIndex, const SViewInfo& rkViewInfo);
};
#endif // CDAMAGEABLETRIGGEREXTRA_H

View File

@@ -103,7 +103,7 @@ void CDoorExtra::RayAABoxIntersectTest(CRayCollisionTester& rTester, const SView
rTester.AddNodeModel(this, mpShieldModel);
}
SRayIntersection CDoorExtra::RayNodeIntersectTest(const CRay& rkRay, u32 AssetID, const SViewInfo& rkViewInfo)
SRayIntersection CDoorExtra::RayNodeIntersectTest(const CRay& rkRay, uint32 AssetID, const SViewInfo& rkViewInfo)
{
FRenderOptions Options = rkViewInfo.pRenderer->RenderOptions();

View File

@@ -20,7 +20,7 @@ public:
void Draw(FRenderOptions Options, int ComponentIndex, ERenderCommand Command, const SViewInfo& rkViewInfo);
void DrawSelection();
void RayAABoxIntersectTest(CRayCollisionTester& rTester, const SViewInfo& rkViewInfo);
SRayIntersection RayNodeIntersectTest(const CRay& rkRay, u32 AssetID, const SViewInfo& rkViewInfo);
SRayIntersection RayNodeIntersectTest(const CRay& rkRay, uint32 AssetID, const SViewInfo& rkViewInfo);
};
#endif // CDOOREXTRA_H

View File

@@ -6,7 +6,7 @@
class CRadiusSphereExtra : public CScriptExtra
{
// Sphere visualization for objects that have a float radius property.
u32 mObjectType;
uint32 mObjectType;
CFloatRef mRadius;
public:

View File

@@ -4,7 +4,7 @@ CSandwormExtra::CSandwormExtra(CScriptObject* pInstance, CScene* pScene, CScript
: CScriptExtra(pInstance, pScene, pParent)
{
// The back pincers need to be flipped 180 degrees
for (u32 AttachIdx = 0; AttachIdx < pParent->NumAttachments(); AttachIdx++)
for (uint32 AttachIdx = 0; AttachIdx < pParent->NumAttachments(); AttachIdx++)
{
CScriptAttachNode *pAttach = pParent->Attachment(AttachIdx);
@@ -21,7 +21,7 @@ void CSandwormExtra::PropertyModified(IProperty* pProp)
{
if (pProp == mPincersScale)
{
for (u32 AttachIdx = 0; AttachIdx < mpScriptNode->NumAttachments(); AttachIdx++)
for (uint32 AttachIdx = 0; AttachIdx < mpScriptNode->NumAttachments(); AttachIdx++)
{
CScriptAttachNode* pAttach = mpScriptNode->Attachment(AttachIdx);
pAttach->SetScale( CVector3f(mPincersScale) );

View File

@@ -3,7 +3,7 @@
#include "Core/Scene/CSceneNode.h"
#include "Core/Scene/CScriptNode.h"
#include <Common/AssertMacro.h>
#include <Common/Macros.h>
/* CScriptExtra is a class that allows for additional coded behavior on any given
* script object type. Subclass IScriptExtra, add the new class to CScriptExtra.cpp,
@@ -36,7 +36,7 @@ public:
// Default implementations for CSceneNode
virtual ENodeType NodeType() { return eScriptExtraNode; }
virtual void RayAABoxIntersectTest(CRayCollisionTester& /*rTester*/, const SViewInfo& /*rkViewInfo*/) {}
virtual SRayIntersection RayNodeIntersectTest(const CRay& /*rkRay*/, u32 /*AssetID*/, const SViewInfo& /*rkViewInfo*/)
virtual SRayIntersection RayNodeIntersectTest(const CRay& /*rkRay*/, uint32 /*AssetID*/, const SViewInfo& /*rkViewInfo*/)
{
SRayIntersection out;
out.Hit = false;

View File

@@ -46,7 +46,7 @@ void CSplinePathExtra::AddWaypoints()
std::set<CWaypointExtra*> CheckedWaypoints;
for (u32 LinkIdx = 0; LinkIdx < mpInstance->NumLinks(eOutgoing); LinkIdx++)
for (uint32 LinkIdx = 0; LinkIdx < mpInstance->NumLinks(eOutgoing); LinkIdx++)
{
CLink* pLink = mpInstance->Link(eOutgoing, LinkIdx);

View File

@@ -79,7 +79,7 @@ void CWaypointExtra::BuildLinks()
{
mLinks.clear();
for (u32 iLink = 0; iLink < mpInstance->NumLinks(eOutgoing); iLink++)
for (uint32 iLink = 0; iLink < mpInstance->NumLinks(eOutgoing); iLink++)
{
CLink *pLink = mpInstance->Link(eOutgoing, iLink);
@@ -130,7 +130,7 @@ void CWaypointExtra::GetLinkedWaypoints(std::list<CWaypointExtra*>& rOut)
{
if (!mLinksBuilt) BuildLinks();
for (u32 iLink = 0; iLink < mLinks.size(); iLink++)
for (uint32 iLink = 0; iLink < mLinks.size(); iLink++)
{
const SWaypointLink& rkLink = mLinks[iLink];
CWaypointExtra *pExtra = static_cast<CWaypointExtra*>(rkLink.pWaypoint->Extra());
@@ -140,7 +140,7 @@ void CWaypointExtra::GetLinkedWaypoints(std::list<CWaypointExtra*>& rOut)
void CWaypointExtra::OnTransformed()
{
for (u32 iLink = 0; iLink < mLinks.size(); iLink++)
for (uint32 iLink = 0; iLink < mLinks.size(); iLink++)
{
SWaypointLink& rLink = mLinks[iLink];
rLink.LineAABB = CAABox::skInfinite;
@@ -162,7 +162,7 @@ void CWaypointExtra::AddToRenderer(CRenderer *pRenderer, const SViewInfo& rkView
if (!rkViewInfo.GameMode && (rkViewInfo.ShowFlags & eShowObjectGeometry) && mpParent->IsVisible() && !mpParent->IsSelected())
{
for (u32 iLink = 0; iLink < mLinks.size(); iLink++)
for (uint32 iLink = 0; iLink < mLinks.size(); iLink++)
{
CScriptNode *pNode = mLinks[iLink].pWaypoint;