Merge pull request #1 from Antidote/cmake

Silence Warnings
This commit is contained in:
Jack Andersen 2019-05-26 15:38:50 -10:00 committed by GitHub
commit 981b374232
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 55 additions and 22 deletions

View File

@ -72,6 +72,7 @@ bool CTexture::BufferGL()
GLFormat = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; GLFormat = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
IsCompressed = true; IsCompressed = true;
break; break;
default: break;
} }
// The smallest mipmaps are probably not being loaded correctly, because mipmaps in GX textures have a minimum size depending on the format, and these don't. // The smallest mipmaps are probably not being loaded correctly, because mipmaps in GX textures have a minimum size depending on the format, and these don't.
@ -243,6 +244,8 @@ bool CTexture::WriteDDS(IOutputStream& rOut)
case ETexelFormat::DXT1: case ETexelFormat::DXT1:
PFFlags = 0x4; PFFlags = 0x4;
break; break;
default:
break;
} }
rOut.WriteLong(PFFlags); // DDS_PIXELFORMAT.dwFlags rOut.WriteLong(PFFlags); // DDS_PIXELFORMAT.dwFlags

View File

@ -45,6 +45,8 @@ void CAreaCooker::DetermineSectionNumbersPrime()
case EGame::Echoes: case EGame::Echoes:
GeometrySections = 3 + (9 * OriginalMeshCount); // Acount for materials + AROT + an unknown section GeometrySections = 3 + (9 * OriginalMeshCount); // Acount for materials + AROT + an unknown section
break; break;
default:
break;
} }
for (uint32 iMesh = 0; iMesh < mpArea->mWorldModels.size(); iMesh++) for (uint32 iMesh = 0; iMesh < mpArea->mWorldModels.size(); iMesh++)

View File

@ -366,6 +366,8 @@ void CMaterialCooker::WriteCookedMatSet(CMaterialSet *pSet, EGame Version, IOutp
case EGame::Echoes: case EGame::Echoes:
Cooker.WriteMatSetPrime(rOut); Cooker.WriteMatSetPrime(rOut);
break; break;
default:
break;
} }
} }
@ -384,5 +386,6 @@ void CMaterialCooker::WriteCookedMaterial(CMaterial *pMat, EGame Version, IOutpu
Cooker.WriteMaterialPrime(rOut); Cooker.WriteMaterialPrime(rOut);
break; break;
// TODO: Corruption/Uncooked // TODO: Corruption/Uncooked
default: break;
} }
} }

View File

@ -214,7 +214,8 @@ void CScriptCooker::WriteProperty(IOutputStream& rOut, IProperty* pProperty, voi
break; break;
} }
default:
break;
} }
if (SizeOffset != 0) if (SizeOffset != 0)

View File

@ -219,6 +219,8 @@ SSurface* CModelLoader::LoadSurface(IInputStream& rModel)
case EPrimitiveType::TriangleStrip: case EPrimitiveType::TriangleStrip:
pSurf->TriangleCount += VertexCount - 2; pSurf->TriangleCount += VertexCount - 2;
break; break;
default:
break;
} }
pSurf->Primitives.push_back(Prim); pSurf->Primitives.push_back(Prim);

View File

@ -264,7 +264,7 @@ void CScriptLoader::ReadProperty(IProperty *pProp, uint32 Size, IInputStream& rS
mpCurrentData = pOldData; mpCurrentData = pOldData;
break; break;
} }
default: break;
} }
} }

View File

@ -179,6 +179,8 @@ int32 CScriptTemplate::CheckVolumeConditions(CScriptObject *pObj, bool LogErrors
case EPropertyType::Choice: case EPropertyType::Choice:
Val = TPropCast<CEnumProperty>(pProp)->Value(pData); Val = TPropCast<CEnumProperty>(pProp)->Value(pData);
break; break;
default:
break;
} }
// Test and check whether any of the conditions are true // Test and check whether any of the conditions are true

View File

@ -20,12 +20,12 @@ public:
CreateIntrinsic(EPropertyType::Float, this, mOffset + 8, "Z"); CreateIntrinsic(EPropertyType::Float, this, mOffset + 8, "Z");
} }
virtual void SerializeValue(void* pData, IArchive& Arc) const virtual void SerializeValue(void* pData, IArchive& Arc) const override
{ {
ValueRef(pData).Serialize(Arc); ValueRef(pData).Serialize(Arc);
} }
virtual TString ValueAsString(void* pData) const virtual TString ValueAsString(void* pData) const override
{ {
return Value(pData).ToString(); return Value(pData).ToString();
} }

View File

@ -633,6 +633,7 @@ IProperty* IProperty::Create(EPropertyType Type,
case EPropertyType::Pointer: pOut = new CPointerProperty(Game); break; case EPropertyType::Pointer: pOut = new CPointerProperty(Game); break;
case EPropertyType::Struct: pOut = new CStructProperty(Game); break; case EPropertyType::Struct: pOut = new CStructProperty(Game); break;
case EPropertyType::Array: pOut = new CArrayProperty(Game); break; case EPropertyType::Array: pOut = new CArrayProperty(Game); break;
default: break;
} }
// If this assertion fails, then there is an unhandled type! // If this assertion fails, then there is an unhandled type!

View File

@ -453,6 +453,8 @@ public:
case EPropertyType::Guid: case EPropertyType::Guid:
MakeOptional = true; MakeOptional = true;
break; break;
default:
break;
} }
} }

View File

@ -550,6 +550,7 @@ void CScriptNode::UpdatePreviewVolume()
case EVolumeShape::CylinderShape: case EVolumeShape::CylinderShape:
pVolumeModel = gpEditorStore->LoadResource("VolumeCylinder.CMDL"); pVolumeModel = gpEditorStore->LoadResource("VolumeCylinder.CMDL");
break; break;
default: break;
} }
mHasVolumePreview = (pVolumeModel != nullptr); mHasVolumePreview = (pVolumeModel != nullptr);

View File

@ -119,7 +119,7 @@ void CDamageableTriggerExtra::UpdatePlaneTransform()
mCoordScale = -mPlaneSize.Get().XY(); mCoordScale = -mPlaneSize.Get().XY();
break; break;
} }
default: break;
} }
if (mRenderSide == ERenderSide::NoRender) if (mRenderSide == ERenderSide::NoRender)
@ -268,6 +268,7 @@ void CDamageableTriggerExtra::RayAABoxIntersectTest(CRayCollisionTester& rTester
case ERenderSide::East: if (rkRay.Origin().X > AbsolutePosition().X) return; break; case ERenderSide::East: if (rkRay.Origin().X > AbsolutePosition().X) return; break;
case ERenderSide::Up: if (rkRay.Origin().Z > AbsolutePosition().Z) return; break; case ERenderSide::Up: if (rkRay.Origin().Z > AbsolutePosition().Z) return; break;
case ERenderSide::Down: if (rkRay.Origin().Z < AbsolutePosition().Z) return; break; case ERenderSide::Down: if (rkRay.Origin().Z < AbsolutePosition().Z) return; break;
default: break;
} }
} }

View File

@ -188,7 +188,7 @@ void CEditorApplication::EditResource(CResourceEntry *pEntry)
pEd = new CCollisionEditor((CCollisionMeshGroup*) pRes, mpWorldEditor); pEd = new CCollisionEditor((CCollisionMeshGroup*) pRes, mpWorldEditor);
break; break;
} }
default: break;
} }
if (pEd) if (pEd)

View File

@ -515,6 +515,7 @@ void CGizmo::SetMode(EGizmoMode Mode)
mDeltaTranslation = CVector3f::skZero; mDeltaTranslation = CVector3f::skZero;
mDeltaRotation = CQuaternion::skIdentity; mDeltaRotation = CQuaternion::skIdentity;
break; break;
default: break;
} }
} }

View File

@ -188,7 +188,7 @@ void CSceneViewport::CreateContextMenu()
connect(mpHideUnselectedAction, SIGNAL(triggered()), this, SLOT(OnHideUnselected())); connect(mpHideUnselectedAction, SIGNAL(triggered()), this, SLOT(OnHideUnselected()));
mpHideHoverSeparator = new QAction(this); mpHideHoverSeparator = new QAction(this);
mpHideHoverSeparator->setSeparator(this); mpHideHoverSeparator->setSeparator(true);
mpHideHoverNodeAction = new QAction("HideNode", this); mpHideHoverNodeAction = new QAction("HideNode", this);
connect(mpHideHoverNodeAction, SIGNAL(triggered()), this, SLOT(OnHideNode())); connect(mpHideHoverNodeAction, SIGNAL(triggered()), this, SLOT(OnHideNode()));

View File

@ -18,7 +18,7 @@ public:
virtual void undo() override { mpEditor->SetActiveTweakIndex(mOldIndex); } virtual void undo() override { mpEditor->SetActiveTweakIndex(mOldIndex); }
virtual void redo() override { mpEditor->SetActiveTweakIndex(mNewIndex); } virtual void redo() override { mpEditor->SetActiveTweakIndex(mNewIndex); }
virtual bool AffectsCleanState() const { return false; } virtual bool AffectsCleanState() const override { return false; }
}; };
/** CTweakEditor functions */ /** CTweakEditor functions */

View File

@ -327,6 +327,7 @@ void INodeEditor::OnGizmoMoved()
mUndoStack.push(new CScaleNodeCommand(this, mpSelection->SelectedNodeList(), true, mGizmo.Position(), Delta)); mUndoStack.push(new CScaleNodeCommand(this, mpSelection->SelectedNodeList(), true, mGizmo.Position(), Delta));
break; break;
} }
default: break;
} }
UpdateGizmoUI(); UpdateGizmoUI();

View File

@ -451,6 +451,7 @@ void CModelEditorWindow::UpdateMaterial(int Value)
mpCurrentPass->SetAnimMode((EUVAnimMode) (Value - 1)); mpCurrentPass->SetAnimMode((EUVAnimMode) (Value - 1));
UpdateAnimParamUI((EUVAnimMode) (Value - 1)); UpdateAnimParamUI((EUVAnimMode) (Value - 1));
break; break;
default: break;
} }
mpCurrentMat->GenerateShader(); mpCurrentMat->GenerateShader();
@ -506,6 +507,7 @@ void CModelEditorWindow::UpdateMaterial(double Value)
case EModelEditorWidget::AnimParamDSpinBox: case EModelEditorWidget::AnimParamDSpinBox:
mpCurrentPass->SetAnimParam(3, (float) Value); mpCurrentPass->SetAnimParam(3, (float) Value);
break; break;
default: break;
} }
} }
@ -543,7 +545,7 @@ void CModelEditorWindow::UpdateMaterial(bool Value)
case EModelEditorWidget::EnableLightingCheckBox: case EModelEditorWidget::EnableLightingCheckBox:
mpCurrentMat->SetLightingEnabled(Value); mpCurrentMat->SetLightingEnabled(Value);
break; break;
default: break;
} }
} }
@ -570,6 +572,7 @@ void CModelEditorWindow::UpdateMaterial(QColor Color)
case EModelEditorWidget::KonstColorPickerD: case EModelEditorWidget::KonstColorPickerD:
mpCurrentMat->SetKonst(KColor, 3); mpCurrentMat->SetKonst(KColor, 3);
break; break;
default: break;
} }
} }
@ -592,6 +595,7 @@ void CModelEditorWindow::UpdateMaterial(QString Value)
case EModelEditorWidget::IndTextureResSelector: case EModelEditorWidget::IndTextureResSelector:
mpCurrentMat->SetIndTexture(pTex); mpCurrentMat->SetIndTexture(pTex);
break; break;
default: break;
} }
} }
void CModelEditorWindow::UpdateUI(int Value) void CModelEditorWindow::UpdateUI(int Value)
@ -610,6 +614,7 @@ void CModelEditorWindow::UpdateUI(int Value)
SetActiveMaterial(Value); SetActiveMaterial(Value);
ActivateMatEditUI(true); ActivateMatEditUI(true);
break; break;
default: break;
} }
} }

View File

@ -163,6 +163,7 @@ QWidget* CPropertyDelegate::createEditor(QWidget* pParent, const QStyleOptionVie
break; break;
} }
default: break;
} }
} }
@ -328,7 +329,7 @@ void CPropertyDelegate::setEditorData(QWidget *pEditor, const QModelIndex &rkInd
break; break;
} }
default: break;
} }
} }
} }
@ -491,7 +492,7 @@ void CPropertyDelegate::setModelData(QWidget *pEditor, QAbstractItemModel* /*pMo
pAsset->ValueRef(pData) = (pEntry ? pEntry->ID() : CAssetID::InvalidID(pAsset->Game())); pAsset->ValueRef(pData) = (pEntry ? pEntry->ID() : CAssetID::InvalidID(pAsset->Game()));
break; break;
} }
default: break;
} }
} }

View File

@ -342,7 +342,7 @@ QVariant CPropertyModel::data(const QModelIndex& rkIndex, int Role) const
SSoundInfo SoundInfo = mpProject->AudioManager()->GetSoundInfo(SoundID); SSoundInfo SoundInfo = mpProject->AudioManager()->GetSoundInfo(SoundID);
QString Out = QString::number(SoundID); QString Out = QString::number(SoundID);
if (SoundInfo.DefineID == -1) if (SoundInfo.DefineID == 0xFFFF)
return Out + " [INVALID]"; return Out + " [INVALID]";
// Always display define ID. Display sound name if we have one, otherwise display AGSC ID. // Always display define ID. Display sound name if we have one, otherwise display AGSC ID.
@ -655,6 +655,7 @@ EPropertyType CPropertyModel::GetEffectiveFieldType(IProperty* pProperty) const
break; break;
} }
default: break;
} }
return Out; return Out;

View File

@ -219,6 +219,7 @@ void CPropertyView::SetPersistentEditors(const QModelIndex& rkParent)
case EPropertyType::Struct: case EPropertyType::Struct:
setFirstColumnSpanned(iChild, rkParent, true); setFirstColumnSpanned(iChild, rkParent, true);
break; break;
default: break;
} }
if (isExpanded(ChildIndex)) if (isExpanded(ChildIndex))

View File

@ -82,6 +82,7 @@ void CResourceTableContextMenu::InitMenu()
case EResourceType::StringTable: case EResourceType::StringTable:
addAction("Create Scan", this, SLOT(CreateSCAN())); addAction("Create Scan", this, SLOT(CreateSCAN()));
break; break;
default: break;
} }
} }
} }

View File

@ -22,7 +22,7 @@ public:
{ {
} }
bool mergeWith(const QUndoCommand *pkOther) bool mergeWith(const QUndoCommand *pkOther) override
{ {
return false; return false;
} }
@ -49,7 +49,7 @@ public:
// Note in some cases undo/redo may be called when the change has already been applied outside of the undo command // Note in some cases undo/redo may be called when the change has already been applied outside of the undo command
// This is why we need to check the array's actual current size instead of assuming it will match one of the arrays // This is why we need to check the array's actual current size instead of assuming it will match one of the arrays
void undo() void undo() override
{ {
//@todo verify, do we need to fully override undo()? //@todo verify, do we need to fully override undo()?
if (mpModel) if (mpModel)
@ -65,7 +65,7 @@ public:
} }
} }
void redo() void redo() override
{ {
if (mpModel) if (mpModel)
{ {

View File

@ -830,6 +830,8 @@ void CWorldEditor::UpdateGizmoUI()
else if (!mpSelection->IsEmpty()) else if (!mpSelection->IsEmpty())
SpinBoxValue = mpSelection->Front()->AbsoluteScale(); SpinBoxValue = mpSelection->Front()->AbsoluteScale();
break; break;
default: break;
} }
} }
else if (!mpSelection->IsEmpty()) SpinBoxValue = mpSelection->Front()->AbsolutePosition(); else if (!mpSelection->IsEmpty()) SpinBoxValue = mpSelection->Front()->AbsolutePosition();
@ -1195,6 +1197,7 @@ void CWorldEditor::OnTransformSpinBoxModified(CVector3f Value)
UndoStack().push(new CScaleNodeCommand(this, mpSelection->SelectedNodeList(), true, mGizmo.Position(), Delta)); UndoStack().push(new CScaleNodeCommand(this, mpSelection->SelectedNodeList(), true, mGizmo.Position(), Delta));
break; break;
} }
default: break;
} }
UpdateGizmoUI(); UpdateGizmoUI();

View File

@ -96,11 +96,11 @@ public:
inline CGeneratePropertyNamesDialog* NameGeneratorDialog() const { return mpGeneratePropertyNamesDialog; } inline CGeneratePropertyNamesDialog* NameGeneratorDialog() const { return mpGeneratePropertyNamesDialog; }
inline CTweakEditor* TweakEditor() { return mpTweakEditor; } inline CTweakEditor* TweakEditor() { return mpTweakEditor; }
CResourceBrowser* ResourceBrowser() const; CResourceBrowser* ResourceBrowser() const;
CSceneViewport* Viewport() const; CSceneViewport* Viewport() const override;
public slots: public slots:
virtual void EditorTick(float); virtual void EditorTick(float) override;
virtual void NotifyNodeAboutToBeDeleted(CSceneNode *pNode); virtual void NotifyNodeAboutToBeDeleted(CSceneNode *pNode) override;
virtual bool Save() override; virtual bool Save() override;
void Cut(); void Cut();
@ -130,8 +130,8 @@ public slots:
void UpdateOpenRecentActions(); void UpdateOpenRecentActions();
void UpdateWindowTitle(); void UpdateWindowTitle();
void UpdateStatusBar(); void UpdateStatusBar();
void UpdateGizmoUI(); void UpdateGizmoUI() override;
void UpdateSelectionUI(); void UpdateSelectionUI() override;
void UpdateCursor(); void UpdateCursor();
void UpdateNewLinkLine(); void UpdateNewLinkLine();
@ -141,7 +141,7 @@ public slots:
protected: protected:
QAction* AddEditModeButton(QIcon Icon, QString ToolTip, EWorldEditorMode Mode); QAction* AddEditModeButton(QIcon Icon, QString ToolTip, EWorldEditorMode Mode);
void SetSidebar(CWorldEditorSidebar *pSidebar); void SetSidebar(CWorldEditorSidebar *pSidebar);
void GizmoModeChanged(CGizmo::EGizmoMode Mode); void GizmoModeChanged(CGizmo::EGizmoMode Mode) override;
private slots: private slots:
void OnClipboardDataModified(); void OnClipboardDataModified();

View File

@ -24,6 +24,7 @@ void QtLogRedirect(QtMsgType Type, const QMessageLogContext& /*rkContext*/, cons
case QtWarningMsg: warnf ("Qt Warning: %s", *TO_TSTRING(rkMessage)); break; case QtWarningMsg: warnf ("Qt Warning: %s", *TO_TSTRING(rkMessage)); break;
case QtCriticalMsg: errorf("Qt Critical: %s", *TO_TSTRING(rkMessage)); break; case QtCriticalMsg: errorf("Qt Critical: %s", *TO_TSTRING(rkMessage)); break;
case QtFatalMsg: fatalf("Qt Fatal: %s", *TO_TSTRING(rkMessage)); break; case QtFatalMsg: fatalf("Qt Fatal: %s", *TO_TSTRING(rkMessage)); break;
default: break;
} }
} }