Remove legacy serialization and QPropertyTree (#684)
Remove: - CryCommon/CryExtension/* - CryCommon/Serialization/* - Sandbox/Plugins/EditorCommon/QPropertyTree/* - All related CryCommon interfaces - All CrySystem implementations - Various related Editor classes
This commit is contained in:
@@ -1,821 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#include "EditorDefs.h"
|
||||
|
||||
#include "CurveEditorCtrl.h"
|
||||
|
||||
// Qt
|
||||
#include <QPainter>
|
||||
#include <QPainterPath>
|
||||
|
||||
namespace CurveEditor
|
||||
{
|
||||
const int kHandleSize = 6;
|
||||
const int kHandleSizeHalf = kHandleSize / 2;
|
||||
const int kDefaultPadding = 10;
|
||||
const int kInfoFontSize = 7;
|
||||
const int kGrid = 4;
|
||||
const QColor kColor_SelectCross(132, 132, 132);
|
||||
const QColor kColor_DisabledCross(90, 90, 90);
|
||||
const QColor kColor_MiddleLines(80, 80, 80);
|
||||
const QColor kColor_Background(41, 41, 41);
|
||||
const QColor kColor_Disabled(60, 60, 60);
|
||||
const QColor kColor_PaddingBorder(128, 128, 128);
|
||||
const QColor kColor_Text(128, 128, 128);
|
||||
const QColor kColor_TextCrtPos(187, 187, 187);
|
||||
const QColor kColor_Curve(255, 0, 0);
|
||||
const QColor kColor_SelHandle(200, 200, 200);
|
||||
const QColor kColor_NormalHandle(30, 30, 30);
|
||||
const QColor kColor_HandleLight(60, 60, 60);
|
||||
const QColor kColor_HandleShadow(0, 0, 0);
|
||||
const QColor kColor_MarkLines(0, 255, 0);
|
||||
}
|
||||
|
||||
|
||||
CCurveEditorCtrl::CCurveEditorCtrl(QWidget* parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
m_domainMinX = 0.0f;
|
||||
m_domainMinY = 0.0f;
|
||||
m_domainMaxX = 1.0f;
|
||||
m_domainMaxY = 1.0f;
|
||||
m_bMouseDown = m_bDragging = false;
|
||||
m_bAllowMouse = true;
|
||||
m_padding = CurveEditor::kDefaultPadding;
|
||||
m_flags = eFlag_ShowVerticalRuler
|
||||
| eFlag_ShowHorizontalRuler
|
||||
| eFlag_ShowVerticalRulerText
|
||||
| eFlag_ShowHorizontalRulerText
|
||||
| eFlag_ShowPaddingBorder
|
||||
| eFlag_ShowMovingPointAxis
|
||||
| eFlag_ShowPointHandles;
|
||||
m_gridSplits.set(CurveEditor::kGrid, CurveEditor::kGrid);
|
||||
m_fntInfo.setFamily("Arial");
|
||||
m_fntInfo.setPointSize(CurveEditor::kInfoFontSize);
|
||||
m_bHovered = false;
|
||||
m_selCrossPen = QPen(CurveEditor::kColor_SelectCross);
|
||||
|
||||
GenerateDefaultCurve();
|
||||
}
|
||||
|
||||
CCurveEditorCtrl::~CCurveEditorCtrl()
|
||||
{
|
||||
}
|
||||
|
||||
void CCurveEditorCtrl::SetFlags(UINT aFlags)
|
||||
{
|
||||
m_flags = aFlags;
|
||||
}
|
||||
|
||||
UINT CCurveEditorCtrl::GetFlags() const
|
||||
{
|
||||
return m_flags;
|
||||
}
|
||||
|
||||
bool CCurveEditorCtrl::SetDomainBounds(float aMinX, float aMinY, float aMaxX, float aMaxY)
|
||||
{
|
||||
assert(aMinX < aMaxX);
|
||||
assert(aMinY < aMaxY);
|
||||
|
||||
if (aMinX >= aMaxX)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (aMinY >= aMaxY)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
m_domainMinX = aMinX;
|
||||
m_domainMinY = aMinY;
|
||||
m_domainMaxX = aMaxX;
|
||||
m_domainMaxY = aMaxY;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CCurveEditorCtrl::GetDomainBounds(float& rMinX, float& rMinY, float& rMaxX, float& rMaxY) const
|
||||
{
|
||||
rMinX = m_domainMinX;
|
||||
rMinY = m_domainMinY;
|
||||
rMaxX = m_domainMaxX;
|
||||
rMaxY = m_domainMaxY;
|
||||
}
|
||||
|
||||
void CCurveEditorCtrl::SetGrid(UINT aHorizontalSplits, UINT aVerticalSplits, const QStringList& labelsX, const QStringList& labelsY)
|
||||
{
|
||||
assert(aHorizontalSplits);
|
||||
assert(aVerticalSplits);
|
||||
|
||||
if (!aHorizontalSplits)
|
||||
{
|
||||
// defaults
|
||||
aHorizontalSplits = 2;
|
||||
}
|
||||
|
||||
if (!aVerticalSplits)
|
||||
{
|
||||
// defaults
|
||||
aVerticalSplits = 2;
|
||||
}
|
||||
|
||||
m_gridSplits.x = aHorizontalSplits;
|
||||
m_gridSplits.y = aVerticalSplits;
|
||||
|
||||
if (!labelsX.isEmpty())
|
||||
{
|
||||
m_labelsX = labelsX;
|
||||
}
|
||||
|
||||
if (!labelsY.isEmpty())
|
||||
{
|
||||
m_labelsY = labelsY;
|
||||
}
|
||||
}
|
||||
|
||||
QPoint CCurveEditorCtrl::ProjectPoint(float x, float y)
|
||||
{
|
||||
QPoint pt;
|
||||
|
||||
pt.setX(m_padding + (width() - m_padding * 2) * (x - m_domainMinX) / (m_domainMaxX - m_domainMinX));
|
||||
pt.setY(m_padding + (height() - m_padding * 2) * (1.0f - (y - m_domainMinY) / (m_domainMaxY - m_domainMinY)));
|
||||
|
||||
return pt;
|
||||
}
|
||||
|
||||
Vec2 CCurveEditorCtrl::UnprojectPoint(const QPoint& pt)
|
||||
{
|
||||
Vec2 vec;
|
||||
int y = height() - pt.y();
|
||||
float dx = (width() - m_padding * 2);
|
||||
float dy = (height() - m_padding * 2);
|
||||
const float kEpsilon = 0.00000001f;
|
||||
|
||||
if (fabs(dx) <= kEpsilon)
|
||||
{
|
||||
dx = 1.0f;
|
||||
}
|
||||
|
||||
if (fabs(dy) <= kEpsilon)
|
||||
{
|
||||
dy = 1.0f;
|
||||
}
|
||||
|
||||
vec.x = m_domainMinX + (float)(pt.x() - m_padding) / dx * (m_domainMaxX - m_domainMinX);
|
||||
vec.y = m_domainMinY + (float)(y - m_padding) / dy * (m_domainMaxY - m_domainMinY);
|
||||
|
||||
return vec;
|
||||
}
|
||||
|
||||
void CCurveEditorCtrl::SetControlPointCount(UINT aCount)
|
||||
{
|
||||
m_points.resize(aCount);
|
||||
m_projectedPoints.clear();
|
||||
}
|
||||
|
||||
UINT CCurveEditorCtrl::GetControlPointCount() const
|
||||
{
|
||||
return m_points.size();
|
||||
}
|
||||
|
||||
void CCurveEditorCtrl::AddControlPoint(const Vec2& rPosition)
|
||||
{
|
||||
m_points.push_back(CurvePoint(rPosition.x, rPosition.y));
|
||||
}
|
||||
|
||||
void CCurveEditorCtrl::ClearControlPoints()
|
||||
{
|
||||
m_points.clear();
|
||||
}
|
||||
|
||||
void CCurveEditorCtrl::SetControlPoint(UINT aIndex, const Vec2& rPosition)
|
||||
{
|
||||
assert(aIndex < m_points.size());
|
||||
|
||||
if (aIndex >= m_points.size())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_points[aIndex].pos = rPosition;
|
||||
}
|
||||
|
||||
void CCurveEditorCtrl::SetControlPointTangents(UINT aIndex, const Vec2& rLeft, const Vec2& rRight)
|
||||
{
|
||||
assert(aIndex < m_points.size());
|
||||
|
||||
if (aIndex >= m_points.size())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_points[aIndex].tanA = rLeft;
|
||||
m_points[aIndex].tanB = rRight;
|
||||
}
|
||||
|
||||
void CCurveEditorCtrl::GetControlPoint(UINT aIndex, Vec2& rOutPosition) const
|
||||
{
|
||||
assert(aIndex < m_points.size());
|
||||
|
||||
if (aIndex >= m_points.size())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
rOutPosition = m_points[aIndex].pos;
|
||||
}
|
||||
|
||||
void CCurveEditorCtrl::GetControlPointTangents(UINT aIndex, Vec2& rOutLeft, Vec2& rOutRight) const
|
||||
{
|
||||
assert(aIndex < m_points.size());
|
||||
|
||||
if (aIndex >= m_points.size())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
rOutLeft = m_points[aIndex].tanA;
|
||||
rOutRight = m_points[aIndex].tanB;
|
||||
}
|
||||
|
||||
void CCurveEditorCtrl::paintEvent(QPaintEvent* event)
|
||||
{
|
||||
QWidget::paintEvent(event);
|
||||
|
||||
QPainter dc(this);
|
||||
|
||||
QRect rc = geometry();
|
||||
QString str;
|
||||
QRect textSize;
|
||||
|
||||
dc.setFont(m_fntInfo);
|
||||
QFontMetrics fntMetrics(m_fntInfo);
|
||||
|
||||
if (m_flags & eFlag_Disabled)
|
||||
{
|
||||
// If disabled, just draw a blank square.
|
||||
dc.fillRect(rc, CurveEditor::kColor_Disabled);
|
||||
|
||||
dc.setPen(CurveEditor::kColor_DisabledCross);
|
||||
dc.drawLine(0, 0, rc.width(), rc.height());
|
||||
|
||||
dc.drawLine(rc.width(), 0, 0, rc.height());
|
||||
return;
|
||||
}
|
||||
|
||||
dc.fillRect(rc, CurveEditor::kColor_Background);
|
||||
|
||||
dc.setPen(CurveEditor::kColor_MiddleLines);
|
||||
|
||||
if (m_flags & eFlag_ShowVerticalRuler)
|
||||
{
|
||||
float y = m_domainMinY;
|
||||
float grid = (m_domainMaxY - m_domainMinY) / m_gridSplits.y;
|
||||
QPoint p;
|
||||
|
||||
for (int i = 0; i <= m_gridSplits.y; ++i)
|
||||
{
|
||||
p = ProjectPoint(0, y);
|
||||
dc.drawLine(m_padding, p.y(), rc.width() - m_padding, p.y());
|
||||
|
||||
if (m_flags & eFlag_ShowVerticalRulerText)
|
||||
{
|
||||
if (m_labelsY.empty())
|
||||
{
|
||||
str.asprintf("%0.2f", y);
|
||||
}
|
||||
else
|
||||
{
|
||||
str = m_labelsY[i];
|
||||
}
|
||||
textSize = fntMetrics.tightBoundingRect(str);
|
||||
dc.drawText(2, p.y(), str);
|
||||
}
|
||||
|
||||
y += grid;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_flags & eFlag_ShowHorizontalRuler)
|
||||
{
|
||||
float x = m_domainMinX;
|
||||
float grid = (m_domainMaxX - m_domainMinX) / m_gridSplits.x;
|
||||
QPoint p;
|
||||
|
||||
for (int i = 0; i <= m_gridSplits.x; ++i)
|
||||
{
|
||||
p = ProjectPoint(x, 0);
|
||||
dc.drawLine(p.x(), m_padding, p.x(), rc.height() - m_padding);
|
||||
|
||||
if (m_flags & eFlag_ShowHorizontalRulerText)
|
||||
{
|
||||
if (m_labelsX.empty())
|
||||
{
|
||||
str.asprintf("%0.2f", x);
|
||||
}
|
||||
else
|
||||
{
|
||||
str = m_labelsX[i];
|
||||
}
|
||||
textSize = fntMetrics.tightBoundingRect(str);
|
||||
|
||||
p.setX(p.x() + 2);
|
||||
|
||||
if (p.x() + textSize.width() > width())
|
||||
{
|
||||
p.setX(width() - textSize.width());
|
||||
}
|
||||
|
||||
dc.drawText(p.x(), height() - m_padding + textSize.height() + 2, str);
|
||||
}
|
||||
|
||||
x += grid;
|
||||
}
|
||||
}
|
||||
|
||||
dc.setPen(CurveEditor::kColor_MarkLines);
|
||||
|
||||
if (m_flags & eFlag_ShowVerticalRuler)
|
||||
{
|
||||
QPoint p;
|
||||
for (size_t i = 0; i < m_marksY.size(); ++i)
|
||||
{
|
||||
float v = m_marksY[i];
|
||||
if (v < m_domainMinY || v > m_domainMaxY)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
p = ProjectPoint(0, v);
|
||||
dc.drawLine(m_padding, p.y(), width() - m_padding, p.y());
|
||||
}
|
||||
}
|
||||
|
||||
if (m_flags & eFlag_ShowHorizontalRuler)
|
||||
{
|
||||
QPoint p;
|
||||
for (size_t i = 0; i < m_marksX.size(); ++i)
|
||||
{
|
||||
float v = m_marksX[i];
|
||||
if (v < m_domainMinX || v > m_domainMaxX)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
p = ProjectPoint(v, 0);
|
||||
dc.drawLine(p.x(), m_padding, p.x(), height() - m_padding);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_flags & eFlag_ShowPaddingBorder)
|
||||
{
|
||||
dc.setPen(CurveEditor::kColor_PaddingBorder);
|
||||
dc.drawRect(m_padding, m_padding, width() - m_padding * 2, height() - m_padding * 2);
|
||||
}
|
||||
|
||||
if (m_bDragging
|
||||
&& !m_selectedIndices.empty()
|
||||
&& (m_flags & eFlag_ShowMovingPointAxis))
|
||||
{
|
||||
const Vec2& crtPos = m_points[m_selectedIndices[0]].pos;
|
||||
|
||||
dc.setBrush(CurveEditor::kColor_TextCrtPos);
|
||||
str.asprintf("(%0.2f,%0.2f)", crtPos.x, crtPos.y);
|
||||
textSize = fntMetrics.tightBoundingRect(str);
|
||||
const int kOffsetFromPointer = 5;
|
||||
QPoint txtPos(m_lastMousePoint.x() + kOffsetFromPointer, m_lastMousePoint.y() + kOffsetFromPointer);
|
||||
|
||||
if (txtPos.x() + textSize.width() > width())
|
||||
{
|
||||
txtPos.setX(width() - textSize.width());
|
||||
}
|
||||
|
||||
if (txtPos.y() + textSize.height() > height())
|
||||
{
|
||||
txtPos.setY(height() - textSize.height());
|
||||
}
|
||||
|
||||
dc.drawText(txtPos, str);
|
||||
}
|
||||
|
||||
ComputeTangents();
|
||||
UpdateProjectedPoints();
|
||||
|
||||
// for curve debug, tangents poly, don't delete
|
||||
// dc.setPen(Qt::black);
|
||||
// dc.drawPolyline(m_projectedPoints.data(), m_projectedPoints.size());
|
||||
|
||||
dc.setPen(CurveEditor::kColor_Curve);
|
||||
|
||||
// curve
|
||||
QPainterPath bezierPath;
|
||||
bezierPath.moveTo(m_projectedPoints[0]);
|
||||
for (int i = 1; i < m_projectedPoints.size(); i += 3)
|
||||
{
|
||||
bezierPath.cubicTo(m_projectedPoints[i], m_projectedPoints[i + 1], m_projectedPoints[i + 2]);
|
||||
}
|
||||
dc.drawPath(bezierPath);
|
||||
|
||||
// curve control point handles
|
||||
if (m_flags & eFlag_ShowPointHandles)
|
||||
{
|
||||
for (size_t i = 0; i < m_points.size(); ++i)
|
||||
{
|
||||
QPoint ptProj = ProjectPoint(m_points[i].pos.x, m_points[i].pos.y);
|
||||
QRect rcHandle(0, 0, CurveEditor::kHandleSize, CurveEditor::kHandleSize);
|
||||
rcHandle.moveCenter(ptProj);
|
||||
|
||||
std::vector<int>::iterator iter =
|
||||
std::find(m_selectedIndices.begin(), m_selectedIndices.end(), i);
|
||||
|
||||
bool bSelected = (iter != m_selectedIndices.end());
|
||||
|
||||
if (bSelected && m_bDragging)
|
||||
{
|
||||
dc.setPen(m_selCrossPen);
|
||||
dc.drawLine(0, ptProj.y(), width(), ptProj.y());
|
||||
dc.drawLine(ptProj.x(), 0, ptProj.x(), height());
|
||||
}
|
||||
|
||||
dc.fillRect(rcHandle, bSelected
|
||||
? CurveEditor::kColor_SelHandle
|
||||
: CurveEditor::kColor_NormalHandle);
|
||||
|
||||
dc.setPen(CurveEditor::kColor_HandleLight);
|
||||
dc.drawLine(ptProj.x() - CurveEditor::kHandleSizeHalf, ptProj.y() - CurveEditor::kHandleSizeHalf,
|
||||
ptProj.x() - CurveEditor::kHandleSizeHalf, ptProj.y() + CurveEditor::kHandleSizeHalf);
|
||||
dc.drawLine(ptProj.x() - CurveEditor::kHandleSizeHalf, ptProj.y() + CurveEditor::kHandleSizeHalf,
|
||||
ptProj.x() + CurveEditor::kHandleSizeHalf, ptProj.y() + CurveEditor::kHandleSizeHalf);
|
||||
dc.setPen(CurveEditor::kColor_HandleShadow);
|
||||
dc.drawLine(ptProj.x() + CurveEditor::kHandleSizeHalf, ptProj.y() + CurveEditor::kHandleSizeHalf,
|
||||
ptProj.x() + CurveEditor::kHandleSizeHalf, ptProj.y() - CurveEditor::kHandleSizeHalf);
|
||||
dc.drawLine(ptProj.x() + CurveEditor::kHandleSizeHalf, ptProj.y() - CurveEditor::kHandleSizeHalf,
|
||||
ptProj.x() - CurveEditor::kHandleSizeHalf, ptProj.y() - CurveEditor::kHandleSizeHalf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CCurveEditorCtrl::ComputeTangents()
|
||||
{
|
||||
for (size_t i = 0; i < m_points.size(); ++i)
|
||||
{
|
||||
m_points[i].tanA = m_points[i].pos;
|
||||
m_points[i].tanB = m_points[i].pos;
|
||||
}
|
||||
|
||||
int maxIndex = m_points.size() - 1;
|
||||
|
||||
for (size_t i = 0; i < m_points.size(); ++i)
|
||||
{
|
||||
if (i > maxIndex)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
Vec2& p2 = m_points[i].pos;
|
||||
Vec2& back = m_points[i].tanA;
|
||||
Vec2& forw = m_points[i].tanB;
|
||||
const float kEpsilon = 0.000001f;
|
||||
|
||||
// first point
|
||||
if (i == 0)
|
||||
{
|
||||
back = p2;
|
||||
|
||||
if (maxIndex == 1)
|
||||
{
|
||||
Vec2& p3 = m_points[i + 1].pos;
|
||||
forw = p2 + (p3 - p2) / 3.0f;
|
||||
}
|
||||
else if (maxIndex > 0)
|
||||
{
|
||||
Vec2& p3 = m_points[i + 1].pos;
|
||||
Vec2& pb3 = m_points[i + 1].tanA;
|
||||
|
||||
float lenOsn = (pb3 - p2).GetLength();
|
||||
float lenb = (p3 - p2).GetLength();
|
||||
|
||||
if (lenOsn > kEpsilon && lenb > kEpsilon)
|
||||
{
|
||||
forw = p2 + (pb3 - p2) / (lenOsn / lenb * 3.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
forw = p2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (i == maxIndex)
|
||||
{
|
||||
forw = p2;
|
||||
|
||||
if (i > 0)
|
||||
{
|
||||
Vec2& p1 = m_points[i - 1].pos;
|
||||
Vec2& pf1 = m_points[i - 1].tanB;
|
||||
|
||||
float lenOsn = (pf1 - p2).GetLength();
|
||||
float lenf = (p1 - p2).GetLength();
|
||||
|
||||
if (lenOsn > kEpsilon && lenf > kEpsilon)
|
||||
{
|
||||
back = p2 + (pf1 - p2) / (lenOsn / lenf * 3.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
back = p2;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (i >= 1 && i <= maxIndex - 1)
|
||||
{
|
||||
Vec2& p1 = m_points[i - 1].pos;
|
||||
Vec2& p3 = m_points[i + 1].pos;
|
||||
|
||||
float lenOsn = (p3 - p1).GetLength();
|
||||
float lenb = (p1 - p2).GetLength();
|
||||
float lenf = (p3 - p2).GetLength();
|
||||
|
||||
if (lenOsn > kEpsilon
|
||||
&& lenf > kEpsilon
|
||||
&& lenb > kEpsilon)
|
||||
{
|
||||
back = p2 + (p1 - p3) * (lenb / lenOsn / 3.0f);
|
||||
forw = p2 + (p3 - p1) * (lenf / lenOsn / 3.0f);
|
||||
}
|
||||
}
|
||||
|
||||
ClampToDomain(back);
|
||||
ClampToDomain(forw);
|
||||
}
|
||||
|
||||
// fix tangents in relation of one to another
|
||||
for (size_t i = 0; i < m_points.size(); ++i)
|
||||
{
|
||||
Vec2& p = m_points[i].pos;
|
||||
Vec2& tanA = m_points[i].tanA;
|
||||
Vec2& tanB = m_points[i].tanB;
|
||||
|
||||
if (i < m_points.size() - 1)
|
||||
{
|
||||
if (tanB.x > m_points[i + 1].tanA.x)
|
||||
{
|
||||
tanB.x = (m_points[i + 1].pos.x + p.x) * 0.5f;
|
||||
}
|
||||
}
|
||||
if (i > 0)
|
||||
{
|
||||
if (tanA.x < m_points[i - 1].tanB.x)
|
||||
{
|
||||
tanA.x = (m_points[i - 1].pos.x + p.x) * 0.5f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CCurveEditorCtrl::UpdateProjectedPoints()
|
||||
{
|
||||
m_projectedPoints.resize(m_points.size() * 3 - 2);
|
||||
|
||||
int numPts = 0;
|
||||
|
||||
for (size_t i = 0; i < m_points.size(); ++i)
|
||||
{
|
||||
if (i == 0)
|
||||
{
|
||||
m_projectedPoints[numPts++] = ProjectPoint(m_points[i].pos.x, m_points[i].pos.y);
|
||||
m_projectedPoints[numPts++] = ProjectPoint(m_points[i].tanB.x, m_points[i].tanB.y);
|
||||
}
|
||||
else if (i == m_points.size() - 1)
|
||||
{
|
||||
m_projectedPoints[numPts++] = ProjectPoint(m_points[i].tanA.x, m_points[i].tanA.y);
|
||||
m_projectedPoints[numPts++] = ProjectPoint(m_points[i].pos.x, m_points[i].pos.y);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_projectedPoints[numPts++] = ProjectPoint(m_points[i].tanA.x, m_points[i].tanA.y);
|
||||
m_projectedPoints[numPts++] = ProjectPoint(m_points[i].pos.x, m_points[i].pos.y);
|
||||
m_projectedPoints[numPts++] = ProjectPoint(m_points[i].tanB.x, m_points[i].tanB.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CCurveEditorCtrl::ClampToDomain(Vec2& rVec)
|
||||
{
|
||||
if (rVec.x < m_domainMinX)
|
||||
{
|
||||
rVec.x = m_domainMinX;
|
||||
}
|
||||
else if (rVec.x > m_domainMaxX)
|
||||
{
|
||||
rVec.x = m_domainMaxX;
|
||||
}
|
||||
|
||||
if (rVec.y < m_domainMinY)
|
||||
{
|
||||
rVec.y = m_domainMinY;
|
||||
}
|
||||
else if (rVec.y > m_domainMaxY)
|
||||
{
|
||||
rVec.y = m_domainMaxY;
|
||||
}
|
||||
}
|
||||
|
||||
void CCurveEditorCtrl::GenerateDefaultCurve()
|
||||
{
|
||||
m_points.clear();
|
||||
m_domainMinX = 0.0f;
|
||||
m_domainMinY = 0.0f;
|
||||
m_domainMaxX = 1.0f;
|
||||
m_domainMaxY = 1.0f;
|
||||
m_points.push_back(CurvePoint(0.00f, 0.00f));
|
||||
m_points.push_back(CurvePoint(0.25f, 0.25f));
|
||||
m_points.push_back(CurvePoint(0.50f, 0.50f));
|
||||
m_points.push_back(CurvePoint(0.75f, 0.75f));
|
||||
m_points.push_back(CurvePoint(1.00f, 1.00f));
|
||||
}
|
||||
|
||||
void CCurveEditorCtrl::mousePressEvent(QMouseEvent* event)
|
||||
{
|
||||
QWidget::mousePressEvent(event);
|
||||
if (event->button() != Qt::LeftButton)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const QPoint point = event->pos();
|
||||
if (m_bAllowMouse)
|
||||
{
|
||||
bool bSimpleSelect = !(event->modifiers() & Qt::ShiftModifier) && !(event->modifiers() & Qt::ControlModifier);
|
||||
|
||||
if (bSimpleSelect)
|
||||
{
|
||||
m_selectedIndices.clear();
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < m_points.size(); ++i)
|
||||
{
|
||||
QPoint ptProj = ProjectPoint(m_points[i].pos.x, m_points[i].pos.y);
|
||||
|
||||
QRect rcHandle(0, 0, CurveEditor::kHandleSize, CurveEditor::kHandleSize);
|
||||
rcHandle.moveCenter(ptProj);
|
||||
|
||||
if (rcHandle.contains(point))
|
||||
{
|
||||
if (bSimpleSelect)
|
||||
{
|
||||
m_selectedIndices.push_back(i);
|
||||
break;
|
||||
}
|
||||
|
||||
if (event->modifiers() & Qt::ShiftModifier)
|
||||
{
|
||||
m_selectedIndices.push_back(i);
|
||||
}
|
||||
else if (event->modifiers() & Qt::ControlModifier)
|
||||
{
|
||||
std::vector<int>::iterator iter =
|
||||
std::find(m_selectedIndices.begin(), m_selectedIndices.end(), i);
|
||||
|
||||
if (iter == m_selectedIndices.end())
|
||||
{
|
||||
m_selectedIndices.push_back(i);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_selectedIndices.erase(iter);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_bMouseDown = true;
|
||||
m_lastMousePoint = point;
|
||||
}
|
||||
|
||||
grabMouse();
|
||||
update();
|
||||
}
|
||||
|
||||
void CCurveEditorCtrl::mouseReleaseEvent(QMouseEvent* event)
|
||||
{
|
||||
QWidget::mouseReleaseEvent(event);
|
||||
if (event->button() != Qt::LeftButton)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_bMouseDown = false;
|
||||
m_bDragging = false;
|
||||
m_selectedIndices.clear();
|
||||
|
||||
releaseMouse();
|
||||
update();
|
||||
}
|
||||
|
||||
void CCurveEditorCtrl::mouseMoveEvent(QMouseEvent* event)
|
||||
{
|
||||
if (m_bMouseDown && !m_bDragging)
|
||||
{
|
||||
m_bDragging = true;
|
||||
}
|
||||
|
||||
m_bHovered = true;
|
||||
if (m_flags & eFlag_ShowCursorAlways)
|
||||
{
|
||||
m_bHovered = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_bHovered = false;
|
||||
|
||||
for (size_t i = 0; i < m_points.size(); ++i)
|
||||
{
|
||||
QPoint ptProj = ProjectPoint(m_points[i].pos.x, m_points[i].pos.y);
|
||||
QRect rcHandle(0, 0, CurveEditor::kHandleSize, CurveEditor::kHandleSize);
|
||||
rcHandle.moveCenter(ptProj);
|
||||
|
||||
if (rcHandle.contains(event->pos()))
|
||||
{
|
||||
m_bHovered = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_bDragging)
|
||||
{
|
||||
Vec2 v1 = UnprojectPoint(m_lastMousePoint);
|
||||
Vec2 v2 = UnprojectPoint(event->pos());
|
||||
Vec2 v = v1 - v2;
|
||||
|
||||
for (size_t i = 0; i < m_selectedIndices.size(); ++i)
|
||||
{
|
||||
int index = m_selectedIndices[i];
|
||||
CurvePoint& cpt = m_points[index];
|
||||
|
||||
// do not move first and last points on X
|
||||
if (index > 0 && index < m_points.size() - 1)
|
||||
{
|
||||
cpt.pos.x -= v.x;
|
||||
}
|
||||
|
||||
cpt.pos.y -= v.y;
|
||||
|
||||
// lets check if the point is overlapping its neighbours
|
||||
if (index > 0 && (index - 1) > 0)
|
||||
{
|
||||
if (cpt.pos.x < m_points[index - 1].pos.x)
|
||||
{
|
||||
CurvePoint p = m_points[index];
|
||||
|
||||
// swap!
|
||||
m_points[index] = m_points[index - 1];
|
||||
m_points[index - 1] = p;
|
||||
m_selectedIndices[i] = index - 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (index < m_points.size() - 1 && (index + 1) < m_points.size() - 1)
|
||||
{
|
||||
if (cpt.pos.x > m_points[index + 1].pos.x)
|
||||
{
|
||||
CurvePoint p = m_points[index];
|
||||
|
||||
// swap!
|
||||
m_points[index] = m_points[index + 1];
|
||||
m_points[index + 1] = p;
|
||||
m_selectedIndices[i] = index + 1;
|
||||
}
|
||||
}
|
||||
|
||||
ClampToDomain(cpt.pos);
|
||||
}
|
||||
|
||||
update();
|
||||
m_lastMousePoint = event->pos();
|
||||
}
|
||||
|
||||
QWidget::mouseMoveEvent(event);
|
||||
}
|
||||
|
||||
void CCurveEditorCtrl::MarkX(float value)
|
||||
{
|
||||
m_marksX.push_back(value);
|
||||
}
|
||||
|
||||
void CCurveEditorCtrl::MarkY(float value)
|
||||
{
|
||||
m_marksY.push_back(value);
|
||||
}
|
||||
@@ -1,112 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#ifndef CRYINCLUDE_EDITOR_CONTROLS_CURVEEDITORCTRL_H
|
||||
#define CRYINCLUDE_EDITOR_CONTROLS_CURVEEDITORCTRL_H
|
||||
#pragma once
|
||||
#include "Util/GdiUtil.h"
|
||||
#include <QWidget>
|
||||
#include <QPen>
|
||||
|
||||
|
||||
class CCurveEditorCtrl
|
||||
: public QWidget
|
||||
{
|
||||
public:
|
||||
enum EFlags
|
||||
{
|
||||
eFlag_ShowVerticalRuler = (1 << 0),
|
||||
eFlag_ShowHorizontalRuler = (1 << 1),
|
||||
eFlag_ShowVerticalRulerText = (1 << 2),
|
||||
eFlag_ShowHorizontalRulerText = (1 << 3),
|
||||
eFlag_ShowPaddingBorder = (1 << 4),
|
||||
eFlag_ShowMovingPointAxis = (1 << 5),
|
||||
eFlag_ShowPointHandles = (1 << 6),
|
||||
eFlag_ShowCursorAlways = (1 << 7),
|
||||
eFlag_Disabled = (1 << 8) // special case, when disabling preview window.
|
||||
};
|
||||
|
||||
CCurveEditorCtrl(QWidget* parent);
|
||||
virtual ~CCurveEditorCtrl();
|
||||
|
||||
void SetFlags(UINT aFlags);
|
||||
UINT GetFlags() const;
|
||||
void SetMouseEnable(bool bEnable = true) { m_bAllowMouse = bEnable; }
|
||||
bool GetMouseEnable() const {return m_bAllowMouse; }
|
||||
bool SetDomainBounds(float aMinX, float aMinY, float aMaxX, float aMaxY);
|
||||
void GetDomainBounds(float& rMinX, float& rMinY, float& rMaxX, float& rMaxY) const;
|
||||
// labelsX/labelsY must be null (to use default labels)
|
||||
// or contain aHorizontalSplits+1/aVerticalSplits+1 items.
|
||||
void SetGrid(UINT aHorizontalSplits, UINT aVerticalSplits, const QStringList& labelsX = QStringList(), const QStringList& labelsY = QStringList());
|
||||
void SetPadding(float padding) { m_padding = padding; }
|
||||
void MarkX(float value);
|
||||
void MarkY(float value);
|
||||
void AddControlPoint(const Vec2& rPosition);
|
||||
void ClearControlPoints();
|
||||
void SetControlPointCount(UINT aCount);
|
||||
UINT GetControlPointCount() const;
|
||||
void SetControlPoint(UINT aIndex, const Vec2& rPosition);
|
||||
void SetControlPointTangents(UINT aIndex, const Vec2& rLeft, const Vec2& rRight);
|
||||
void GetControlPoint(UINT aIndex, Vec2& rOutPosition) const;
|
||||
void GetControlPointTangents(UINT aIndex, Vec2& rOutLeft, Vec2& rOutRight) const;
|
||||
QPoint ProjectPoint(float x, float y);
|
||||
Vec2 UnprojectPoint(const QPoint& pt);
|
||||
void UpdateProjectedPoints();
|
||||
|
||||
protected:
|
||||
struct CurvePoint
|
||||
{
|
||||
CurvePoint(float aX = 0.0f, float aY = 0.0f)
|
||||
{
|
||||
pos.x = aX;
|
||||
pos.y = aY;
|
||||
}
|
||||
|
||||
Vec2 pos;
|
||||
Vec2 tanA, tanB;
|
||||
};
|
||||
|
||||
void ComputeTangents();
|
||||
void ClampToDomain(Vec2& rVec);
|
||||
void GenerateDefaultCurve();
|
||||
|
||||
void paintEvent(QPaintEvent* event) override;
|
||||
|
||||
std::vector<CurvePoint> m_points;
|
||||
std::vector<QPoint> m_projectedPoints;
|
||||
float m_domainMinX;
|
||||
float m_domainMinY;
|
||||
float m_domainMaxX;
|
||||
float m_domainMaxY;
|
||||
Vec2 m_gridSplits;
|
||||
int m_padding;
|
||||
bool m_bMouseDown, m_bDragging, m_bAllowMouse;
|
||||
bool m_bHovered;
|
||||
QPoint m_lastMousePoint;
|
||||
std::vector<int> m_selectedIndices;
|
||||
QFont m_fntInfo;
|
||||
QPen m_pen, m_selCrossPen;
|
||||
UINT m_flags;
|
||||
QStringList m_labelsX;
|
||||
QStringList m_labelsY;
|
||||
std::vector<float> m_marksX;
|
||||
std::vector<float> m_marksY;
|
||||
|
||||
void mousePressEvent(QMouseEvent* event) override;
|
||||
void mouseReleaseEvent(QMouseEvent* event) override;
|
||||
void mouseMoveEvent(QMouseEvent* event) override;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // CRYINCLUDE_EDITOR_CONTROLS_CURVEEDITORCTRL_H
|
||||
@@ -659,9 +659,6 @@ CBaseObject* EditorViewportWidget::GetCameraObject() const
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void EditorViewportWidget::OnEditorNotifyEvent(EEditorNotifyEvent event)
|
||||
{
|
||||
static ICVar* outputToHMD = gEnv->pConsole->GetCVar("output_to_hmd");
|
||||
AZ_Assert(outputToHMD, "cvar output_to_hmd is undeclared");
|
||||
|
||||
switch (event)
|
||||
{
|
||||
case eNotify_OnBeginGameMode:
|
||||
@@ -683,7 +680,6 @@ void EditorViewportWidget::OnEditorNotifyEvent(EEditorNotifyEvent event)
|
||||
if (deviceInfo)
|
||||
{
|
||||
// Note: This may also need to adjust the viewport size
|
||||
outputToHMD->Set(1);
|
||||
SetActiveWindow();
|
||||
SetFocus();
|
||||
SetSelected(true);
|
||||
@@ -703,10 +699,6 @@ void EditorViewportWidget::OnEditorNotifyEvent(EEditorNotifyEvent event)
|
||||
if (GetIEditor()->GetViewManager()->GetGameViewport() == this)
|
||||
{
|
||||
SetCurrentCursor(STD_CURSOR_DEFAULT);
|
||||
if (gSettings.bEnableGameModeVR)
|
||||
{
|
||||
outputToHMD->Set(0);
|
||||
}
|
||||
m_bInRotateMode = false;
|
||||
m_bInMoveMode = false;
|
||||
m_bInOrbitMode = false;
|
||||
|
||||
@@ -71,7 +71,6 @@ AZ_POP_DISABLE_WARNING
|
||||
#include "EditorFileMonitor.h"
|
||||
#include "MainStatusBar.h"
|
||||
|
||||
#include "SettingsBlock.h"
|
||||
#include "ResourceSelectorHost.h"
|
||||
#include "Util/FileUtil_impl.h"
|
||||
#include "Util/ImageUtil_impl.h"
|
||||
@@ -1624,8 +1623,6 @@ ESystemConfigPlatform CEditorImpl::GetEditorConfigPlatform() const
|
||||
|
||||
void CEditorImpl::InitFinished()
|
||||
{
|
||||
SProjectSettingsBlock::Load();
|
||||
|
||||
if (!m_bInitialized)
|
||||
{
|
||||
m_bInitialized = true;
|
||||
|
||||
@@ -28,16 +28,6 @@
|
||||
// }
|
||||
// REGISTER_RESOURCE_SELECTOR("Sound", SoundFileSelector, "Icons/sound_16x16.png")
|
||||
//
|
||||
// To expose it to serialization:
|
||||
//
|
||||
// #include "Serialization/Decorators/Resources.h"
|
||||
// template<class TString>
|
||||
// ResourceSelector<TString> SoundName(TString& s) { return ResourceSelector<TString>(s, "Sound"); }
|
||||
//
|
||||
// To use in serialization:
|
||||
//
|
||||
// ar(Serialization::SoundName(soundString), "soundString", "Sound String");
|
||||
//
|
||||
// Here is how it can be invoked directly:
|
||||
//
|
||||
// SResourceSelectorContext x;
|
||||
@@ -56,19 +46,7 @@
|
||||
//
|
||||
// QString SoundFileSelector(const SResourceSelectorContext& x, const QString& previousValue,
|
||||
// SoundFileList* list) // your context argument
|
||||
//
|
||||
// And provide this value through serialization context:
|
||||
//
|
||||
// struct SourceFileList
|
||||
// {
|
||||
// void Serialize(IArchive& ar)
|
||||
// {
|
||||
// Serialization::SContext<SourceFileList> context(ar, this);
|
||||
// ...
|
||||
// }
|
||||
// }
|
||||
|
||||
#include <Serialization/TypeID.h>
|
||||
#include <QString>
|
||||
|
||||
class QWidget;
|
||||
@@ -82,7 +60,6 @@ struct SResourceSelectorContext
|
||||
|
||||
unsigned int entityId;
|
||||
void* contextObject;
|
||||
Serialization::TypeID contextObjectType;
|
||||
|
||||
SResourceSelectorContext()
|
||||
: parentWidget(0)
|
||||
@@ -107,7 +84,6 @@ struct IResourceSelectorHost
|
||||
virtual ~IResourceSelectorHost() = default;
|
||||
virtual QString SelectResource(const SResourceSelectorContext& context, const QString& previousValue) = 0;
|
||||
virtual const char* ResourceIconPath(const char* typeName) const = 0;
|
||||
virtual Serialization::TypeID ResourceContextType(const char* typeName) const = 0;
|
||||
|
||||
virtual void RegisterResourceSelector(const SStaticResourceSelectorEntry* entry) = 0;
|
||||
|
||||
@@ -128,7 +104,6 @@ struct SStaticResourceSelectorEntry
|
||||
TResourceSelectionFunction function;
|
||||
TResourceSelectionFunctionWithContext functionWithContext;
|
||||
const char* iconPath;
|
||||
Serialization::TypeID contextType;
|
||||
|
||||
static SStaticResourceSelectorEntry*& GetFirst() { static SStaticResourceSelectorEntry* first; return first; }
|
||||
SStaticResourceSelectorEntry* next;
|
||||
@@ -150,7 +125,6 @@ struct SStaticResourceSelectorEntry
|
||||
, functionWithContext(TResourceSelectionFunctionWithContext(function))
|
||||
, iconPath(icon)
|
||||
{
|
||||
contextType = Serialization::TypeID::get<T>();
|
||||
next = GetFirst();
|
||||
GetFirst() = this;
|
||||
}
|
||||
|
||||
@@ -72,16 +72,6 @@ public:
|
||||
return "";
|
||||
}
|
||||
|
||||
Serialization::TypeID ResourceContextType(const char* typeName) const override
|
||||
{
|
||||
TTypeMap::const_iterator it = m_typeMap.find(typeName);
|
||||
if (it != m_typeMap.end())
|
||||
{
|
||||
return it->second->contextType;
|
||||
}
|
||||
return Serialization::TypeID();
|
||||
}
|
||||
|
||||
void RegisterResourceSelector(const SStaticResourceSelectorEntry* entry) override
|
||||
{
|
||||
m_typeMap[entry->typeName] = entry;
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#pragma once
|
||||
#ifndef CRYINCLUDE_EDITOR_SERIALIZATION_H
|
||||
#define CRYINCLUDE_EDITOR_SERIALIZATION_H
|
||||
|
||||
#include <Serialization/STL.h>
|
||||
#include <Serialization/SmartPtr.h>
|
||||
#include <Serialization/ClassFactory.h>
|
||||
#include <Serialization/IArchive.h>
|
||||
#include <Serialization/Enum.h>
|
||||
|
||||
using Serialization::IArchive;
|
||||
|
||||
#endif // CRYINCLUDE_EDITOR_SERIALIZATION_H
|
||||
@@ -1,283 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#include "EditorDefs.h"
|
||||
|
||||
#include "VariableIArchive.h"
|
||||
|
||||
// Editor
|
||||
#include "Serialization/Decorators/Resources.h"
|
||||
#include "Serialization/Decorators/Range.h"
|
||||
|
||||
|
||||
using Serialization::CVariableIArchive;
|
||||
|
||||
namespace VarUtil
|
||||
{
|
||||
_smart_ptr< IVariable > FindChildVariable(const _smart_ptr< IVariable >& pParent, const int childIndexOverride, const char* const name)
|
||||
{
|
||||
if (0 <= childIndexOverride)
|
||||
{
|
||||
return pParent->GetVariable(childIndexOverride);
|
||||
}
|
||||
else
|
||||
{
|
||||
const bool shouldSearchRecursively = false;
|
||||
return pParent->FindVariable(name, shouldSearchRecursively);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template< typename T, typename TOut >
|
||||
bool ReadChildVariableAs(const _smart_ptr< IVariable >& pParent, const int childIndexOverride, const char* const name, TOut& valueOut)
|
||||
{
|
||||
_smart_ptr< IVariable > pVariable = FindChildVariable(pParent, childIndexOverride, name);
|
||||
if (pVariable)
|
||||
{
|
||||
T tmp;
|
||||
pVariable->Get(tmp);
|
||||
valueOut = static_cast< TOut >(tmp);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
template< typename T >
|
||||
bool ReadChildVariable(const _smart_ptr< IVariable >& pParent, const int childIndexOverride, const char* const name, T& valueOut)
|
||||
{
|
||||
return ReadChildVariableAs< T >(pParent, childIndexOverride, name, valueOut);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
CVariableIArchive::CVariableIArchive(const _smart_ptr< IVariable >& pVariable)
|
||||
: IArchive(IArchive::INPUT | IArchive::EDIT | IArchive::NO_EMPTY_NAMES)
|
||||
, m_pVariable(pVariable)
|
||||
, m_childIndexOverride(-1)
|
||||
{
|
||||
CRY_ASSERT(m_pVariable);
|
||||
|
||||
m_structHandlers[ TypeID::get < Serialization::IResourceSelector > ().name() ] = &CVariableIArchive::SerializeResourceSelector;
|
||||
m_structHandlers[ TypeID::get < Serialization::RangeDecorator < float >> ().name() ] = &CVariableIArchive::SerializeRangeFloat;
|
||||
m_structHandlers[ TypeID::get < Serialization::RangeDecorator < int >> ().name() ] = &CVariableIArchive::SerializeRangeInt;
|
||||
m_structHandlers[ TypeID::get < Serialization::RangeDecorator < unsigned int >> ().name() ] = &CVariableIArchive::SerializeRangeUInt;
|
||||
m_structHandlers[ TypeID::get < StringListStaticValue > ().name() ] = &CVariableIArchive::SerializeStringListStaticValue;
|
||||
}
|
||||
|
||||
|
||||
CVariableIArchive::~CVariableIArchive()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool CVariableIArchive::operator()(bool& value, const char* name, [[maybe_unused]] const char* label)
|
||||
{
|
||||
return VarUtil::ReadChildVariableAs< bool >(m_pVariable, m_childIndexOverride, name, value);
|
||||
}
|
||||
|
||||
|
||||
bool CVariableIArchive::operator()(Serialization::IString& value, const char* name, [[maybe_unused]] const char* label)
|
||||
{
|
||||
QString stringValue;
|
||||
const bool readSuccess = VarUtil::ReadChildVariableAs< QString >(m_pVariable, m_childIndexOverride, name, stringValue);
|
||||
if (readSuccess)
|
||||
{
|
||||
value.set(stringValue.toUtf8().data());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool CVariableIArchive::operator()([[maybe_unused]] Serialization::IWString& value, [[maybe_unused]] const char* name, [[maybe_unused]] const char* label)
|
||||
{
|
||||
CryFatalError("CVariableIArchive::operator() with IWString is not implemented");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool CVariableIArchive::operator()(float& value, const char* name, [[maybe_unused]] const char* label)
|
||||
{
|
||||
return VarUtil::ReadChildVariableAs< float >(m_pVariable, m_childIndexOverride, name, value);
|
||||
}
|
||||
|
||||
|
||||
bool CVariableIArchive::operator()(double& value, const char* name, [[maybe_unused]] const char* label)
|
||||
{
|
||||
return VarUtil::ReadChildVariableAs< float >(m_pVariable, m_childIndexOverride, name, value);
|
||||
}
|
||||
|
||||
|
||||
bool CVariableIArchive::operator()(int16& value, const char* name, [[maybe_unused]] const char* label)
|
||||
{
|
||||
return VarUtil::ReadChildVariableAs< int >(m_pVariable, m_childIndexOverride, name, value);
|
||||
}
|
||||
|
||||
|
||||
bool CVariableIArchive::operator()(uint16& value, const char* name, [[maybe_unused]] const char* label)
|
||||
{
|
||||
return VarUtil::ReadChildVariableAs< int >(m_pVariable, m_childIndexOverride, name, value);
|
||||
}
|
||||
|
||||
|
||||
bool CVariableIArchive::operator()(int32& value, const char* name, [[maybe_unused]] const char* label)
|
||||
{
|
||||
return VarUtil::ReadChildVariableAs< int >(m_pVariable, m_childIndexOverride, name, value);
|
||||
}
|
||||
|
||||
|
||||
bool CVariableIArchive::operator()(uint32& value, const char* name, [[maybe_unused]] const char* label)
|
||||
{
|
||||
return VarUtil::ReadChildVariableAs< int >(m_pVariable, m_childIndexOverride, name, value);
|
||||
}
|
||||
|
||||
|
||||
bool CVariableIArchive::operator()(int64& value, const char* name, [[maybe_unused]] const char* label)
|
||||
{
|
||||
return VarUtil::ReadChildVariableAs< int >(m_pVariable, m_childIndexOverride, name, value);
|
||||
}
|
||||
|
||||
|
||||
bool CVariableIArchive::operator()(uint64& value, const char* name, [[maybe_unused]] const char* label)
|
||||
{
|
||||
return VarUtil::ReadChildVariableAs< int >(m_pVariable, m_childIndexOverride, name, value);
|
||||
}
|
||||
|
||||
|
||||
bool CVariableIArchive::operator()(int8& value, const char* name, [[maybe_unused]] const char* label)
|
||||
{
|
||||
return VarUtil::ReadChildVariableAs< int >(m_pVariable, m_childIndexOverride, name, value);
|
||||
}
|
||||
|
||||
|
||||
bool CVariableIArchive::operator()(uint8& value, const char* name, [[maybe_unused]] const char* label)
|
||||
{
|
||||
return VarUtil::ReadChildVariableAs< int >(m_pVariable, m_childIndexOverride, name, value);
|
||||
}
|
||||
|
||||
|
||||
bool CVariableIArchive::operator()(char& value, const char* name, [[maybe_unused]] const char* label)
|
||||
{
|
||||
return VarUtil::ReadChildVariableAs< int >(m_pVariable, m_childIndexOverride, name, value);
|
||||
}
|
||||
|
||||
|
||||
bool CVariableIArchive::operator()(const Serialization::SStruct& ser, const char* name, const char* label)
|
||||
{
|
||||
const char* const typeName = ser.type().name();
|
||||
HandlersMap::const_iterator it = m_structHandlers.find(typeName);
|
||||
const bool handlerFound = (it != m_structHandlers.end());
|
||||
if (handlerFound)
|
||||
{
|
||||
StructHandlerFunctionPtr pHandler = it->second;
|
||||
return (this->*pHandler)(ser, name, label);
|
||||
}
|
||||
|
||||
return SerializeStruct(ser, name, label);
|
||||
}
|
||||
|
||||
|
||||
bool CVariableIArchive::operator()(Serialization::IContainer& ser, const char* name, [[maybe_unused]] const char* label)
|
||||
{
|
||||
_smart_ptr< IVariable > pChild = VarUtil::FindChildVariable(m_pVariable, m_childIndexOverride, name);
|
||||
if (pChild)
|
||||
{
|
||||
const int elementCount = pChild->GetNumVariables();
|
||||
ser.resize(elementCount);
|
||||
|
||||
if (0 < elementCount)
|
||||
{
|
||||
CVariableIArchive childArchive(pChild);
|
||||
childArchive.SetFilter(GetFilter());
|
||||
childArchive.SetInnerContext(GetInnerContext());
|
||||
|
||||
for (int i = 0; i < elementCount; ++i)
|
||||
{
|
||||
childArchive.m_childIndexOverride = i;
|
||||
|
||||
ser(childArchive, "", "");
|
||||
ser.next();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool CVariableIArchive::SerializeStruct(const Serialization::SStruct& ser, const char* name, [[maybe_unused]] const char* label)
|
||||
{
|
||||
_smart_ptr< IVariable > pChild = VarUtil::FindChildVariable(m_pVariable, m_childIndexOverride, name);
|
||||
if (pChild)
|
||||
{
|
||||
CVariableIArchive childArchive(pChild);
|
||||
childArchive.SetFilter(GetFilter());
|
||||
childArchive.SetInnerContext(GetInnerContext());
|
||||
|
||||
ser(childArchive);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CVariableIArchive::SerializeResourceSelector(const Serialization::SStruct& ser, const char* name, [[maybe_unused]] const char* label)
|
||||
{
|
||||
Serialization::IResourceSelector* pSelector = reinterpret_cast< Serialization::IResourceSelector* >(ser.pointer());
|
||||
|
||||
QString stringValue;
|
||||
const bool readSuccess = VarUtil::ReadChildVariableAs< QString >(m_pVariable, m_childIndexOverride, name, stringValue);
|
||||
if (readSuccess)
|
||||
{
|
||||
pSelector->SetValue(stringValue.toUtf8().data());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool CVariableIArchive::SerializeStringListStaticValue(const Serialization::SStruct& ser, const char* name, [[maybe_unused]] const char* label)
|
||||
{
|
||||
StringListStaticValue* const pStringListStaticValue = reinterpret_cast< StringListStaticValue* >(ser.pointer());
|
||||
|
||||
_smart_ptr< IVariable > pChild = VarUtil::FindChildVariable(m_pVariable, m_childIndexOverride, name);
|
||||
if (pChild)
|
||||
{
|
||||
int index = -1;
|
||||
pChild->Get(index);
|
||||
*pStringListStaticValue = index;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool CVariableIArchive::SerializeRangeFloat(const Serialization::SStruct& ser, const char* name, [[maybe_unused]] const char* label)
|
||||
{
|
||||
const Serialization::RangeDecorator< float >* const pRange = reinterpret_cast< Serialization::RangeDecorator< float >* >(ser.pointer());
|
||||
return VarUtil::ReadChildVariableAs< float >(m_pVariable, m_childIndexOverride, name, *pRange->value);
|
||||
}
|
||||
|
||||
|
||||
bool CVariableIArchive::SerializeRangeInt(const Serialization::SStruct& ser, const char* name, [[maybe_unused]] const char* label)
|
||||
{
|
||||
const Serialization::RangeDecorator< int >* const pRange = reinterpret_cast< Serialization::RangeDecorator< int >* >(ser.pointer());
|
||||
return VarUtil::ReadChildVariableAs< int >(m_pVariable, m_childIndexOverride, name, *pRange->value);
|
||||
}
|
||||
|
||||
bool CVariableIArchive::SerializeRangeUInt(const Serialization::SStruct& ser, const char* name, [[maybe_unused]] const char* label)
|
||||
{
|
||||
const Serialization::RangeDecorator< unsigned int >* const pRange = reinterpret_cast< Serialization::RangeDecorator< unsigned int >* >(ser.pointer());
|
||||
return VarUtil::ReadChildVariableAs< int >(m_pVariable, m_childIndexOverride, name, *pRange->value);
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Util/Variable.h"
|
||||
#include "Serialization.h"
|
||||
|
||||
namespace Serialization
|
||||
{
|
||||
class CVariableIArchive
|
||||
: public IArchive
|
||||
{
|
||||
public:
|
||||
CVariableIArchive(const _smart_ptr< IVariable >& pVariable);
|
||||
virtual ~CVariableIArchive();
|
||||
|
||||
// IArchive
|
||||
virtual bool operator()(bool& value, const char* name = "", const char* label = 0) override;
|
||||
virtual bool operator()(IString& value, const char* name = "", const char* label = 0) override;
|
||||
virtual bool operator()(IWString& value, const char* name = "", const char* label = 0) override;
|
||||
virtual bool operator()(float& value, const char* name = "", const char* label = 0) override;
|
||||
virtual bool operator()(double& value, const char* name = "", const char* label = 0) override;
|
||||
virtual bool operator()(int16& value, const char* name = "", const char* label = 0) override;
|
||||
virtual bool operator()(uint16& value, const char* name = "", const char* label = 0) override;
|
||||
virtual bool operator()(int32& value, const char* name = "", const char* label = 0) override;
|
||||
virtual bool operator()(uint32& value, const char* name = "", const char* label = 0) override;
|
||||
virtual bool operator()(int64& value, const char* name = "", const char* label = 0) override;
|
||||
virtual bool operator()(uint64& value, const char* name = "", const char* label = 0) override;
|
||||
|
||||
virtual bool operator()(int8& value, const char* name = "", const char* label = 0) override;
|
||||
virtual bool operator()(uint8& value, const char* name = "", const char* label = 0) override;
|
||||
virtual bool operator()(char& value, const char* name = "", const char* label = 0);
|
||||
|
||||
virtual bool operator()(const SStruct& ser, const char* name = "", const char* label = 0) override;
|
||||
virtual bool operator()(IContainer& ser, const char* name = "", const char* label = 0) override;
|
||||
//virtual bool operator()( IPointer& ptr, const char* name = "", const char* label = 0 ) override;
|
||||
// ~IArchive
|
||||
|
||||
using IArchive::operator();
|
||||
|
||||
private:
|
||||
bool SerializeResourceSelector(const SStruct& ser, const char* name, const char* label);
|
||||
|
||||
bool SerializeStruct(const SStruct& ser, const char* name, const char* label);
|
||||
|
||||
bool SerializeStringListStaticValue(const SStruct& ser, const char* name, const char* label);
|
||||
|
||||
bool SerializeRangeFloat(const SStruct& ser, const char* name, const char* label);
|
||||
bool SerializeRangeInt(const SStruct& ser, const char* name, const char* label);
|
||||
bool SerializeRangeUInt(const SStruct& ser, const char* name, const char* label);
|
||||
|
||||
private:
|
||||
_smart_ptr< IVariable > m_pVariable;
|
||||
int m_childIndexOverride;
|
||||
|
||||
typedef bool ( CVariableIArchive::* StructHandlerFunctionPtr )(const SStruct&, const char*, const char*);
|
||||
typedef std::map< string, StructHandlerFunctionPtr > HandlersMap;
|
||||
HandlersMap m_structHandlers; // TODO: have only one of these.
|
||||
};
|
||||
}
|
||||
@@ -1,416 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#include "EditorDefs.h"
|
||||
|
||||
#include "VariableOArchive.h"
|
||||
|
||||
// Editor
|
||||
#include "Serialization/Decorators/Resources.h"
|
||||
#include "Serialization/Decorators/Range.h"
|
||||
|
||||
|
||||
using Serialization::CVariableOArchive;
|
||||
|
||||
namespace VarUtil
|
||||
{
|
||||
template< typename T >
|
||||
_smart_ptr< IVariable > AddChildVariable(const _smart_ptr< IVariable >& pVariableArray, const T& value, const char* const name, const char* label)
|
||||
{
|
||||
CRY_ASSERT(pVariableArray);
|
||||
|
||||
_smart_ptr< IVariable > pVariable = new CVariable< T >();
|
||||
pVariable->SetName(name);
|
||||
pVariable->SetHumanName(label);
|
||||
pVariable->Set(value);
|
||||
|
||||
pVariableArray->AddVariable(pVariable);
|
||||
|
||||
return pVariable;
|
||||
}
|
||||
|
||||
template< typename TMin, typename TMax >
|
||||
void SetLimits(const _smart_ptr< IVariable >& pVariable, const TMin minValue, const TMax maxValue)
|
||||
{
|
||||
pVariable->SetLimits(static_cast< float >(minValue), static_cast< float >(maxValue));
|
||||
}
|
||||
}
|
||||
|
||||
CVariableOArchive::CVariableOArchive()
|
||||
: IArchive(IArchive::OUTPUT | IArchive::EDIT | IArchive::NO_EMPTY_NAMES)
|
||||
, m_pVariable(new CVariableArray())
|
||||
{
|
||||
m_resourceHandlers[ "Animation" ] = &CVariableOArchive::SerializeAnimationName;
|
||||
m_resourceHandlers[ "Sound" ] = &CVariableOArchive::SerializeSoundName;
|
||||
m_resourceHandlers[ "Model" ] = &CVariableOArchive::SerializeObjectFilename;
|
||||
|
||||
m_structHandlers[ TypeID::get < Serialization::IResourceSelector > ().name() ] = &CVariableOArchive::SerializeIResourceSelector;
|
||||
m_structHandlers[ TypeID::get < Serialization::RangeDecorator < float >> ().name() ] = &CVariableOArchive::SerializeRangeFloat;
|
||||
m_structHandlers[ TypeID::get < Serialization::RangeDecorator < int >> ().name() ] = &CVariableOArchive::SerializeRangeInt;
|
||||
m_structHandlers[ TypeID::get < Serialization::RangeDecorator < unsigned int >> ().name() ] = &CVariableOArchive::SerializeRangeUInt;
|
||||
m_structHandlers[ TypeID::get < StringListStaticValue > ().name() ] = &CVariableOArchive::SerializeStringListStaticValue;
|
||||
}
|
||||
|
||||
|
||||
CVariableOArchive::~CVariableOArchive()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
_smart_ptr< IVariable > CVariableOArchive::GetIVariable() const
|
||||
{
|
||||
return m_pVariable;
|
||||
}
|
||||
|
||||
|
||||
CVarBlockPtr CVariableOArchive::GetVarBlock() const
|
||||
{
|
||||
CVarBlockPtr pVarBlock = new CVarBlock();
|
||||
pVarBlock->AddVariable(m_pVariable);
|
||||
return pVarBlock;
|
||||
}
|
||||
|
||||
|
||||
bool CVariableOArchive::operator()(bool& value, const char* name, const char* label)
|
||||
{
|
||||
VarUtil::AddChildVariable< bool >(m_pVariable, value, name, label);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool CVariableOArchive::operator()(Serialization::IString& value, const char* name, const char* label)
|
||||
{
|
||||
const QString valueString = value.get();
|
||||
VarUtil::AddChildVariable< QString >(m_pVariable, valueString, name, label);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool CVariableOArchive::operator()([[maybe_unused]] Serialization::IWString& value, [[maybe_unused]] const char* name, [[maybe_unused]] const char* label)
|
||||
{
|
||||
CryFatalError("CVarBlockOArchive::operator() with IWString is not implemented");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool CVariableOArchive::operator()(float& value, const char* name, const char* label)
|
||||
{
|
||||
VarUtil::AddChildVariable< float >(m_pVariable, value, name, label);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool CVariableOArchive::operator()(double& value, const char* name, const char* label)
|
||||
{
|
||||
VarUtil::AddChildVariable< float >(m_pVariable, value, name, label);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool CVariableOArchive::operator()(int16& value, const char* name, const char* label)
|
||||
{
|
||||
_smart_ptr< IVariable > pVariable = VarUtil::AddChildVariable< int >(m_pVariable, value, name, label);
|
||||
VarUtil::SetLimits(pVariable, SHRT_MIN, SHRT_MAX);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool CVariableOArchive::operator()(uint16& value, const char* name, const char* label)
|
||||
{
|
||||
_smart_ptr< IVariable > pVariable = VarUtil::AddChildVariable< int >(m_pVariable, value, name, label);
|
||||
VarUtil::SetLimits(pVariable, 0, USHRT_MAX);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool CVariableOArchive::operator()(int32& value, const char* name, const char* label)
|
||||
{
|
||||
_smart_ptr< IVariable > pVariable = VarUtil::AddChildVariable< int >(m_pVariable, value, name, label);
|
||||
VarUtil::SetLimits(pVariable, INT_MIN, INT_MAX);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool CVariableOArchive::operator()(uint32& value, const char* name, const char* label)
|
||||
{
|
||||
_smart_ptr< IVariable > pVariable = VarUtil::AddChildVariable< int >(m_pVariable, value, name, label);
|
||||
VarUtil::SetLimits(pVariable, 0, INT_MAX);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool CVariableOArchive::operator()(int64& value, const char* name, const char* label)
|
||||
{
|
||||
_smart_ptr< IVariable > pVariable = VarUtil::AddChildVariable< int >(m_pVariable, value, name, label);
|
||||
VarUtil::SetLimits(pVariable, INT_MIN, INT_MAX);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool CVariableOArchive::operator()(uint64& value, const char* name, const char* label)
|
||||
{
|
||||
_smart_ptr< IVariable > pVariable = VarUtil::AddChildVariable< int >(m_pVariable, value, name, label);
|
||||
VarUtil::SetLimits(pVariable, 0, INT_MAX);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool CVariableOArchive::operator()(int8& value, const char* name, const char* label)
|
||||
{
|
||||
_smart_ptr< IVariable > pVariable = VarUtil::AddChildVariable< int >(m_pVariable, value, name, label);
|
||||
VarUtil::SetLimits(pVariable, SCHAR_MIN, SCHAR_MAX);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool CVariableOArchive::operator()(uint8& value, const char* name, const char* label)
|
||||
{
|
||||
_smart_ptr< IVariable > pVariable = VarUtil::AddChildVariable< int >(m_pVariable, value, name, label);
|
||||
VarUtil::SetLimits(pVariable, 0, UCHAR_MAX);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool CVariableOArchive::operator()(char& value, const char* name, const char* label)
|
||||
{
|
||||
_smart_ptr< IVariable > pVariable = VarUtil::AddChildVariable< int >(m_pVariable, value, name, label);
|
||||
VarUtil::SetLimits(pVariable, CHAR_MIN, CHAR_MAX);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool CVariableOArchive::operator()(const Serialization::SStruct& ser, const char* name, const char* label)
|
||||
{
|
||||
const char* const typeName = ser.type().name();
|
||||
HandlersMap::const_iterator it = m_structHandlers.find(typeName);
|
||||
const bool handlerFound = (it != m_structHandlers.end());
|
||||
if (handlerFound)
|
||||
{
|
||||
StructHandlerFunctionPtr pHandler = it->second;
|
||||
return (this->*pHandler)(ser, name, label);
|
||||
}
|
||||
|
||||
return SerializeStruct(ser, name, label);
|
||||
}
|
||||
|
||||
static const char* gVec4Names[] = { "X", "Y", "Z", "W" };
|
||||
static const char* gEmptyNames[] = { "" };
|
||||
|
||||
bool CVariableOArchive::operator()(Serialization::IContainer& ser, const char* name, const char* label)
|
||||
{
|
||||
CVariableOArchive childArchive;
|
||||
childArchive.SetFilter(GetFilter());
|
||||
childArchive.SetInnerContext(GetInnerContext());
|
||||
|
||||
_smart_ptr< IVariable > pChildVariable = childArchive.GetIVariable();
|
||||
pChildVariable->SetName(name);
|
||||
pChildVariable->SetHumanName(label);
|
||||
|
||||
m_pVariable->AddVariable(pChildVariable);
|
||||
|
||||
const size_t containerSize = ser.size();
|
||||
|
||||
const char** nameArray = gEmptyNames;
|
||||
size_t nameArraySize = 1;
|
||||
if (containerSize >= 2 && containerSize <= 4)
|
||||
{
|
||||
nameArray = gVec4Names;
|
||||
nameArraySize = containerSize;
|
||||
}
|
||||
|
||||
size_t index = 0;
|
||||
if (0 < containerSize)
|
||||
{
|
||||
do
|
||||
{
|
||||
ser(childArchive, nameArray[index % nameArraySize], nameArray[index % nameArraySize]);
|
||||
++index;
|
||||
} while (ser.next());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool CVariableOArchive::SerializeStruct(const Serialization::SStruct& ser, const char* name, const char* label)
|
||||
{
|
||||
CVariableOArchive childArchive;
|
||||
childArchive.SetFilter(GetFilter());
|
||||
childArchive.SetInnerContext(GetInnerContext());
|
||||
|
||||
_smart_ptr< IVariable > pChildVariable = childArchive.GetIVariable();
|
||||
pChildVariable->SetName(name);
|
||||
pChildVariable->SetHumanName(label);
|
||||
|
||||
m_pVariable->AddVariable(pChildVariable);
|
||||
|
||||
const bool serializeSuccess = ser(childArchive);
|
||||
|
||||
return serializeSuccess;
|
||||
}
|
||||
|
||||
|
||||
bool CVariableOArchive::SerializeAnimationName(const Serialization::IResourceSelector* pSelector, const char* name, const char* label)
|
||||
{
|
||||
const QString valueString = pSelector->GetValue();
|
||||
_smart_ptr< IVariable > pVariable = VarUtil::AddChildVariable< QString >(m_pVariable, valueString, name, label);
|
||||
pVariable->SetDataType(IVariable::DT_ANIMATION);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool CVariableOArchive::SerializeSoundName(const Serialization::IResourceSelector* pSelector, const char* name, const char* label)
|
||||
{
|
||||
const QString valueString = pSelector->GetValue();
|
||||
_smart_ptr< IVariable > pVariable = VarUtil::AddChildVariable< QString >(m_pVariable, valueString, name, label);
|
||||
pVariable->SetDataType(IVariable::DT_AUDIO_TRIGGER);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CVariableOArchive::CreateChildEnumVariable(const QStringList& enumValues, const QString& value, const char* name, const char* label)
|
||||
{
|
||||
if (enumValues.empty())
|
||||
{
|
||||
VarUtil::AddChildVariable< QString >(m_pVariable, value, name, label);
|
||||
}
|
||||
else
|
||||
{
|
||||
_smart_ptr< CVariableEnum< QString > > pVariable = new CVariableEnum< QString >();
|
||||
pVariable->SetName(name);
|
||||
pVariable->SetHumanName(label);
|
||||
|
||||
pVariable->AddEnumItem("", "");
|
||||
|
||||
const size_t enumValuesCount = enumValues.size();
|
||||
for (size_t i = 0; i < enumValuesCount; ++i)
|
||||
{
|
||||
pVariable->AddEnumItem(enumValues[ i ], enumValues[ i ]);
|
||||
}
|
||||
|
||||
pVariable->Set(value);
|
||||
|
||||
m_pVariable->AddVariable(pVariable);
|
||||
}
|
||||
}
|
||||
|
||||
bool CVariableOArchive::SerializeObjectFilename(const Serialization::IResourceSelector* pSelector, const char* name, const char* label)
|
||||
{
|
||||
const QString valueString = pSelector->GetValue();
|
||||
_smart_ptr< IVariable > pVariable = VarUtil::AddChildVariable< QString >(m_pVariable, valueString, name, label);
|
||||
pVariable->SetDataType(IVariable::DT_OBJECT);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool CVariableOArchive::SerializeStringListStaticValue(const Serialization::SStruct& ser, const char* name, const char* label)
|
||||
{
|
||||
const StringListStaticValue* const pStringListStaticValue = reinterpret_cast< StringListStaticValue* >(ser.pointer());
|
||||
const StringListStatic& stringListStatic = pStringListStaticValue->stringList();
|
||||
const int index = pStringListStaticValue->index();
|
||||
|
||||
_smart_ptr< CVariableEnum< int > > pVariable = new CVariableEnum< int >();
|
||||
pVariable->SetName(name);
|
||||
pVariable->SetHumanName(label);
|
||||
|
||||
const size_t stringListStaticSize = stringListStatic.size();
|
||||
for (size_t i = 0; i < stringListStaticSize; ++i)
|
||||
{
|
||||
pVariable->AddEnumItem(stringListStatic[ i ], static_cast< int >(i));
|
||||
}
|
||||
|
||||
if (0 <= index)
|
||||
{
|
||||
CRY_ASSERT(index < stringListStaticSize);
|
||||
pVariable->Set(static_cast< int >(index));
|
||||
}
|
||||
|
||||
m_pVariable->AddVariable(pVariable);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVariableOArchive::SerializeIResourceSelector(const Serialization::SStruct& ser, const char* name, const char* label)
|
||||
{
|
||||
const Serialization::IResourceSelector* pSelector = reinterpret_cast< Serialization::IResourceSelector* >(ser.pointer());
|
||||
|
||||
ResourceHandlersMap::iterator it = m_resourceHandlers.find(pSelector->resourceType);
|
||||
if (it != m_resourceHandlers.end())
|
||||
{
|
||||
return (this->*(it->second))(pSelector, name, label);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
static void SetLimits(IVariable* pVariable, const Serialization::RangeDecorator<T>* pRange, float stepValue)
|
||||
{
|
||||
if (pRange->softMin != std::numeric_limits<T>::lowest() || pRange->softMax != std::numeric_limits<T>::max())
|
||||
{
|
||||
float minimal = (float)pRange->softMin;
|
||||
float maximal = (float)pRange->softMax;
|
||||
bool hardMin = false;
|
||||
bool hardMax = false;
|
||||
if (pRange->hardMin != std::numeric_limits<T>::lowest())
|
||||
{
|
||||
minimal = pRange->hardMin;
|
||||
hardMin = true;
|
||||
}
|
||||
if (pRange->hardMax != std::numeric_limits<T>::max())
|
||||
{
|
||||
maximal = pRange->hardMax;
|
||||
hardMax = true;
|
||||
}
|
||||
pVariable->SetLimits(minimal, maximal, stepValue, hardMin, hardMax);
|
||||
}
|
||||
else
|
||||
{
|
||||
float minimal = 0.0f;
|
||||
float maximal = 0.0f;
|
||||
float oldStep = 0.0f;
|
||||
bool hardMin = false;
|
||||
bool hardMax = false;
|
||||
pVariable->GetLimits(minimal, maximal, oldStep, hardMin, hardMax);
|
||||
pVariable->SetLimits(minimal, maximal, stepValue, hardMin, hardMax);
|
||||
}
|
||||
}
|
||||
|
||||
bool CVariableOArchive::SerializeRangeFloat(const Serialization::SStruct& ser, const char* name, const char* label)
|
||||
{
|
||||
const Serialization::RangeDecorator< float >* const pRange = reinterpret_cast< Serialization::RangeDecorator< float >* >(ser.pointer());
|
||||
|
||||
_smart_ptr< IVariable > pVariable = VarUtil::AddChildVariable< float >(m_pVariable, *pRange->value, name, label);
|
||||
|
||||
SetLimits(pVariable.get(), pRange, 0.01f);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVariableOArchive::SerializeRangeInt(const Serialization::SStruct& ser, const char* name, const char* label)
|
||||
{
|
||||
const Serialization::RangeDecorator< int >* const pRange = reinterpret_cast< Serialization::RangeDecorator< int >* >(ser.pointer());
|
||||
|
||||
_smart_ptr< IVariable > pVariable = VarUtil::AddChildVariable< int >(m_pVariable, *pRange->value, name, label);
|
||||
SetLimits(pVariable.get(), pRange, 1.0f);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVariableOArchive::SerializeRangeUInt(const Serialization::SStruct& ser, const char* name, const char* label)
|
||||
{
|
||||
const Serialization::RangeDecorator< unsigned int >* const pRange = reinterpret_cast< Serialization::RangeDecorator< unsigned int >* >(ser.pointer());
|
||||
|
||||
_smart_ptr< IVariable > pVariable = VarUtil::AddChildVariable< int >(m_pVariable, *pRange->value, name, label);
|
||||
SetLimits(pVariable, pRange, 1.0f);
|
||||
return true;
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Util/Variable.h"
|
||||
#include "Serialization.h"
|
||||
|
||||
|
||||
namespace Serialization
|
||||
{
|
||||
struct IResourceSelector;
|
||||
|
||||
class CVariableOArchive
|
||||
: public IArchive
|
||||
{
|
||||
public:
|
||||
CVariableOArchive();
|
||||
virtual ~CVariableOArchive();
|
||||
|
||||
_smart_ptr< IVariable > GetIVariable() const;
|
||||
CVarBlockPtr GetVarBlock() const;
|
||||
|
||||
// IArchive
|
||||
virtual bool operator()(bool& value, const char* name = "", const char* label = 0) override;
|
||||
virtual bool operator()(IString& value, const char* name = "", const char* label = 0) override;
|
||||
virtual bool operator()(IWString& value, const char* name = "", const char* label = 0) override;
|
||||
virtual bool operator()(float& value, const char* name = "", const char* label = 0) override;
|
||||
virtual bool operator()(double& value, const char* name = "", const char* label = 0) override;
|
||||
virtual bool operator()(int16& value, const char* name = "", const char* label = 0) override;
|
||||
virtual bool operator()(uint16& value, const char* name = "", const char* label = 0) override;
|
||||
virtual bool operator()(int32& value, const char* name = "", const char* label = 0) override;
|
||||
virtual bool operator()(uint32& value, const char* name = "", const char* label = 0) override;
|
||||
virtual bool operator()(int64& value, const char* name = "", const char* label = 0) override;
|
||||
virtual bool operator()(uint64& value, const char* name = "", const char* label = 0) override;
|
||||
|
||||
virtual bool operator()(int8& value, const char* name = "", const char* label = 0) override;
|
||||
virtual bool operator()(uint8& value, const char* name = "", const char* label = 0) override;
|
||||
virtual bool operator()(char& value, const char* name = "", const char* label = 0);
|
||||
|
||||
virtual bool operator()(const SStruct& ser, const char* name = "", const char* label = 0) override;
|
||||
virtual bool operator()(IContainer& ser, const char* name = "", const char* label = 0) override;
|
||||
//virtual bool operator()( IPointer& ptr, const char* name = "", const char* label = 0 ) override;
|
||||
// ~IArchive
|
||||
|
||||
using IArchive::operator();
|
||||
|
||||
private:
|
||||
bool SerializeStruct(const SStruct& ser, const char* name, const char* label);
|
||||
bool SerializeStringListStaticValue(const SStruct& ser, const char* name, const char* label);
|
||||
bool SerializeRangeFloat(const SStruct& ser, const char* name, const char* label);
|
||||
bool SerializeRangeInt(const SStruct& ser, const char* name, const char* label);
|
||||
bool SerializeRangeUInt(const SStruct& ser, const char* name, const char* label);
|
||||
bool SerializeIResourceSelector(const SStruct& ser, const char* name, const char* label);
|
||||
|
||||
bool SerializeAnimationName(const IResourceSelector* pSelector, const char* name, const char* label);
|
||||
bool SerializeSoundName(const IResourceSelector* pSelector, const char* name, const char* label);
|
||||
bool SerializeObjectFilename(const IResourceSelector* pSelector, const char* name, const char* label);
|
||||
|
||||
void CreateChildEnumVariable(const QStringList& enumValues, const QString& value, const char* name, const char* label);
|
||||
|
||||
private:
|
||||
_smart_ptr< IVariable > m_pVariable;
|
||||
|
||||
typedef bool ( CVariableOArchive::* StructHandlerFunctionPtr )(const SStruct&, const char*, const char*);
|
||||
typedef std::map< string, StructHandlerFunctionPtr > HandlersMap;
|
||||
HandlersMap m_structHandlers; // TODO: have only one of these.
|
||||
|
||||
typedef bool ( CVariableOArchive::* ResourceHandlerFunctionPtr )(const IResourceSelector*, const char*, const char*);
|
||||
typedef std::map< string, ResourceHandlerFunctionPtr > ResourceHandlersMap;
|
||||
ResourceHandlersMap m_resourceHandlers;
|
||||
};
|
||||
}
|
||||
@@ -1,177 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#include "EditorDefs.h"
|
||||
|
||||
#include "SettingsBlock.h"
|
||||
|
||||
// CryCommon
|
||||
#include <CryCommon/Serialization/ITextInputArchive.h>
|
||||
#include <CryCommon/Serialization/ITextOutputArchive.h>
|
||||
|
||||
// Editor
|
||||
#include "Serialization.h"
|
||||
|
||||
using std::vector;
|
||||
|
||||
SProjectSettingsBlock* SProjectSettingsBlock::s_pLastBlock;
|
||||
|
||||
SProjectSettingsBlock::SProjectSettingsBlock(const char* name, const char* label)
|
||||
: m_name(name)
|
||||
, m_label(label)
|
||||
{
|
||||
m_pPrevious = s_pLastBlock;
|
||||
s_pLastBlock = this;
|
||||
}
|
||||
|
||||
|
||||
struct SAllSettingsSerializer
|
||||
{
|
||||
void Serialize(Serialization::IArchive& ar)
|
||||
{
|
||||
SProjectSettingsBlock* pCurrent = SProjectSettingsBlock::s_pLastBlock;
|
||||
while (pCurrent != 0)
|
||||
{
|
||||
ar(*pCurrent, pCurrent->GetName(), pCurrent->GetLabel());
|
||||
pCurrent = pCurrent->m_pPrevious;
|
||||
}
|
||||
}
|
||||
} static gAllSettingsSerializer;
|
||||
|
||||
void SProjectSettingsBlock::GetAllSettingsSerializer(Serialization::SStruct* pSerializer)
|
||||
{
|
||||
*pSerializer = Serialization::SStruct(gAllSettingsSerializer);
|
||||
}
|
||||
|
||||
SProjectSettingsBlock* SProjectSettingsBlock::Find(const char* blockName)
|
||||
{
|
||||
SProjectSettingsBlock* pCurrent = SProjectSettingsBlock::s_pLastBlock;
|
||||
while (pCurrent != 0)
|
||||
{
|
||||
if (_stricmp(pCurrent->GetName(), blockName) == 0)
|
||||
{
|
||||
return pCurrent;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool ReadFileContent(vector<char>* pBuffer, const char* filename)
|
||||
{
|
||||
AZ::IO::HandleType fileHandle = gEnv->pCryPak->FOpen(filename, "rb");
|
||||
if (fileHandle == AZ::IO::InvalidHandle)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t size = gEnv->pCryPak->FGetSize(fileHandle);
|
||||
pBuffer->resize(size);
|
||||
|
||||
bool result = true;
|
||||
if (gEnv->pCryPak->FRead(&(*pBuffer)[0], size, fileHandle) != size)
|
||||
{
|
||||
result = false;
|
||||
}
|
||||
gEnv->pCryPak->FClose(fileHandle);
|
||||
return result;
|
||||
}
|
||||
|
||||
static bool SaveFileContent(const char* filename, const char* pBuffer, size_t length)
|
||||
{
|
||||
string fullpath = Path::GamePathToFullPath(filename).toUtf8().data();
|
||||
|
||||
AZ::IO::HandleType fileHandle = AZ::IO::InvalidHandle;
|
||||
if (!gEnv->pFileIO->Open(fullpath.c_str(), AZ::IO::GetOpenModeFromStringMode("wb"), fileHandle))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool result = true;
|
||||
if (!gEnv->pFileIO->Write(fileHandle, pBuffer, length))
|
||||
{
|
||||
result = false;
|
||||
}
|
||||
|
||||
gEnv->pFileIO->Close(fileHandle);
|
||||
return result;
|
||||
}
|
||||
|
||||
static bool SaveFileContentIfDiffers(const char* filename, const char* pBuffer, size_t length)
|
||||
{
|
||||
vector<char> content;
|
||||
ReadFileContent(&content, filename);
|
||||
|
||||
bool needToWrite = true;
|
||||
if (!content.empty() && content.size() == length)
|
||||
{
|
||||
needToWrite = memcmp(&content[0], pBuffer, length) != 0;
|
||||
}
|
||||
|
||||
if (needToWrite)
|
||||
{
|
||||
return SaveFileContent(filename, pBuffer, length);
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool SProjectSettingsBlock::Load()
|
||||
{
|
||||
const char* filename = GetFilename();
|
||||
|
||||
vector<char> content;
|
||||
if (!ReadFileContent(&content, filename))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
auto pArchive(Serialization::CreateTextInputArchive());
|
||||
if (!pArchive)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!pArchive->AttachMemory(&content[0], content.size()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Serialization::SStruct serializer;
|
||||
GetAllSettingsSerializer(&serializer);
|
||||
serializer(*pArchive);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SProjectSettingsBlock::Save()
|
||||
{
|
||||
const char* filename = GetFilename();
|
||||
auto pArchive(Serialization::CreateTextOutputArchive());
|
||||
if (!pArchive)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Serialization::SStruct serializer;
|
||||
GetAllSettingsSerializer(&serializer);
|
||||
serializer(*pArchive);
|
||||
|
||||
return SaveFileContentIfDiffers(filename, pArchive->GetBuffer(), pArchive->GetBufferLength());
|
||||
}
|
||||
|
||||
const char* SProjectSettingsBlock::GetFilename()
|
||||
{
|
||||
return "SandboxSettings.json";
|
||||
}
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#pragma once
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Following utility can be used to add blocks of per-project settings.
|
||||
// Example:
|
||||
//
|
||||
// MyComponent.cpp:
|
||||
//
|
||||
// struct SProjectSettingsMy : SProjectSettingsBlock
|
||||
// {
|
||||
// bool bMyOption;
|
||||
//
|
||||
// SProjectSettingsMy()
|
||||
// : SProjectSettingsBlock("my", "My")
|
||||
// , bMyOption(false)
|
||||
// {}
|
||||
//
|
||||
// void Serialize(Serialization::IArchive& ar)
|
||||
// {
|
||||
// ar(bMyOption, "myOption", "My Option");
|
||||
// }
|
||||
//
|
||||
// } static gMySettings;
|
||||
//
|
||||
//
|
||||
// Now gMySettings will be loaded and saved automatically and available for
|
||||
// editing through:
|
||||
//
|
||||
// GetIEditor()->OpenProjectSettings("my");
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
#ifndef CRYINCLUDE_EDITOR_SETTINGSBLOCK_H
|
||||
#define CRYINCLUDE_EDITOR_SETTINGSBLOCK_H
|
||||
|
||||
namespace Serialization
|
||||
{
|
||||
class IArchive;
|
||||
struct SStruct;
|
||||
};
|
||||
|
||||
struct SProjectSettingsBlock
|
||||
{
|
||||
SProjectSettingsBlock(const char* name, const char* label);
|
||||
|
||||
virtual void Serialize(Serialization::IArchive& ar) = 0;
|
||||
|
||||
const char* GetName() const{ return m_name; }
|
||||
const char* GetLabel() const{ return m_label; }
|
||||
|
||||
static void GetAllSettingsSerializer(Serialization::SStruct* serializer);
|
||||
static SProjectSettingsBlock* Find(const char* name);
|
||||
static bool Load();
|
||||
static bool Save();
|
||||
static const char* GetFilename();
|
||||
private:
|
||||
const char* m_name;
|
||||
const char* m_label;
|
||||
SProjectSettingsBlock* m_pPrevious;
|
||||
static SProjectSettingsBlock* s_pLastBlock;
|
||||
friend struct SAllSettingsSerializer;
|
||||
};
|
||||
|
||||
#endif // CRYINCLUDE_EDITOR_SETTINGSBLOCK_H
|
||||
@@ -357,8 +357,6 @@ set(FILES
|
||||
Controls/ConsoleSCB.h
|
||||
Controls/ConsoleSCB.ui
|
||||
Controls/ConsoleSCB.qrc
|
||||
Controls/CurveEditorCtrl.cpp
|
||||
Controls/CurveEditorCtrl.h
|
||||
Controls/FolderTreeCtrl.cpp
|
||||
Controls/FolderTreeCtrl.h
|
||||
Controls/HotTrackingTreeCtrl.cpp
|
||||
@@ -575,11 +573,6 @@ set(FILES
|
||||
QtUI/WaitCursor.cpp
|
||||
RenderHelpers/AxisHelper.cpp
|
||||
RenderHelpers/AxisHelper.h
|
||||
Serialization.h
|
||||
Serialization/VariableOArchive.cpp
|
||||
Serialization/VariableOArchive.h
|
||||
Serialization/VariableIArchive.cpp
|
||||
Serialization/VariableIArchive.h
|
||||
CustomizeKeyboardDialog.h
|
||||
CustomizeKeyboardDialog.cpp
|
||||
CustomizeKeyboardDialog.ui
|
||||
@@ -738,8 +731,6 @@ set(FILES
|
||||
TrackView/TrackViewEventNode.h
|
||||
ConfigGroup.cpp
|
||||
ConfigGroup.h
|
||||
SettingsBlock.cpp
|
||||
SettingsBlock.h
|
||||
Util/AffineParts.h
|
||||
Util/AutoLogTime.cpp
|
||||
Util/AutoLogTime.h
|
||||
|
||||
Reference in New Issue
Block a user