From 1c80a13c231d289ce76647534cdeaf75a33318b8 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Sun, 26 May 2019 18:18:31 -0700 Subject: [PATCH] Silence Warnings --- src/Core/Resource/CTexture.cpp | 5 ++++- src/Core/Resource/Cooker/CAreaCooker.cpp | 2 ++ src/Core/Resource/Cooker/CMaterialCooker.cpp | 3 +++ src/Core/Resource/Cooker/CScriptCooker.cpp | 3 ++- src/Core/Resource/Factory/CModelLoader.cpp | 2 ++ src/Core/Resource/Factory/CScriptLoader.cpp | 2 +- src/Core/Resource/Script/CScriptTemplate.cpp | 2 ++ src/Core/Resource/Script/Property/CVectorProperty.h | 4 ++-- src/Core/Resource/Script/Property/IProperty.cpp | 1 + src/Core/Resource/Script/Property/IProperty.h | 2 ++ src/Core/Scene/CScriptNode.cpp | 1 + src/Core/ScriptExtra/CDamageableTriggerExtra.cpp | 3 ++- src/Editor/CEditorApplication.cpp | 2 +- src/Editor/CGizmo.cpp | 1 + src/Editor/CSceneViewport.cpp | 2 +- src/Editor/CTweakEditor.cpp | 2 +- src/Editor/INodeEditor.cpp | 1 + src/Editor/ModelEditor/CModelEditorWindow.cpp | 7 ++++++- src/Editor/PropertyEdit/CPropertyDelegate.cpp | 5 +++-- src/Editor/PropertyEdit/CPropertyModel.cpp | 3 ++- src/Editor/PropertyEdit/CPropertyView.cpp | 1 + .../ResourceBrowser/CResourceTableContextMenu.cpp | 1 + src/Editor/Undo/CResizeScriptArrayCommand.h | 6 +++--- src/Editor/WorldEditor/CWorldEditor.cpp | 3 +++ src/Editor/WorldEditor/CWorldEditor.h | 12 ++++++------ src/Editor/main.cpp | 1 + 26 files changed, 55 insertions(+), 22 deletions(-) diff --git a/src/Core/Resource/CTexture.cpp b/src/Core/Resource/CTexture.cpp index ae593bda..d7104613 100644 --- a/src/Core/Resource/CTexture.cpp +++ b/src/Core/Resource/CTexture.cpp @@ -72,6 +72,7 @@ bool CTexture::BufferGL() GLFormat = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; IsCompressed = true; 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. @@ -188,7 +189,7 @@ bool CTexture::WriteDDS(IOutputStream& rOut) CopyGLBuffer(); - rOut.WriteFourCC(FOURCC('DDS')); // "DDS " fourCC + rOut.WriteFourCC(FOURCC('DDS ')); // "DDS " fourCC rOut.WriteLong(0x7C); // dwSize rOut.WriteLong(0x21007); // dwFlags rOut.WriteLong(mHeight); // dwHeight @@ -243,6 +244,8 @@ bool CTexture::WriteDDS(IOutputStream& rOut) case ETexelFormat::DXT1: PFFlags = 0x4; break; + default: + break; } rOut.WriteLong(PFFlags); // DDS_PIXELFORMAT.dwFlags diff --git a/src/Core/Resource/Cooker/CAreaCooker.cpp b/src/Core/Resource/Cooker/CAreaCooker.cpp index 43664e9c..3507410d 100644 --- a/src/Core/Resource/Cooker/CAreaCooker.cpp +++ b/src/Core/Resource/Cooker/CAreaCooker.cpp @@ -45,6 +45,8 @@ void CAreaCooker::DetermineSectionNumbersPrime() case EGame::Echoes: GeometrySections = 3 + (9 * OriginalMeshCount); // Acount for materials + AROT + an unknown section break; + default: + break; } for (uint32 iMesh = 0; iMesh < mpArea->mWorldModels.size(); iMesh++) diff --git a/src/Core/Resource/Cooker/CMaterialCooker.cpp b/src/Core/Resource/Cooker/CMaterialCooker.cpp index 8695e4c8..38b629c1 100644 --- a/src/Core/Resource/Cooker/CMaterialCooker.cpp +++ b/src/Core/Resource/Cooker/CMaterialCooker.cpp @@ -366,6 +366,8 @@ void CMaterialCooker::WriteCookedMatSet(CMaterialSet *pSet, EGame Version, IOutp case EGame::Echoes: Cooker.WriteMatSetPrime(rOut); break; + default: + break; } } @@ -384,5 +386,6 @@ void CMaterialCooker::WriteCookedMaterial(CMaterial *pMat, EGame Version, IOutpu Cooker.WriteMaterialPrime(rOut); break; // TODO: Corruption/Uncooked + default: break; } } diff --git a/src/Core/Resource/Cooker/CScriptCooker.cpp b/src/Core/Resource/Cooker/CScriptCooker.cpp index 96c38f81..96f67989 100644 --- a/src/Core/Resource/Cooker/CScriptCooker.cpp +++ b/src/Core/Resource/Cooker/CScriptCooker.cpp @@ -214,7 +214,8 @@ void CScriptCooker::WriteProperty(IOutputStream& rOut, IProperty* pProperty, voi break; } - + default: + break; } if (SizeOffset != 0) diff --git a/src/Core/Resource/Factory/CModelLoader.cpp b/src/Core/Resource/Factory/CModelLoader.cpp index 133d70c9..49c68ab8 100644 --- a/src/Core/Resource/Factory/CModelLoader.cpp +++ b/src/Core/Resource/Factory/CModelLoader.cpp @@ -219,6 +219,8 @@ SSurface* CModelLoader::LoadSurface(IInputStream& rModel) case EPrimitiveType::TriangleStrip: pSurf->TriangleCount += VertexCount - 2; break; + default: + break; } pSurf->Primitives.push_back(Prim); diff --git a/src/Core/Resource/Factory/CScriptLoader.cpp b/src/Core/Resource/Factory/CScriptLoader.cpp index 86f5c75d..4100d1df 100644 --- a/src/Core/Resource/Factory/CScriptLoader.cpp +++ b/src/Core/Resource/Factory/CScriptLoader.cpp @@ -264,7 +264,7 @@ void CScriptLoader::ReadProperty(IProperty *pProp, uint32 Size, IInputStream& rS mpCurrentData = pOldData; break; } - + default: break; } } diff --git a/src/Core/Resource/Script/CScriptTemplate.cpp b/src/Core/Resource/Script/CScriptTemplate.cpp index 2b1721e6..c9759252 100644 --- a/src/Core/Resource/Script/CScriptTemplate.cpp +++ b/src/Core/Resource/Script/CScriptTemplate.cpp @@ -179,6 +179,8 @@ int32 CScriptTemplate::CheckVolumeConditions(CScriptObject *pObj, bool LogErrors case EPropertyType::Choice: Val = TPropCast(pProp)->Value(pData); break; + default: + break; } // Test and check whether any of the conditions are true diff --git a/src/Core/Resource/Script/Property/CVectorProperty.h b/src/Core/Resource/Script/Property/CVectorProperty.h index 089c2bbd..51ff7b8d 100644 --- a/src/Core/Resource/Script/Property/CVectorProperty.h +++ b/src/Core/Resource/Script/Property/CVectorProperty.h @@ -20,12 +20,12 @@ public: 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); } - virtual TString ValueAsString(void* pData) const + virtual TString ValueAsString(void* pData) const override { return Value(pData).ToString(); } diff --git a/src/Core/Resource/Script/Property/IProperty.cpp b/src/Core/Resource/Script/Property/IProperty.cpp index 018158db..d66a6e76 100644 --- a/src/Core/Resource/Script/Property/IProperty.cpp +++ b/src/Core/Resource/Script/Property/IProperty.cpp @@ -633,6 +633,7 @@ IProperty* IProperty::Create(EPropertyType Type, case EPropertyType::Pointer: pOut = new CPointerProperty(Game); break; case EPropertyType::Struct: pOut = new CStructProperty(Game); break; case EPropertyType::Array: pOut = new CArrayProperty(Game); break; + default: break; } // If this assertion fails, then there is an unhandled type! diff --git a/src/Core/Resource/Script/Property/IProperty.h b/src/Core/Resource/Script/Property/IProperty.h index a62231b3..e3d167ce 100644 --- a/src/Core/Resource/Script/Property/IProperty.h +++ b/src/Core/Resource/Script/Property/IProperty.h @@ -453,6 +453,8 @@ public: case EPropertyType::Guid: MakeOptional = true; break; + default: + break; } } diff --git a/src/Core/Scene/CScriptNode.cpp b/src/Core/Scene/CScriptNode.cpp index 49ca1b89..8775d105 100644 --- a/src/Core/Scene/CScriptNode.cpp +++ b/src/Core/Scene/CScriptNode.cpp @@ -550,6 +550,7 @@ void CScriptNode::UpdatePreviewVolume() case EVolumeShape::CylinderShape: pVolumeModel = gpEditorStore->LoadResource("VolumeCylinder.CMDL"); break; + default: break; } mHasVolumePreview = (pVolumeModel != nullptr); diff --git a/src/Core/ScriptExtra/CDamageableTriggerExtra.cpp b/src/Core/ScriptExtra/CDamageableTriggerExtra.cpp index ff931baa..451aa858 100644 --- a/src/Core/ScriptExtra/CDamageableTriggerExtra.cpp +++ b/src/Core/ScriptExtra/CDamageableTriggerExtra.cpp @@ -119,7 +119,7 @@ void CDamageableTriggerExtra::UpdatePlaneTransform() mCoordScale = -mPlaneSize.Get().XY(); break; } - + default: break; } 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::Up: if (rkRay.Origin().Z > AbsolutePosition().Z) return; break; case ERenderSide::Down: if (rkRay.Origin().Z < AbsolutePosition().Z) return; break; + default: break; } } diff --git a/src/Editor/CEditorApplication.cpp b/src/Editor/CEditorApplication.cpp index af9605d8..fd952209 100644 --- a/src/Editor/CEditorApplication.cpp +++ b/src/Editor/CEditorApplication.cpp @@ -188,7 +188,7 @@ void CEditorApplication::EditResource(CResourceEntry *pEntry) pEd = new CCollisionEditor((CCollisionMeshGroup*) pRes, mpWorldEditor); break; } - + default: break; } if (pEd) diff --git a/src/Editor/CGizmo.cpp b/src/Editor/CGizmo.cpp index de937770..fdd7f050 100644 --- a/src/Editor/CGizmo.cpp +++ b/src/Editor/CGizmo.cpp @@ -515,6 +515,7 @@ void CGizmo::SetMode(EGizmoMode Mode) mDeltaTranslation = CVector3f::skZero; mDeltaRotation = CQuaternion::skIdentity; break; + default: break; } } diff --git a/src/Editor/CSceneViewport.cpp b/src/Editor/CSceneViewport.cpp index a87c4a49..890de93c 100644 --- a/src/Editor/CSceneViewport.cpp +++ b/src/Editor/CSceneViewport.cpp @@ -188,7 +188,7 @@ void CSceneViewport::CreateContextMenu() connect(mpHideUnselectedAction, SIGNAL(triggered()), this, SLOT(OnHideUnselected())); mpHideHoverSeparator = new QAction(this); - mpHideHoverSeparator->setSeparator(this); + mpHideHoverSeparator->setSeparator(true); mpHideHoverNodeAction = new QAction("HideNode", this); connect(mpHideHoverNodeAction, SIGNAL(triggered()), this, SLOT(OnHideNode())); diff --git a/src/Editor/CTweakEditor.cpp b/src/Editor/CTweakEditor.cpp index a36d3160..221112f7 100644 --- a/src/Editor/CTweakEditor.cpp +++ b/src/Editor/CTweakEditor.cpp @@ -18,7 +18,7 @@ public: virtual void undo() override { mpEditor->SetActiveTweakIndex(mOldIndex); } virtual void redo() override { mpEditor->SetActiveTweakIndex(mNewIndex); } - virtual bool AffectsCleanState() const { return false; } + virtual bool AffectsCleanState() const override { return false; } }; /** CTweakEditor functions */ diff --git a/src/Editor/INodeEditor.cpp b/src/Editor/INodeEditor.cpp index 68005b3d..c8a11db6 100644 --- a/src/Editor/INodeEditor.cpp +++ b/src/Editor/INodeEditor.cpp @@ -327,6 +327,7 @@ void INodeEditor::OnGizmoMoved() mUndoStack.push(new CScaleNodeCommand(this, mpSelection->SelectedNodeList(), true, mGizmo.Position(), Delta)); break; } + default: break; } UpdateGizmoUI(); diff --git a/src/Editor/ModelEditor/CModelEditorWindow.cpp b/src/Editor/ModelEditor/CModelEditorWindow.cpp index 7a3a67a8..19629750 100644 --- a/src/Editor/ModelEditor/CModelEditorWindow.cpp +++ b/src/Editor/ModelEditor/CModelEditorWindow.cpp @@ -451,6 +451,7 @@ void CModelEditorWindow::UpdateMaterial(int Value) mpCurrentPass->SetAnimMode((EUVAnimMode) (Value - 1)); UpdateAnimParamUI((EUVAnimMode) (Value - 1)); break; + default: break; } mpCurrentMat->GenerateShader(); @@ -506,6 +507,7 @@ void CModelEditorWindow::UpdateMaterial(double Value) case EModelEditorWidget::AnimParamDSpinBox: mpCurrentPass->SetAnimParam(3, (float) Value); break; + default: break; } } @@ -543,7 +545,7 @@ void CModelEditorWindow::UpdateMaterial(bool Value) case EModelEditorWidget::EnableLightingCheckBox: mpCurrentMat->SetLightingEnabled(Value); break; - + default: break; } } @@ -570,6 +572,7 @@ void CModelEditorWindow::UpdateMaterial(QColor Color) case EModelEditorWidget::KonstColorPickerD: mpCurrentMat->SetKonst(KColor, 3); break; + default: break; } } @@ -592,6 +595,7 @@ void CModelEditorWindow::UpdateMaterial(QString Value) case EModelEditorWidget::IndTextureResSelector: mpCurrentMat->SetIndTexture(pTex); break; + default: break; } } void CModelEditorWindow::UpdateUI(int Value) @@ -610,6 +614,7 @@ void CModelEditorWindow::UpdateUI(int Value) SetActiveMaterial(Value); ActivateMatEditUI(true); break; + default: break; } } diff --git a/src/Editor/PropertyEdit/CPropertyDelegate.cpp b/src/Editor/PropertyEdit/CPropertyDelegate.cpp index 5d1443d3..5af98fda 100644 --- a/src/Editor/PropertyEdit/CPropertyDelegate.cpp +++ b/src/Editor/PropertyEdit/CPropertyDelegate.cpp @@ -163,6 +163,7 @@ QWidget* CPropertyDelegate::createEditor(QWidget* pParent, const QStyleOptionVie break; } + default: break; } } @@ -328,7 +329,7 @@ void CPropertyDelegate::setEditorData(QWidget *pEditor, const QModelIndex &rkInd break; } - + default: break; } } } @@ -491,7 +492,7 @@ void CPropertyDelegate::setModelData(QWidget *pEditor, QAbstractItemModel* /*pMo pAsset->ValueRef(pData) = (pEntry ? pEntry->ID() : CAssetID::InvalidID(pAsset->Game())); break; } - + default: break; } } diff --git a/src/Editor/PropertyEdit/CPropertyModel.cpp b/src/Editor/PropertyEdit/CPropertyModel.cpp index 2128b216..37348674 100644 --- a/src/Editor/PropertyEdit/CPropertyModel.cpp +++ b/src/Editor/PropertyEdit/CPropertyModel.cpp @@ -342,7 +342,7 @@ QVariant CPropertyModel::data(const QModelIndex& rkIndex, int Role) const SSoundInfo SoundInfo = mpProject->AudioManager()->GetSoundInfo(SoundID); QString Out = QString::number(SoundID); - if (SoundInfo.DefineID == -1) + if (SoundInfo.DefineID == 0xFFFF) return Out + " [INVALID]"; // 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; } + default: break; } return Out; diff --git a/src/Editor/PropertyEdit/CPropertyView.cpp b/src/Editor/PropertyEdit/CPropertyView.cpp index ac3853fb..e0b3fe2a 100644 --- a/src/Editor/PropertyEdit/CPropertyView.cpp +++ b/src/Editor/PropertyEdit/CPropertyView.cpp @@ -219,6 +219,7 @@ void CPropertyView::SetPersistentEditors(const QModelIndex& rkParent) case EPropertyType::Struct: setFirstColumnSpanned(iChild, rkParent, true); break; + default: break; } if (isExpanded(ChildIndex)) diff --git a/src/Editor/ResourceBrowser/CResourceTableContextMenu.cpp b/src/Editor/ResourceBrowser/CResourceTableContextMenu.cpp index 29aeee55..9d7a589b 100644 --- a/src/Editor/ResourceBrowser/CResourceTableContextMenu.cpp +++ b/src/Editor/ResourceBrowser/CResourceTableContextMenu.cpp @@ -82,6 +82,7 @@ void CResourceTableContextMenu::InitMenu() case EResourceType::StringTable: addAction("Create Scan", this, SLOT(CreateSCAN())); break; + default: break; } } } diff --git a/src/Editor/Undo/CResizeScriptArrayCommand.h b/src/Editor/Undo/CResizeScriptArrayCommand.h index 963a092c..4cbdc7ad 100644 --- a/src/Editor/Undo/CResizeScriptArrayCommand.h +++ b/src/Editor/Undo/CResizeScriptArrayCommand.h @@ -22,7 +22,7 @@ public: { } - bool mergeWith(const QUndoCommand *pkOther) + bool mergeWith(const QUndoCommand *pkOther) override { 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 // 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()? if (mpModel) @@ -65,7 +65,7 @@ public: } } - void redo() + void redo() override { if (mpModel) { diff --git a/src/Editor/WorldEditor/CWorldEditor.cpp b/src/Editor/WorldEditor/CWorldEditor.cpp index c456d1ac..d93fcbd4 100644 --- a/src/Editor/WorldEditor/CWorldEditor.cpp +++ b/src/Editor/WorldEditor/CWorldEditor.cpp @@ -830,6 +830,8 @@ void CWorldEditor::UpdateGizmoUI() else if (!mpSelection->IsEmpty()) SpinBoxValue = mpSelection->Front()->AbsoluteScale(); break; + + default: break; } } 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)); break; } + default: break; } UpdateGizmoUI(); diff --git a/src/Editor/WorldEditor/CWorldEditor.h b/src/Editor/WorldEditor/CWorldEditor.h index eaaf64b0..06e440b9 100644 --- a/src/Editor/WorldEditor/CWorldEditor.h +++ b/src/Editor/WorldEditor/CWorldEditor.h @@ -96,11 +96,11 @@ public: inline CGeneratePropertyNamesDialog* NameGeneratorDialog() const { return mpGeneratePropertyNamesDialog; } inline CTweakEditor* TweakEditor() { return mpTweakEditor; } CResourceBrowser* ResourceBrowser() const; - CSceneViewport* Viewport() const; + CSceneViewport* Viewport() const override; public slots: - virtual void EditorTick(float); - virtual void NotifyNodeAboutToBeDeleted(CSceneNode *pNode); + virtual void EditorTick(float) override; + virtual void NotifyNodeAboutToBeDeleted(CSceneNode *pNode) override; virtual bool Save() override; void Cut(); @@ -130,8 +130,8 @@ public slots: void UpdateOpenRecentActions(); void UpdateWindowTitle(); void UpdateStatusBar(); - void UpdateGizmoUI(); - void UpdateSelectionUI(); + void UpdateGizmoUI() override; + void UpdateSelectionUI() override; void UpdateCursor(); void UpdateNewLinkLine(); @@ -141,7 +141,7 @@ public slots: protected: QAction* AddEditModeButton(QIcon Icon, QString ToolTip, EWorldEditorMode Mode); void SetSidebar(CWorldEditorSidebar *pSidebar); - void GizmoModeChanged(CGizmo::EGizmoMode Mode); + void GizmoModeChanged(CGizmo::EGizmoMode Mode) override; private slots: void OnClipboardDataModified(); diff --git a/src/Editor/main.cpp b/src/Editor/main.cpp index 488ffe09..4c3b3f7c 100644 --- a/src/Editor/main.cpp +++ b/src/Editor/main.cpp @@ -20,6 +20,7 @@ void QtLogRedirect(QtMsgType Type, const QMessageLogContext& /*rkContext*/, cons case QtWarningMsg: warnf ("Qt Warning: %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; + default: break; } }