CModelEditorWindow: Make use of in-class initializers where applicable
This commit is contained in:
parent
16225c278d
commit
6cdea11377
|
@ -22,19 +22,15 @@
|
|||
|
||||
CModelEditorWindow::CModelEditorWindow(CModel *pModel, QWidget *pParent)
|
||||
: IEditor(pParent)
|
||||
, ui(new Ui::CModelEditorWindow)
|
||||
, mpScene(new CScene())
|
||||
, mpCurrentMat(nullptr)
|
||||
, mpCurrentModel(nullptr)
|
||||
, mpCurrentModelNode(new CModelNode(mpScene, -1))
|
||||
, mpCurrentPass(nullptr)
|
||||
, mIgnoreSignals(false)
|
||||
, ui(std::make_unique<Ui::CModelEditorWindow>())
|
||||
, mpScene(std::make_unique<CScene>())
|
||||
, mpCurrentModelNode(std::make_unique<CModelNode>(mpScene.get(), UINT32_MAX))
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->ActionSave->setEnabled( pModel->Game() == EGame::Prime ); // we don't support saving games later than MP1
|
||||
REPLACE_WINDOWTITLE_APPVARS;
|
||||
|
||||
ui->Viewport->SetNode(mpCurrentModelNode);
|
||||
ui->Viewport->SetNode(mpCurrentModelNode.get());
|
||||
ui->Viewport->SetClearColor(CColor(0.3f, 0.3f, 0.3f, 1.f));
|
||||
|
||||
CCamera& rCamera = ui->Viewport->Camera();
|
||||
|
@ -144,12 +140,7 @@ CModelEditorWindow::CModelEditorWindow(CModel *pModel, QWidget *pParent)
|
|||
SetActiveModel(pModel);
|
||||
}
|
||||
|
||||
CModelEditorWindow::~CModelEditorWindow()
|
||||
{
|
||||
delete mpCurrentModelNode;
|
||||
delete mpScene;
|
||||
delete ui;
|
||||
}
|
||||
CModelEditorWindow::~CModelEditorWindow() = default;
|
||||
|
||||
bool CModelEditorWindow::Save()
|
||||
{
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
#include <QMainWindow>
|
||||
#include <QTimer>
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace Ui {
|
||||
class CModelEditorWindow;
|
||||
}
|
||||
|
@ -22,21 +24,22 @@ class CModelEditorWindow : public IEditor
|
|||
{
|
||||
Q_OBJECT
|
||||
|
||||
Ui::CModelEditorWindow *ui;
|
||||
CScene *mpScene;
|
||||
std::unique_ptr<Ui::CModelEditorWindow> ui;
|
||||
std::unique_ptr<CScene> mpScene;
|
||||
QString mOutputFilename;
|
||||
TResPtr<CModel> mpCurrentModel;
|
||||
CModelNode *mpCurrentModelNode;
|
||||
CMaterial *mpCurrentMat;
|
||||
CMaterialPass *mpCurrentPass;
|
||||
bool mIgnoreSignals;
|
||||
std::unique_ptr<CModelNode> mpCurrentModelNode;
|
||||
CMaterial *mpCurrentMat = nullptr;
|
||||
CMaterialPass *mpCurrentPass = nullptr;
|
||||
bool mIgnoreSignals = false;
|
||||
|
||||
public:
|
||||
explicit CModelEditorWindow(CModel *pModel, QWidget *pParent = 0);
|
||||
~CModelEditorWindow();
|
||||
bool Save();
|
||||
explicit CModelEditorWindow(CModel *pModel, QWidget *pParent = nullptr);
|
||||
~CModelEditorWindow() override;
|
||||
|
||||
bool Save() override;
|
||||
void SetActiveModel(CModel *pModel);
|
||||
CModelEditorViewport* Viewport() const;
|
||||
CModelEditorViewport* Viewport() const override;
|
||||
|
||||
enum class EModelEditorWidget
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue