Integrating github/staging through commit ab87ed9
This commit is contained in:
@@ -384,18 +384,11 @@ void Q2DViewport::OnMouseMove(Qt::KeyboardModifiers modifiers, Qt::MouseButtons
|
||||
CaptureMouse();
|
||||
}
|
||||
|
||||
QRect rc;
|
||||
// You can only scroll while the middle mouse button is down
|
||||
if (buttons & Qt::RightButton || buttons & Qt::MiddleButton)
|
||||
{
|
||||
if (modifiers & Qt::ShiftModifier)
|
||||
{
|
||||
// Get the dimensions of the window
|
||||
rc = rect();
|
||||
|
||||
int w = rc.right();
|
||||
int h = rc.bottom();
|
||||
|
||||
// Zoom to mouse position.
|
||||
float z = m_prevZoomFactor + (point.y() - m_RMouseDownPos.y()) * 0.02f;
|
||||
SetZoom(z, m_RMouseDownPos);
|
||||
@@ -482,8 +475,6 @@ void Q2DViewport::SetZoom(float fZoomFactor, const QPoint& center)
|
||||
fZoomFactor = m_maxZoom;
|
||||
}
|
||||
|
||||
float prevz = GetZoomFactor();
|
||||
|
||||
// Zoom to mouse position.
|
||||
float ofsx, ofsy;
|
||||
GetScrollOffset(ofsx, ofsy);
|
||||
@@ -831,12 +822,6 @@ void Q2DViewport::DrawGrid(DisplayContext& dc, bool bNoXNumbers)
|
||||
}
|
||||
}
|
||||
|
||||
int firstGridLineX = origin[0] / gridSize - 1;
|
||||
int firstGridLineY = origin[1] / gridSize - 1;
|
||||
|
||||
int numGridLinesX = (m_rcClient.width() / fScale) / gridSize + 1;
|
||||
int numGridLinesY = (m_rcClient.height() / fScale) / gridSize + 1;
|
||||
|
||||
Matrix34 viewTM = GetViewTM().GetInverted() * m_screenTM_Inverted;
|
||||
Matrix34 viewTM_Inv = m_screenTM * GetViewTM();
|
||||
|
||||
@@ -961,8 +946,6 @@ void Q2DViewport::DrawGrid(DisplayContext& dc, bool bNoXNumbers)
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void Q2DViewport::DrawAxis(DisplayContext& dc)
|
||||
{
|
||||
int ix = 0;
|
||||
int iy = 0;
|
||||
float cl = 0.85f;
|
||||
char xstr[2], ystr[2], zstr[2];
|
||||
Vec3 colx, coly, colz;
|
||||
@@ -1005,7 +988,6 @@ void Q2DViewport::DrawAxis(DisplayContext& dc)
|
||||
break;
|
||||
}
|
||||
|
||||
int width = m_rcClient.width();
|
||||
int height = m_rcClient.height();
|
||||
|
||||
int size = 25;
|
||||
@@ -1146,7 +1128,6 @@ void Q2DViewport::DrawObjects(DisplayContext& dc)
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void Q2DViewport::MakeConstructionPlane([[maybe_unused]] int axis)
|
||||
{
|
||||
RefCoordSys coordSys = GetIEditor()->GetReferenceCoordSys();
|
||||
m_constructionMatrix[COORDS_VIEW] = GetViewTM();
|
||||
|
||||
Vec3 p(0, 0, 0);
|
||||
|
||||
@@ -40,10 +40,6 @@ void CAlignPickCallback::OnPick(CBaseObject* picked)
|
||||
const Vec3& pickedScale = picked->GetScale();
|
||||
const Vec3& pickedPos = picked->GetPos();
|
||||
|
||||
float fPickedWidth = pickedAABB.max.x - pickedAABB.min.x;
|
||||
float fPickedHeight = pickedAABB.max.z - pickedAABB.min.z;
|
||||
float fPickedLength = pickedAABB.max.y - pickedAABB.min.y;
|
||||
|
||||
bool bKeepScale = CheckVirtualKey(Qt::Key_Shift);
|
||||
bool bKeepRotation = CheckVirtualKey(Qt::Key_Alt);
|
||||
bool bAlignToBoundBox = CheckVirtualKey(Qt::Key_Control);
|
||||
|
||||
@@ -56,8 +56,6 @@ protected:
|
||||
void OnSetCamera(const SCameraParams& Params)
|
||||
{
|
||||
// Only switch camera when in Play mode.
|
||||
CAnimationContext* ac = GetIEditor()->GetAnimation();
|
||||
|
||||
GUID camObjId = GUID_NULL;
|
||||
if (Params.cameraEntityId.IsValid())
|
||||
{
|
||||
|
||||
@@ -61,7 +61,7 @@ void AssetEditorRequestsHandler::OpenAssetEditor(const AZ::Data::Asset<AZ::Data:
|
||||
using namespace AzToolsFramework::AssetEditor;
|
||||
|
||||
// Open the AssetEditor if it isn't open already.
|
||||
auto&& pane = QtViewPaneManager::instance()->OpenPane(LyViewPane::AssetEditor, QtViewPane::OpenMode::RestoreLayout);
|
||||
QtViewPaneManager::instance()->OpenPane(LyViewPane::AssetEditor, QtViewPane::OpenMode::RestoreLayout);
|
||||
|
||||
AssetEditorWidgetRequestsBus::Broadcast(&AssetEditorWidgetRequests::OpenAsset, asset);
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <AzCore/Asset/AssetTypeInfoBus.h>
|
||||
|
||||
// AzFramework
|
||||
#include <AzFramework/API/ApplicationAPI.h>
|
||||
#include <AzFramework/Asset/GenericAssetHandler.h>
|
||||
|
||||
// AzToolsFramework
|
||||
@@ -174,10 +175,18 @@ namespace AzAssetBrowserRequestHandlerPrivate
|
||||
}
|
||||
}
|
||||
|
||||
// Prepare undo command last so it captures the final state of the entity.
|
||||
EntityCreateCommand* command = aznew EntityCreateCommand(static_cast<AZ::u64>(newEntity->GetId()));
|
||||
command->Capture(newEntity);
|
||||
command->SetParent(undo.GetUndoBatch());
|
||||
bool isPrefabSystemEnabled = false;
|
||||
AzFramework::ApplicationRequests::Bus::BroadcastResult(
|
||||
isPrefabSystemEnabled, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
|
||||
|
||||
if (!isPrefabSystemEnabled)
|
||||
{
|
||||
// Prepare undo command last so it captures the final state of the entity.
|
||||
EntityCreateCommand* command = aznew EntityCreateCommand(static_cast<AZ::u64>(newEntity->GetId()));
|
||||
command->Capture(newEntity);
|
||||
command->SetParent(undo.GetUndoBatch());
|
||||
}
|
||||
|
||||
ToolsApplicationRequests::Bus::Broadcast(&ToolsApplicationRequests::AddDirtyEntity, newEntity->GetId());
|
||||
spawnList.push_back(newEntity->GetId());
|
||||
}
|
||||
|
||||
@@ -194,9 +194,6 @@ void CColorGradientCtrl::paintEvent(QPaintEvent* e)
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CColorGradientCtrl::DrawGradient(QPaintEvent* e, QPainter* painter)
|
||||
{
|
||||
int cx = m_rcGradient.width();
|
||||
int cy = m_rcGradient.height();
|
||||
|
||||
//Draw Curve
|
||||
// create and select a thick, white pen
|
||||
painter->setPen(QPen(QColor(128, 255, 128), 1, Qt::SolidLine));
|
||||
|
||||
@@ -1210,7 +1210,6 @@ ConsoleVariableEditor::ConsoleVariableEditor(QWidget* parent)
|
||||
mainLayout->addWidget(m_tableView, 1);
|
||||
|
||||
// Set the console variables
|
||||
IConsole* console = GetIEditor()->GetSystem()->GetIConsole();
|
||||
m_varBlock = VarBlockFromConsoleVars();
|
||||
SetVarBlock(m_varBlock);
|
||||
}
|
||||
|
||||
@@ -243,8 +243,6 @@ void QBitmapPreviewDialogImp::refreshData()
|
||||
|
||||
int w = m_image->GetWidth();
|
||||
int h = m_image->GetHeight();
|
||||
bool hasAlpha = m_image->HasAlphaChannel();
|
||||
bool isLimitedHDR = m_image->IsLimitedHDR();
|
||||
|
||||
int multiplier = (m_showMode == ESHOW_RGB_ALPHA ? 2 : 1);
|
||||
int originalW = w * multiplier;
|
||||
|
||||
@@ -215,7 +215,6 @@ void QRollupCtrl::writeSettings(const QString& qSettingsGroup)
|
||||
|
||||
void QRollupCtrl::updateTabs()
|
||||
{
|
||||
QRollupCtrlButton* lastButton = 0;
|
||||
for (auto i = m_pageList.constBegin(); i != m_pageList.constEnd(); ++i)
|
||||
{
|
||||
QRollupCtrlButton* tB = (*i).button;
|
||||
|
||||
@@ -494,8 +494,6 @@ void QToolTipWidget::KeepTipOnScreen(QRect targetRect, ArrowDirection preferredA
|
||||
|
||||
QPolygonF QToolTipWidget::QArrow::CreateArrow()
|
||||
{
|
||||
int height = 10;
|
||||
|
||||
QVector<QPointF> vertex;
|
||||
//3 points in triangle
|
||||
vertex.reserve(3);
|
||||
@@ -645,4 +643,4 @@ void QToolTipWrapper::DestroyToolTip()
|
||||
{
|
||||
m_actualTooltip->deleteLater();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,6 @@ CReflectedVarAnimation AnimationPropertyCtrl::value() const
|
||||
|
||||
void AnimationPropertyCtrl::OnApplyClicked()
|
||||
{
|
||||
CUIEnumerations &roGeneralProxy = CUIEnumerations::GetUIEnumerationsInstance();
|
||||
QStringList cSelectedAnimations;
|
||||
size_t nTotalAnimations(0);
|
||||
size_t nCurrentAnimation(0);
|
||||
|
||||
@@ -191,9 +191,6 @@ void CSplineCtrl::DrawGrid(QPainter* painter)
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CSplineCtrl::DrawSpline(QPainter* painter)
|
||||
{
|
||||
int cx = m_rcSpline.width();
|
||||
int cy = m_rcSpline.height();
|
||||
|
||||
//Draw Curve
|
||||
// create and select a thick, white pen
|
||||
const QPen pOldPen = painter->pen();
|
||||
|
||||
@@ -2671,7 +2671,6 @@ void AbstractSplineWidget::SelectAll()
|
||||
for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex)
|
||||
{
|
||||
ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline;
|
||||
ISplineInterpolator* pDetailSpline = m_splines[splineIndex].pDetailSpline;
|
||||
|
||||
for (int i = 0; i < (int)pSpline->GetKeyCount(); i++)
|
||||
{
|
||||
@@ -2721,7 +2720,6 @@ void SplineWidget::SetTimelineCtrl(TimelineWidget* pTimelineCtrl)
|
||||
m_pTimelineCtrl = pTimelineCtrl;
|
||||
if (m_pTimelineCtrl)
|
||||
{
|
||||
QWidget* pOwner = pTimelineCtrl->parentWidget();
|
||||
pTimelineCtrl->setParent(this);
|
||||
pTimelineCtrl->SetZoom(m_grid.zoom.x);
|
||||
pTimelineCtrl->SetOrigin(m_grid.origin.x);
|
||||
|
||||
@@ -1,461 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates, or
|
||||
* a third party where indicated.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
// SyntaxColorizer.cpp: implementation of the CSyntaxColorizer class.
|
||||
//
|
||||
// Version: 1.0.0
|
||||
// Author: Jeff Schering jeffschering@hotmail.com
|
||||
// Date: Jan 2001
|
||||
// Copyright 2001 by Jeff Schering
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "EditorDefs.h"
|
||||
|
||||
#include "SyntaxColorizer.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CSyntaxColorizer::CSyntaxColorizer(QTextDocument *pParent)
|
||||
: QSyntaxHighlighter(pParent)
|
||||
{
|
||||
createDefaultCharFormat();
|
||||
SetCommentColor(CLR_COMMENT);
|
||||
SetStringColor(CLR_STRING);
|
||||
createTables();
|
||||
m_pskKeyword = NULL;
|
||||
createDefaultKeywordList();
|
||||
}
|
||||
|
||||
CSyntaxColorizer::~CSyntaxColorizer()
|
||||
{
|
||||
ClearKeywordList();
|
||||
deleteTables();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Member Functions
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
void CSyntaxColorizer::createDefaultCharFormat()
|
||||
{
|
||||
m_cfComment = m_cfDefault;
|
||||
m_cfString = m_cfDefault;
|
||||
}
|
||||
|
||||
void CSyntaxColorizer::createDefaultKeywordList()
|
||||
{
|
||||
const char *sKeywords = "__asm,else,main,struct,__assume,enum,"
|
||||
"__multiple_inheritance,switch,auto,__except,__single_inheritance,"
|
||||
"template,__based,explicit,__virtual_inheritance,this,bool,extern,"
|
||||
"mutable,thread,break,false,naked,throw,case,__fastcall,namespace,"
|
||||
"true,catch,__finally,new,try,__cdecl,float,noreturn,__try,char,for,"
|
||||
"operator,typedef,class,friend,private,typeid,const,goto,protected,"
|
||||
"typename,const_cast,if,public,union,continue,inline,register,"
|
||||
"unsigned,__declspec,__inline,reinterpret_cast,using,declaration,"
|
||||
"directive,default,int,return,uuid,delete,__int8,short,"
|
||||
"__uuidof,dllexport,__int16,signed,virtual,dllimport,__int32,sizeof,"
|
||||
"void,do,__int64,static,volatile,double,__leave,static_cast,wmain,"
|
||||
"dynamic_cast,long,__stdcall,while";
|
||||
const char *sDirectives = "#define,#elif,#else,#endif,#error,#ifdef,"
|
||||
"#ifndef,#import,#include,#line,#pragma,#undef";
|
||||
const char *sPragmas = "alloc_text,comment,init_seg1,optimize,auto_inline,"
|
||||
"component,inline_depth,pack,bss_seg,data_seg,"
|
||||
"inline_recursion,pointers_to_members1,check_stack,"
|
||||
"function,intrinsic,setlocale,code_seg,hdrstop,message,"
|
||||
"vtordisp1,const_seg,include_alias,once,warning";
|
||||
|
||||
AddKeyword(sKeywords,CLR_KEYWORD,GRP_KEYWORD);
|
||||
AddKeyword(sDirectives,CLR_KEYWORD,GRP_KEYWORD);
|
||||
AddKeyword(sPragmas,CLR_KEYWORD,GRP_KEYWORD);
|
||||
}
|
||||
|
||||
void CSyntaxColorizer::createTables()
|
||||
{
|
||||
m_pTableZero = new unsigned char[256]; m_pTableOne = new unsigned char[256];
|
||||
m_pTableTwo = new unsigned char[256]; m_pTableThree = new unsigned char[256];
|
||||
m_pTableFour = new unsigned char[256]; m_pAllowable = new unsigned char[256];
|
||||
|
||||
memset(m_pTableZero,SKIP,256); memset(m_pTableOne,SKIP,256);
|
||||
memset(m_pTableTwo,SKIP,256); memset(m_pTableThree,SKIP,256);
|
||||
memset(m_pTableFour,SKIP,256); memset(m_pAllowable,false,256);
|
||||
|
||||
*(m_pTableZero + int('"')) = DQSTART; *(m_pTableZero + int('\'')) = SQSTART;
|
||||
*(m_pTableZero + int('/')) = CMSTART; *(m_pTableOne + int('"')) = DQEND;
|
||||
*(m_pTableTwo + int('\'')) = SQEND;
|
||||
*(m_pTableFour + int('*')) = MLEND;
|
||||
|
||||
*(m_pAllowable + int('\n')) = true; *(m_pAllowable + int('\r')) = true;
|
||||
*(m_pAllowable + int('\t')) = true; *(m_pAllowable + int('\0')) = true;
|
||||
*(m_pAllowable + int(' ')) = true; *(m_pAllowable + int(';')) = true;
|
||||
*(m_pAllowable + int('(')) = true; *(m_pAllowable + int(')')) = true;
|
||||
*(m_pAllowable + int('{')) = true; *(m_pAllowable + int('}')) = true;
|
||||
*(m_pAllowable + int('[')) = true; *(m_pAllowable + int(']')) = true;
|
||||
*(m_pAllowable + int('*')) = true;
|
||||
}
|
||||
|
||||
void CSyntaxColorizer::deleteTables()
|
||||
{
|
||||
delete m_pTableZero; delete m_pTableOne; delete m_pTableTwo;
|
||||
delete m_pTableThree; delete m_pTableFour; delete m_pAllowable;
|
||||
}
|
||||
|
||||
void CSyntaxColorizer::AddKeyword(const char *Keyword, const QBrush &cr, int grp)
|
||||
{
|
||||
QTextCharFormat cf = m_cfDefault;
|
||||
cf.setForeground(cr);
|
||||
|
||||
for (auto token : QString(Keyword).split(","))
|
||||
{
|
||||
addKey(token,cf,grp);
|
||||
}
|
||||
}
|
||||
|
||||
void CSyntaxColorizer::AddKeyword(const char *Keyword, const QTextCharFormat& cf, int grp)
|
||||
{
|
||||
for (auto token : QString(Keyword).split(","))
|
||||
{
|
||||
addKey(token,cf,grp);
|
||||
}
|
||||
}
|
||||
|
||||
void CSyntaxColorizer::addKey(const QString& Keyword, const QTextCharFormat& cf, int grp) //add in ascending order
|
||||
{
|
||||
SKeyword* pskNewKey = new SKeyword;
|
||||
SKeyword* prev,*curr;
|
||||
|
||||
pskNewKey->keyword = Keyword;
|
||||
|
||||
m_keywords[pskNewKey->keyword] = pskNewKey;
|
||||
|
||||
pskNewKey->cf = cf;
|
||||
pskNewKey->group = grp;
|
||||
pskNewKey->pNext = NULL;
|
||||
*(m_pTableZero + pskNewKey->keyword[0].toLatin1()) = KEYWORD;
|
||||
|
||||
//if list is empty, add first node
|
||||
if(m_pskKeyword == NULL)
|
||||
m_pskKeyword = pskNewKey;
|
||||
else
|
||||
{
|
||||
//check to see if new node goes before first node
|
||||
if(Keyword.compare(m_pskKeyword->keyword) < 0)
|
||||
{
|
||||
pskNewKey->pNext = m_pskKeyword;
|
||||
m_pskKeyword = pskNewKey;
|
||||
}
|
||||
//check to see if new keyword already exists at the first node
|
||||
else if(Keyword == m_pskKeyword->keyword)
|
||||
{
|
||||
//the keyword exists, so replace the existing with the new
|
||||
pskNewKey->pNext = m_pskKeyword->pNext;
|
||||
delete m_pskKeyword;
|
||||
m_pskKeyword = pskNewKey;
|
||||
}
|
||||
else
|
||||
{
|
||||
prev = m_pskKeyword;
|
||||
curr = m_pskKeyword->pNext;
|
||||
while(curr != NULL && curr->keyword.compare(Keyword) < 0)
|
||||
{
|
||||
prev = curr;
|
||||
curr = curr->pNext;
|
||||
}
|
||||
if(curr != NULL && curr->keyword == Keyword)
|
||||
{
|
||||
//the keyword exists, so replace the existing with the new
|
||||
prev->pNext = pskNewKey;
|
||||
pskNewKey->pNext = curr->pNext;
|
||||
delete curr;
|
||||
}
|
||||
else
|
||||
{
|
||||
pskNewKey->pNext = curr;
|
||||
prev->pNext = pskNewKey;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CSyntaxColorizer::ClearKeywordList()
|
||||
{
|
||||
SKeyword* pTemp = m_pskKeyword;
|
||||
|
||||
m_keywords.clear();
|
||||
|
||||
while(m_pskKeyword != NULL)
|
||||
{
|
||||
*(m_pTableZero + m_pskKeyword->keyword[0].toLatin1()) = SKIP;
|
||||
pTemp = m_pskKeyword->pNext;
|
||||
delete m_pskKeyword;
|
||||
m_pskKeyword = pTemp;
|
||||
}
|
||||
}
|
||||
|
||||
QString CSyntaxColorizer::GetKeywordList()
|
||||
{
|
||||
QString sList;
|
||||
|
||||
SKeyword* pTemp = m_pskKeyword;
|
||||
|
||||
while(pTemp != NULL)
|
||||
{
|
||||
if(!sList.isEmpty())
|
||||
sList += QLatin1Char(',');
|
||||
sList += pTemp->keyword;
|
||||
pTemp = pTemp->pNext;
|
||||
}
|
||||
|
||||
return sList;
|
||||
}
|
||||
|
||||
QString CSyntaxColorizer::GetKeywordList(int grp)
|
||||
{
|
||||
QString sList;
|
||||
|
||||
SKeyword* pTemp = m_pskKeyword;
|
||||
|
||||
while(pTemp != NULL)
|
||||
{
|
||||
if(pTemp->group == grp)
|
||||
{
|
||||
if(!sList.isEmpty())
|
||||
sList += QLatin1Char(',');
|
||||
sList += pTemp->keyword;
|
||||
}
|
||||
pTemp = pTemp->pNext;
|
||||
}
|
||||
|
||||
return sList;
|
||||
}
|
||||
|
||||
void CSyntaxColorizer::SetCommentColor(const QBrush& cr)
|
||||
{
|
||||
QTextCharFormat cf = m_cfComment;
|
||||
cf.setForeground(cr);
|
||||
|
||||
SetCommentStyle(cf);
|
||||
}
|
||||
|
||||
void CSyntaxColorizer::SetStringColor(const QBrush& cr)
|
||||
{
|
||||
QTextCharFormat cf = m_cfString;
|
||||
|
||||
cf.setForeground(cr);
|
||||
|
||||
SetStringStyle(cf);
|
||||
}
|
||||
|
||||
void CSyntaxColorizer::SetGroupStyle(int grp, const QTextCharFormat& cf)
|
||||
{
|
||||
SKeyword* pTemp = m_pskKeyword;
|
||||
|
||||
while(pTemp != NULL)
|
||||
{
|
||||
if(pTemp->group == grp)
|
||||
{
|
||||
pTemp->cf = cf;
|
||||
}
|
||||
pTemp = pTemp->pNext;
|
||||
}
|
||||
}
|
||||
|
||||
void CSyntaxColorizer::GetGroupStyle(int grp, QTextCharFormat& cf)
|
||||
{
|
||||
SKeyword* pTemp = m_pskKeyword;
|
||||
|
||||
while(pTemp != NULL)
|
||||
{
|
||||
if(pTemp->group == grp)
|
||||
{
|
||||
cf = pTemp->cf;
|
||||
pTemp = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
pTemp = pTemp->pNext;
|
||||
//if grp is not found, return default style
|
||||
if(pTemp == NULL) cf = m_cfDefault;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CSyntaxColorizer::SetGroupColor(int grp, const QBrush& cr)
|
||||
{
|
||||
QTextCharFormat cf;
|
||||
GetGroupStyle(grp,cf);
|
||||
|
||||
cf.setForeground(cr);
|
||||
|
||||
SetGroupStyle(grp,cf);
|
||||
}
|
||||
|
||||
void CSyntaxColorizer::highlightBlock(const QString& text)
|
||||
{
|
||||
//setup some vars
|
||||
char sWord[4096];
|
||||
QTextCharFormat cf;
|
||||
const char *lpszTemp;
|
||||
long iStart = 0;
|
||||
long x = 0;
|
||||
SKeyword* pskTemp = m_pskKeyword;
|
||||
|
||||
QByteArray latin1Text = text.toLatin1();
|
||||
const char *lpszBuf = latin1Text.constData();
|
||||
|
||||
const unsigned char *ppTables[] = { m_pTableZero, m_pTableOne, m_pTableTwo, m_pTableThree, m_pTableFour };
|
||||
int iState = previousBlockState();
|
||||
if (iState == -1)
|
||||
iState = 0;
|
||||
|
||||
//do the work
|
||||
while(lpszBuf[x])
|
||||
{
|
||||
switch(ppTables[iState][int(lpszBuf[x])])
|
||||
{
|
||||
case DQSTART:
|
||||
iState = 1;
|
||||
iStart = x;
|
||||
break;
|
||||
case SQSTART:
|
||||
iState = 2;
|
||||
iStart = x;
|
||||
break;
|
||||
case CMSTART:
|
||||
if(lpszBuf[x+1] == '/')
|
||||
{
|
||||
iState = 3;
|
||||
iStart = x;
|
||||
x++;
|
||||
}
|
||||
else if(lpszBuf[x+1] == '*')
|
||||
{
|
||||
iState = 4;
|
||||
iStart = x;
|
||||
x++;
|
||||
}
|
||||
else if(lpszBuf[x] == '\'')
|
||||
{
|
||||
iState = 3;
|
||||
iStart = x;
|
||||
x++;
|
||||
}
|
||||
|
||||
break;
|
||||
case MLEND:
|
||||
if(lpszBuf[x+1] == '/')
|
||||
{
|
||||
x++;
|
||||
iState = 0;
|
||||
setFormat(iStart, x + 1 - iStart, m_cfComment);
|
||||
}
|
||||
break;
|
||||
case DQEND:
|
||||
iState = 0;
|
||||
setFormat(iStart, x + 1 - iStart, m_cfString);
|
||||
break;
|
||||
case SQEND:
|
||||
if(lpszBuf[x-1] == '\\' && lpszBuf[x+1] == '\'')
|
||||
break;
|
||||
iState = 0;
|
||||
setFormat(iStart, x + 1 - iStart, m_cfString);
|
||||
break;
|
||||
|
||||
case KEYWORD:
|
||||
// Extract whole word.
|
||||
lpszTemp = lpszBuf+x;
|
||||
{
|
||||
if (x > 0 && !m_pAllowable[int(lpszBuf[x-1])])
|
||||
break;
|
||||
|
||||
int i = 0;
|
||||
while (!m_pAllowable[int(lpszTemp[i])])
|
||||
{
|
||||
sWord[i] = lpszTemp[i];
|
||||
i++;
|
||||
}
|
||||
if (i > 0)
|
||||
{
|
||||
sWord[i] = 0;
|
||||
// Word extracted.
|
||||
// Find keyword.
|
||||
Keywords::iterator it = m_keywords.find( QString(sWord) );
|
||||
if (it != m_keywords.end())
|
||||
{
|
||||
int iStart2 = x;
|
||||
pskTemp = it->second;
|
||||
x += pskTemp->keyword.size();
|
||||
setFormat(iStart2, x - iStart2, pskTemp->cf);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
lpszTemp = lpszBuf+x;
|
||||
while(pskTemp != NULL)
|
||||
{
|
||||
if(pskTemp->keyword[0] == lpszTemp[0])
|
||||
{
|
||||
int x1=0,y1=0;iStart = iOffset + x;
|
||||
while(pskTemp->keyword[x1])
|
||||
{
|
||||
y1 += lpszTemp[x1] ^ pskTemp->keyword[x1];
|
||||
x1++;
|
||||
}
|
||||
if(y1 == 0 && (*(m_pAllowable + (lpszBuf[x-1])) &&
|
||||
*(m_pAllowable + (lpszBuf[x+pskTemp->keylen]))))
|
||||
{
|
||||
if(_stricmp(pskTemp->keyword,"rem") == 0)
|
||||
{
|
||||
pTable = m_pTableThree;
|
||||
}
|
||||
else
|
||||
{
|
||||
x += pskTemp->keylen;
|
||||
pCtrl->SetSel(iStart,iOffset + x);
|
||||
pCtrl->SetSelectionCharFormat(pskTemp->cf);
|
||||
}
|
||||
}
|
||||
}
|
||||
pskTemp = pskTemp->pNext;
|
||||
}
|
||||
*/
|
||||
pskTemp = m_pskKeyword;
|
||||
break;
|
||||
case SKIP:;
|
||||
}
|
||||
x++;
|
||||
}
|
||||
//sometimes we get to the end of the file before the end of the string
|
||||
//or comment, so we deal with that situation here
|
||||
if(iState == 1)
|
||||
{
|
||||
setFormat(iStart, x + 1 - iStart, m_cfString);
|
||||
}
|
||||
else if(iState == 2)
|
||||
{
|
||||
setFormat(iStart, x + 1 - iStart, m_cfString);
|
||||
}
|
||||
else if(iState == 3)
|
||||
{
|
||||
setFormat(iStart, x + 1 - iStart, m_cfComment);
|
||||
if(lpszBuf[x-2] != '\\') // line continuation character
|
||||
iState = 0;
|
||||
}
|
||||
else if(iState == 4)
|
||||
{
|
||||
setFormat(iStart, x + 1 - iStart, m_cfComment);
|
||||
}
|
||||
|
||||
setCurrentBlockState(iState);
|
||||
}
|
||||
|
||||
#include <Controls/moc_SyntaxColorizer.cpp>
|
||||
@@ -1,114 +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.
|
||||
|
||||
// Description : interface for the CSyntaxColorizer class.
|
||||
|
||||
|
||||
#ifndef CRYINCLUDE_EDITOR_CONTROLS_SYNTAXCOLORIZER_H
|
||||
#define CRYINCLUDE_EDITOR_CONTROLS_SYNTAXCOLORIZER_H
|
||||
#pragma once
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include <QSyntaxHighlighter>
|
||||
#endif
|
||||
|
||||
#define CLR_STRING QColor(55, 0, 200)
|
||||
#define CLR_PLAIN QColor(0, 0, 0)
|
||||
#define CLR_COMMENT QColor(0, 170, 0)
|
||||
#define CLR_KEYWORD QColor(0, 0, 255)
|
||||
#define GRP_KEYWORD 0
|
||||
|
||||
class CSyntaxColorizer
|
||||
: public QSyntaxHighlighter
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CSyntaxColorizer(QTextDocument* pParent = nullptr);
|
||||
virtual ~CSyntaxColorizer();
|
||||
|
||||
//protected vars
|
||||
protected:
|
||||
unsigned char* m_pTableZero, * m_pTableOne;
|
||||
unsigned char* m_pTableTwo, * m_pTableThree;
|
||||
unsigned char* m_pTableFour, * m_pAllowable;
|
||||
|
||||
enum Types
|
||||
{
|
||||
SKIP,
|
||||
DQSTART, //Double Quotes start
|
||||
DQEND, //Double Quotes end
|
||||
SQSTART, //Single Quotes start
|
||||
SQEND, //Single Quotes end
|
||||
CMSTART, //Comment start (both single and multi line)
|
||||
MLEND, //Multi line comment end
|
||||
KEYWORD //Keyword start
|
||||
} m_type;
|
||||
|
||||
struct SKeyword
|
||||
{
|
||||
QString keyword;
|
||||
int keylen;
|
||||
QTextCharFormat cf;
|
||||
int group;
|
||||
SKeyword* pNext;
|
||||
SKeyword() { pNext = NULL; }
|
||||
};
|
||||
|
||||
SKeyword* m_pskKeyword;
|
||||
QTextCharFormat m_cfComment;
|
||||
QTextCharFormat m_cfString;
|
||||
QTextCharFormat m_cfDefault;
|
||||
|
||||
//typedef std::map<LPCSTR,SKeyword*,> Keywords;
|
||||
//typedef std::hash_map<const char*,SKeyword*,stl::hash_strcmp<const char*> > Keywords;
|
||||
|
||||
//typedef std::map<const char*,SKeyword*,stl::hash_strcmp<const char*> > Keywords;
|
||||
typedef std::map<QString, SKeyword*> Keywords;
|
||||
|
||||
Keywords m_keywords;
|
||||
|
||||
//protected member functions
|
||||
protected:
|
||||
void addKey(const QString& Keyword, const QTextCharFormat& cf, int grp);
|
||||
void createTables();
|
||||
void deleteTables();
|
||||
void createDefaultKeywordList();
|
||||
void createDefaultCharFormat();
|
||||
|
||||
//public member functions
|
||||
public:
|
||||
void highlightBlock(const QString& text) override;
|
||||
|
||||
void GetCommentStyle(QTextCharFormat& cf) { cf = m_cfComment; };
|
||||
void GetStringStyle(QTextCharFormat& cf) { cf = m_cfString; };
|
||||
void GetGroupStyle(int grp, QTextCharFormat& cf);
|
||||
void GetDefaultStyle(QTextCharFormat& cf) { cf = m_cfDefault; };
|
||||
|
||||
void SetCommentStyle(const QTextCharFormat& cf) { m_cfComment = cf; };
|
||||
void SetCommentColor(const QBrush& cr);
|
||||
void SetStringStyle(const QTextCharFormat& cf) { m_cfString = cf; };
|
||||
void SetStringColor(const QBrush& cr);
|
||||
void SetGroupStyle(int grp, const QTextCharFormat& cf);
|
||||
void SetGroupColor(int grp, const QBrush& cr);
|
||||
void SetDefaultStyle(const QTextCharFormat& cf) { m_cfDefault = cf; };
|
||||
|
||||
void AddKeyword(const char* Keyword, const QTextCharFormat& cf, int grp = 0);
|
||||
void AddKeyword(const char* Keyword, const QBrush& cr, int grp = 0);
|
||||
void ClearKeywordList();
|
||||
QString GetKeywordList();
|
||||
QString GetKeywordList(int grp);
|
||||
};
|
||||
|
||||
#endif // CRYINCLUDE_EDITOR_CONTROLS_SYNTAXCOLORIZER_H
|
||||
|
||||
@@ -15,69 +15,12 @@
|
||||
|
||||
#include "TextEditorCtrl.h"
|
||||
|
||||
#define GRP_KEYWORD 0
|
||||
#define GRP_CONSTANTS 1
|
||||
#define GRP_DIRECTIVE 2
|
||||
#define GRP_PRAGMA 3
|
||||
|
||||
|
||||
// CTextEditorCtrl
|
||||
|
||||
CTextEditorCtrl::CTextEditorCtrl(QWidget* pParent)
|
||||
: QTextEdit(pParent)
|
||||
, m_sc(document())
|
||||
{
|
||||
/*
|
||||
//reconfigure CSyntaxColorizer's default keyword groupings
|
||||
LPTSTR sKeywords = "for,for,else,main,struct,enum,switch,auto,"
|
||||
"template,explicit,this,bool,extern,thread,break,false,"
|
||||
"throw,case,namespace,true,catch,new,try,float,noreturn,"
|
||||
"char,operator,typedef,class,friend,private,const,goto,"
|
||||
"protected,typename,if,public,union,continue,inline,"
|
||||
"unsigned,using,directive,default,int,return,delete,short,"
|
||||
"signed,virtual,sizeof,void,do,static,double,long,while";
|
||||
LPTSTR sDirectives = "#define,#elif,#else,#endif,#error,#ifdef,"
|
||||
"#ifndef,#import,#include,#line,#pragma,#undef";
|
||||
LPTSTR sPragmas = "comment,optimize,auto_inline,once,warning,"
|
||||
"component,pack,function,intrinsic,setlocale,hdrstop,message";
|
||||
|
||||
m_sc.ClearKeywordList();
|
||||
m_sc.AddKeyword(sKeywords,QColor(0,0,255),GRP_KEYWORD);
|
||||
m_sc.AddKeyword(sDirectives,QColor(0,0,255),GRP_DIRECTIVE);
|
||||
m_sc.AddKeyword(sPragmas,QColor(0,0,255),GRP_PRAGMA);
|
||||
m_sc.AddKeyword("REM,Rem,rem",QColor(255,0,255),4);
|
||||
*/
|
||||
const char* sKeywords = "Shader,ShadeLayer,HW,LightStyle,ValueString,Orient,Origin,Params,Array,Template,Templates,"
|
||||
"Version,CGVProgram,CGVPParam,Name,"
|
||||
"DeclareLightMaterial,Side,Ambient,Diffuse,Specular,Emission,Shininess,"
|
||||
"Layer,Map,RGBGen,RgbGen,AlphaGen,NoDepthTest,Blend,TexCoordMod,Scale,UScale,VScale,ShiftNoise,Noise,SRange,TRange,"
|
||||
"Cull,Sort,State,NoCull,ShadowMapGen,Conditions,Vars,DepthWrite,NoColorMask,Portal,LMNoAlpha,"
|
||||
"TexColorOp,TexStage,TexType,TexFilter,TexGen,UpdateStyle,EvalLight,Style,TexDecal,Tex1Decal,TexBump,"
|
||||
"RCParam,RCombiner,RShader,TSParam,Reg,Comp,DepthMask,AlphaFunc,Light,LightType,ClipPlane,PlaneS,PlaneT,"
|
||||
"PolygonOffset,NoLightmap,ShineMap,Turbulence,tcMod,Procedure,TessSize,Spark,Sequence,Maps,Time,Loop,"
|
||||
"Mask,Public,float,RenderParams,User,"
|
||||
"rgbGen,blend,map,"
|
||||
"Translate,Identity,Rotate,RotateX,RotateY,RotateZ,Div,DeformGen,Scroll,UScroll,VScroll,Angle"
|
||||
"Type,Level,Amp,Phase,Freq,DeformVertexes,FlareSize,NoLight,Const,Start,"
|
||||
"Matrix,FLOAT,BYTE,Verts,Vertex,Normal,Normals,Color,Texture0,Texture1,Texture2,Texture3,Texture4,TNormals";
|
||||
|
||||
const char* sConstants = "Decal,None,Nearest,TwoSided,RCRGBToAlpha,OcclusionTest,NoSet,Replace,FromClient,"
|
||||
"Opaque,MonitorNoise,Point,Front,Back,Water,TriLinear,"
|
||||
"MuzzleFlash,FromObj,Modulate,Base,SphereMap,Add,Glare,Additive,Intensity,White,Sin,Cos,Tan,"
|
||||
"$Diffuse,$None,$Specular,$Whiteimage,$Environment,$Glare,$Opacity,$Flare";
|
||||
|
||||
const char* sDirectives = "#define,#elif,#else,#endif,#error,#ifdef,"
|
||||
"#ifndef,#import,#include,#line,#pragma,#undef";
|
||||
|
||||
m_sc.ClearKeywordList();
|
||||
m_sc.AddKeyword(sKeywords, QColor(0, 0, 255), GRP_KEYWORD);
|
||||
m_sc.AddKeyword(sConstants, QColor(180, 0, 110), GRP_CONSTANTS);
|
||||
m_sc.AddKeyword(sDirectives, QColor(160, 0, 160), GRP_DIRECTIVE);
|
||||
|
||||
m_sc.SetCommentColor(QColor(0, 128, 128));
|
||||
m_sc.SetStringColor(QColor(0, 128, 0));
|
||||
|
||||
m_bModified = true;
|
||||
m_bModified = true;
|
||||
|
||||
QFont font;
|
||||
font.setFamily("Courier New");
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
|
||||
// CTextEditorCtrl
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include "SyntaxColorizer.h"
|
||||
|
||||
#include <QTextEdit>
|
||||
#endif
|
||||
|
||||
@@ -42,7 +40,6 @@ public:
|
||||
|
||||
protected:
|
||||
QString m_filename;
|
||||
CSyntaxColorizer m_sc;
|
||||
bool m_bModified;
|
||||
};
|
||||
|
||||
|
||||
@@ -331,11 +331,6 @@ void LevelEditorMenuHandler::ResetToolsMenus()
|
||||
|
||||
CreateMenuOptions(&menuMap, otherSubMenu, LyViewPane::CategoryOther);
|
||||
|
||||
// Plug-Ins
|
||||
auto plugInsMenu = m_toolsMenu.AddMenu(QObject::tr("Plug-Ins"));
|
||||
|
||||
CreateMenuOptions(&menuMap, plugInsMenu, LyViewPane::CategoryPlugIns);
|
||||
|
||||
m_toolsMenu.AddSeparator();
|
||||
|
||||
// Optional Sub Menus
|
||||
|
||||
@@ -1933,9 +1933,11 @@ BOOL CCryEditApp::InitInstance()
|
||||
if (GetIEditor()->GetCommandManager()->IsRegistered("editor.open_lnm_editor"))
|
||||
{
|
||||
CCommand0::SUIInfo uiInfo;
|
||||
bool ok = GetIEditor()->GetCommandManager()->GetUIInfo("editor.open_lnm_editor", uiInfo);
|
||||
#if !defined(NDEBUG)
|
||||
bool ok =
|
||||
#endif
|
||||
GetIEditor()->GetCommandManager()->GetUIInfo("editor.open_lnm_editor", uiInfo);
|
||||
assert(ok);
|
||||
int ID_VIEW_AI_LNMEDITOR(uiInfo.commandId);
|
||||
}
|
||||
|
||||
RunInitPythonScript(cmdInfo);
|
||||
@@ -2481,7 +2483,6 @@ int CCryEditApp::IdleProcessing(bool bBackgroundUpdate)
|
||||
static AZStd::chrono::system_clock::time_point lastUpdate = now;
|
||||
|
||||
AZStd::chrono::duration<float> delta = now - lastUpdate;
|
||||
float deltaTime = delta.count();
|
||||
|
||||
lastUpdate = now;
|
||||
|
||||
@@ -4837,7 +4838,6 @@ void CCryEditApp::OnEditRenameobject()
|
||||
QString newName;
|
||||
QString str = dlg.GetString();
|
||||
int num = 0;
|
||||
bool bWarningShown = false;
|
||||
|
||||
for (int i = 0; i < pSelection->GetCount(); ++i)
|
||||
{
|
||||
@@ -4952,7 +4952,6 @@ void CCryEditApp::OnValidateObjectPositions()
|
||||
std::vector<CBaseObject*> foundObjects;
|
||||
|
||||
std::vector<GUID> objIDs;
|
||||
bool reportVeg = false;
|
||||
|
||||
for (int i1 = 0; i1 < objCount; ++i1)
|
||||
{
|
||||
@@ -5391,7 +5390,6 @@ void CCryEditApp::SetEditorWindowTitle(QString sTitleStr, QString sPreTitleStr,
|
||||
if (MainWindow::instance() || m_pConsoleDialog)
|
||||
{
|
||||
QString platform = "";
|
||||
const SFileVersion& v = GetIEditor()->GetFileVersion();
|
||||
|
||||
#ifdef WIN64
|
||||
platform = "[x64]";
|
||||
@@ -5492,7 +5490,7 @@ void CCryEditApp::StartProcessDetached(const char* process, const char* args)
|
||||
}
|
||||
|
||||
// Launch the process
|
||||
bool startDetachedReturn = QProcess::startDetached(
|
||||
[[maybe_unused]] bool startDetachedReturn = QProcess::startDetached(
|
||||
process,
|
||||
argsList,
|
||||
QCoreApplication::applicationDirPath()
|
||||
|
||||
@@ -70,7 +70,6 @@ void CDisplaySettings::LoadRegistry()
|
||||
|
||||
void CDisplaySettings::SetObjectHideMask(int hideMask)
|
||||
{
|
||||
int prevMask = m_objectHideMask;
|
||||
m_objectHideMask = hideMask;
|
||||
|
||||
gSettings.objectHideMask = m_objectHideMask;
|
||||
@@ -87,7 +86,6 @@ void CDisplaySettings::PostInitApply()
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CDisplaySettings::SetRenderFlags(int flags)
|
||||
{
|
||||
int prev = m_renderFlags;
|
||||
m_renderFlags = flags;
|
||||
|
||||
if (!GetIEditor()->Get3DEngine())
|
||||
|
||||
@@ -70,8 +70,6 @@ CObjectMode::~CObjectMode()
|
||||
|
||||
void CObjectMode::DrawSelectionPreview(struct DisplayContext& dc, CBaseObject* drawObject)
|
||||
{
|
||||
int childColVal = 0;
|
||||
|
||||
AABB bbox;
|
||||
drawObject->GetBoundBox(bbox);
|
||||
|
||||
@@ -312,7 +310,6 @@ bool CObjectMode::OnLButtonDown(CViewport* view, int nFlags, const QPoint& point
|
||||
|
||||
// CPointF ptMarker;
|
||||
QPoint ptCoord;
|
||||
int iCurSel = -1;
|
||||
|
||||
if (GetIEditor()->IsInGameMode() || GetIEditor()->IsInSimulationMode())
|
||||
{
|
||||
|
||||
@@ -79,7 +79,6 @@ bool CEditorFileMonitor::RegisterListener(IFileChangeListener* pListener, const
|
||||
CFileChangeMonitor* fileChangeMonitor = CFileChangeMonitor::Instance();
|
||||
AZ_Assert(fileChangeMonitor, "CFileChangeMonitor singleton missing.");
|
||||
|
||||
int modIndex = 0;
|
||||
naivePath += gameFolder;
|
||||
// Append slash in preparation for appending the second part.
|
||||
naivePath = PathUtil::AddSlash(naivePath);
|
||||
|
||||
@@ -283,7 +283,6 @@ public:
|
||||
settings.remove("Hotkeys/");
|
||||
settings.sync();
|
||||
settings.beginWriteArray(group);
|
||||
int hotkeyCount = hotkeys.count();
|
||||
int saveIndex = 0;
|
||||
for (HotKey key : hotkeys)
|
||||
{
|
||||
|
||||
@@ -692,7 +692,6 @@ void EditorViewportWidget::OnEditorNotifyEvent(EEditorNotifyEvent event)
|
||||
m_previousContext = SetCurrentContext();
|
||||
}
|
||||
SetCurrentCursor(STD_CURSOR_GAME);
|
||||
AzFramework::InputSystemCursorConstraintRequestBus::Handler::BusConnect();
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -700,7 +699,6 @@ void EditorViewportWidget::OnEditorNotifyEvent(EEditorNotifyEvent event)
|
||||
case eNotify_OnEndGameMode:
|
||||
if (GetIEditor()->GetViewManager()->GetGameViewport() == this)
|
||||
{
|
||||
AzFramework::InputSystemCursorConstraintRequestBus::Handler::BusDisconnect();
|
||||
SetCurrentCursor(STD_CURSOR_DEFAULT);
|
||||
if (gSettings.bEnableGameModeVR)
|
||||
{
|
||||
@@ -894,10 +892,6 @@ void EditorViewportWidget::OnBeginPrepareRender()
|
||||
|
||||
GetIEditor()->GetSystem()->SetViewCamera(m_Camera);
|
||||
|
||||
CGameEngine* ge = GetIEditor()->GetGameEngine();
|
||||
|
||||
bool levelIsDisplayable = (ge && ge->IsLevelLoaded() && GetIEditor()->GetDocument() && GetIEditor()->GetDocument()->IsDocumentReady());
|
||||
|
||||
PreWidgetRendering();
|
||||
|
||||
RenderAll();
|
||||
@@ -1251,10 +1245,14 @@ void EditorViewportWidget::ConnectViewportInteractionRequestBus()
|
||||
AzToolsFramework::ViewportInteraction::ViewportFreezeRequestBus::Handler::BusConnect(GetViewportId());
|
||||
AzToolsFramework::ViewportInteraction::MainEditorViewportInteractionRequestBus::Handler::BusConnect(GetViewportId());
|
||||
m_viewportUi.ConnectViewportUiBus(GetViewportId());
|
||||
|
||||
AzFramework::InputSystemCursorConstraintRequestBus::Handler::BusConnect();
|
||||
}
|
||||
|
||||
void EditorViewportWidget::DisconnectViewportInteractionRequestBus()
|
||||
{
|
||||
AzFramework::InputSystemCursorConstraintRequestBus::Handler::BusDisconnect();
|
||||
|
||||
m_viewportUi.DisconnectViewportUiBus();
|
||||
AzToolsFramework::ViewportInteraction::MainEditorViewportInteractionRequestBus::Handler::BusDisconnect();
|
||||
AzToolsFramework::ViewportInteraction::ViewportFreezeRequestBus::Handler::BusDisconnect();
|
||||
@@ -2799,6 +2797,20 @@ void EditorViewportWidget::UpdateCurrentMousePos(const QPoint& newPosition)
|
||||
m_mousePos = newPosition;
|
||||
}
|
||||
|
||||
void* EditorViewportWidget::GetSystemCursorConstraintWindow() const
|
||||
{
|
||||
AzFramework::SystemCursorState systemCursorState = AzFramework::SystemCursorState::Unknown;
|
||||
|
||||
AzFramework::InputSystemCursorRequestBus::EventResult(
|
||||
systemCursorState, AzFramework::InputDeviceMouse::Id, &AzFramework::InputSystemCursorRequests::GetSystemCursorState);
|
||||
|
||||
const bool systemCursorConstrained =
|
||||
(systemCursorState == AzFramework::SystemCursorState::ConstrainedAndHidden ||
|
||||
systemCursorState == AzFramework::SystemCursorState::ConstrainedAndVisible);
|
||||
|
||||
return systemCursorConstrained ? renderOverlayHWND() : nullptr;
|
||||
}
|
||||
|
||||
void EditorViewportWidget::BuildDragDropContext(AzQtComponents::ViewportDragContext& context, const QPoint& pt)
|
||||
{
|
||||
const auto scaledPoint = WidgetToViewport(pt);
|
||||
|
||||
@@ -574,7 +574,7 @@ protected:
|
||||
bool CheckRespondToInput() const;
|
||||
|
||||
// AzFramework::InputSystemCursorConstraintRequestBus
|
||||
void* GetSystemCursorConstraintWindow() const override { return renderOverlayHWND(); }
|
||||
void* GetSystemCursorConstraintWindow() const override;
|
||||
|
||||
void BuildDragDropContext(AzQtComponents::ViewportDragContext& context, const QPoint& pt) override;
|
||||
|
||||
|
||||
@@ -271,7 +271,6 @@ void CErrorReportDialog::OnReportColumnRClick()
|
||||
actionAlignRight->setCheckable(true);
|
||||
actionAlignCenter->setCheckable(true);
|
||||
|
||||
int nAlignOption = 0;
|
||||
const int alignment = m_errorReportModel->headerData(column, Qt::Horizontal, Qt::TextAlignmentRole).toInt();
|
||||
actionAlignLeft->setChecked(alignment & Qt::AlignLeft);
|
||||
actionAlignRight->setChecked(alignment & Qt::AlignRight);
|
||||
|
||||
@@ -149,7 +149,7 @@ QVariant CErrorReportTableModel::data(const CErrorRecord& record, int column, in
|
||||
case ColumnCount:
|
||||
return record.count;
|
||||
case ColumnText:
|
||||
return record.error;
|
||||
return QString(record.error).simplified();
|
||||
case ColumnFile:
|
||||
return record.file;
|
||||
case ColumnObject:
|
||||
|
||||
@@ -247,8 +247,6 @@ void CExportManager::AddEntityAnimationData(const CTrackViewTrack* pTrack, Expor
|
||||
float fOutTantentX = tout[0];
|
||||
float fOutTantentY = tout[1];
|
||||
|
||||
float fTangentDelta = 0.01f;
|
||||
|
||||
if (fInTantentX == 0.0f)
|
||||
{
|
||||
fInTantentX = kTangentDelta;
|
||||
@@ -789,8 +787,6 @@ bool CExportManager::ProcessObjectsForExport()
|
||||
float fpsTimeInterval = 1.0f / m_FBXBakedExportFPS;
|
||||
float timeValue = 0.0f;
|
||||
|
||||
IObjectManager* pObjMgr = GetIEditor()->GetObjectManager();
|
||||
|
||||
GetIEditor()->GetAnimation()->SetRecording(false);
|
||||
GetIEditor()->GetAnimation()->SetPlaying(false);
|
||||
|
||||
@@ -814,7 +810,6 @@ bool CExportManager::ProcessObjectsForExport()
|
||||
|
||||
if (QString::compare(pObj2->name, kMasterCameraName) == 0)
|
||||
{
|
||||
REFGUID camGUID = GetIEditor()->GetViewManager()->GetCameraObjectId();
|
||||
pObject = GetIEditor()->GetObjectManager()->FindObject(GetIEditor()->GetViewManager()->GetCameraObjectId());
|
||||
}
|
||||
else
|
||||
|
||||
@@ -321,7 +321,7 @@ void KillMemory(IConsoleCmdArgs* /* pArgs */)
|
||||
size = size > kLimit ? kLimit : size;
|
||||
}
|
||||
|
||||
uint8* alloc = new uint8[size];
|
||||
new uint8[size];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -712,8 +712,6 @@ void CGameEngine::SwitchToInGame()
|
||||
gEnv->p3DEngine->ResetParticlesAndDecals();
|
||||
}
|
||||
|
||||
CViewport* pGameViewport = GetIEditor()->GetViewManager()->GetGameViewport();
|
||||
|
||||
m_pISystem->GetIMovieSystem()->EnablePhysicsEvents(true);
|
||||
m_bInGameMode = true;
|
||||
|
||||
|
||||
@@ -123,8 +123,6 @@ bool CGameExporter::Export(unsigned int flags, [[maybe_unused]] EEndian eExportE
|
||||
}
|
||||
else
|
||||
{
|
||||
CObjectManager* pObjectManager = static_cast<CObjectManager*>(pEditor->GetObjectManager());
|
||||
|
||||
QDir::setCurrent(pEditor->GetPrimaryCDFolder());
|
||||
|
||||
// Close all Editor tools
|
||||
@@ -284,8 +282,6 @@ void CGameExporter::ExportVisAreas(const char* pszGamePath, EEndian eExportEndia
|
||||
sprintf_s(szFileOutputPath, "%s%s", pszGamePath, COMPILED_VISAREA_MAP_FILE_NAME);
|
||||
m_levelPak.m_pakFile.RemoveFile(szFileOutputPath);
|
||||
|
||||
SHotUpdateInfo* pExportInfo = NULL;
|
||||
|
||||
SHotUpdateInfo exportInfo;
|
||||
I3DEngine* p3DEngine = pEditor->Get3DEngine();
|
||||
|
||||
|
||||
@@ -491,7 +491,7 @@ void GraphicsSettingsDialog::LoadPlatformConfigurations()
|
||||
m_currentConfigFilename = m_cfgFiles[m_currentPlatform][cfgFileIndex];
|
||||
GetISystem()->LoadConfiguration(m_currentConfigFilename.c_str(), this, true);
|
||||
|
||||
CVarGroupInfo& specFileGroup = m_cvarGroupData["SpecFile"];
|
||||
/*CVarGroupInfo& specFileGroup =*/ m_cvarGroupData["SpecFile"];
|
||||
m_graphicsSettingsModel->setHeaderData(cfgFileIndex + CVAR_VALUE_COLUMN_OFFSET, Qt::Horizontal, QApplication::translate("GraphicsSettingsDialog", m_cfgFiles[m_currentPlatform][cfgFileIndex].c_str()));
|
||||
}
|
||||
|
||||
|
||||
@@ -998,7 +998,6 @@ CBaseObject* CEditorImpl::CloneObject(CBaseObject* obj)
|
||||
|
||||
CBaseObject* CEditorImpl::GetSelectedObject()
|
||||
{
|
||||
CBaseObject* obj = nullptr;
|
||||
if (m_pObjectManager->GetSelection()->GetCount() != 1)
|
||||
{
|
||||
return nullptr;
|
||||
|
||||
@@ -166,7 +166,6 @@ int CIconManager::GetIconTexture(const char* iconName)
|
||||
if (QString::compare(ext, "bmp", Qt::CaseInsensitive) == 0 || QString::compare(ext, "jpg", Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
int sz = image.GetWidth() * image.GetHeight();
|
||||
int h = image.GetHeight();
|
||||
uint8* buf = (uint8*)image.GetData();
|
||||
for (int i = 0; i < sz; i++)
|
||||
{
|
||||
|
||||
@@ -466,9 +466,6 @@ void CInfoBar::IdleUpdate()
|
||||
}
|
||||
|
||||
{
|
||||
int settings = GetIEditor()->GetDisplaySettings()->GetSettings();
|
||||
bool noCollision = settings & SETTINGS_NOCOLLISION;
|
||||
|
||||
bool bPhysics = GetIEditor()->GetGameEngine()->GetSimulationMode();
|
||||
if ((ui->m_physicsBtn->isChecked() && !bPhysics) ||
|
||||
(!ui->m_physicsBtn->isChecked() && bPhysics))
|
||||
|
||||
@@ -633,7 +633,6 @@ bool CLayoutWnd::LoadConfig()
|
||||
{
|
||||
const QString str = settings.value("Viewports").toString();
|
||||
int nIndex = 1;
|
||||
int curPos = 0;
|
||||
for (auto resToken : str.split(","))
|
||||
{
|
||||
if (nIndex >= MAX_VIEWPORTS)
|
||||
|
||||
@@ -185,10 +185,18 @@ int QLensFlareAtomicListModel::rowCount(const QModelIndex& parent) const
|
||||
QVariant QLensFlareAtomicListModel::data(const QModelIndex& index, int role) const
|
||||
{
|
||||
Item* item;
|
||||
if (!index.isValid() || !(item = ItemFromIndex(index)))
|
||||
if (!index.isValid())
|
||||
{
|
||||
return QVariant();
|
||||
}
|
||||
else
|
||||
{
|
||||
item = ItemFromIndex(index);
|
||||
if (!item)
|
||||
{
|
||||
return QVariant();
|
||||
}
|
||||
}
|
||||
|
||||
switch (role)
|
||||
{
|
||||
@@ -212,10 +220,18 @@ QVariant QLensFlareAtomicListModel::data(const QModelIndex& index, int role) con
|
||||
bool QLensFlareAtomicListModel::setData(const QModelIndex& index, const QVariant& value, int role)
|
||||
{
|
||||
Item* item;
|
||||
if (!index.isValid() || !(item = ItemFromIndex(index)))
|
||||
if (index.isValid())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
item = ItemFromIndex(index);
|
||||
if (!item)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
switch (role)
|
||||
{
|
||||
@@ -247,10 +263,18 @@ Qt::ItemFlags QLensFlareAtomicListModel::flags(const QModelIndex& index) const
|
||||
EFlareType QLensFlareAtomicListModel::FlareTypeFromIndex(QModelIndex index) const
|
||||
{
|
||||
Item* item;
|
||||
if (!index.isValid() || !(item = ItemFromIndex(index)))
|
||||
if (!index.isValid())
|
||||
{
|
||||
return eFT_Max;
|
||||
}
|
||||
else
|
||||
{
|
||||
item = ItemFromIndex(index);
|
||||
if (!item)
|
||||
{
|
||||
return eFT_Max;
|
||||
}
|
||||
}
|
||||
|
||||
return item->flareType;
|
||||
}
|
||||
|
||||
@@ -311,7 +311,6 @@ void CLevelFileDialog::OnNewFolder()
|
||||
if (!isLevelFolder && index.isValid())
|
||||
{
|
||||
const QString parentFullPath = index.data(LevelTreeModel::FullPathRole).toString();
|
||||
bool ok = false;
|
||||
QInputDialog inputDlg(this);
|
||||
inputDlg.setLabelText(tr("Please select a folder name"));
|
||||
|
||||
|
||||
@@ -250,7 +250,8 @@ bool CLinkTool::ChildIsValid(CBaseObject* pParent, CBaseObject* pChild, int nDir
|
||||
CBaseObject* pObj;
|
||||
if (nDir & 1)
|
||||
{
|
||||
if (pObj = pChild->GetParent())
|
||||
pObj = pChild->GetParent();
|
||||
if (pObj)
|
||||
{
|
||||
if (!ChildIsValid(pParent, pObj, 1))
|
||||
{
|
||||
@@ -262,7 +263,8 @@ bool CLinkTool::ChildIsValid(CBaseObject* pParent, CBaseObject* pChild, int nDir
|
||||
{
|
||||
for (int i = 0; i < pChild->GetChildCount(); i++)
|
||||
{
|
||||
if (pObj = pChild->GetChild(i))
|
||||
pObj = pChild->GetChild(i);
|
||||
if (pObj)
|
||||
{
|
||||
if (!ChildIsValid(pParent, pObj, 2))
|
||||
{
|
||||
|
||||
@@ -192,7 +192,6 @@ void CLogFile::AboutSystem()
|
||||
char szProfileBuffer[128];
|
||||
char szLanguageBuffer[64];
|
||||
//char szCPUModel[64];
|
||||
char* pChar = 0;
|
||||
MEMORYSTATUS MemoryStatus;
|
||||
#endif // defined(AZ_PLATFORM_WINDOWS) || defined(AZ_PLATFORM_LINUX)
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ namespace LyViewPane
|
||||
{
|
||||
static const char* const CategoryTools = "Tools";
|
||||
static const char* const CategoryOther = "Other";
|
||||
static const char* const CategoryPlugIns = "Plug-Ins";
|
||||
//----
|
||||
static const char* const CategoryEditor = "Editor";
|
||||
static const char* const CategoryViewport = "Viewport";
|
||||
|
||||
@@ -637,8 +637,6 @@ MainWindow* MainWindow::instance()
|
||||
|
||||
void MainWindow::closeEvent(QCloseEvent* event)
|
||||
{
|
||||
auto cryEdit = CCryEditApp::instance();
|
||||
|
||||
gSettings.Save();
|
||||
|
||||
AzFramework::SystemCursorState currentCursorState;
|
||||
@@ -1819,7 +1817,6 @@ void MainWindow::OnUpdateSnapToGrid(QAction* action)
|
||||
bool bEnabled = gSettings.pGrid->IsEnabled();
|
||||
action->setChecked(bEnabled);
|
||||
|
||||
float gridSize = gSettings.pGrid->size;
|
||||
action->setText(QObject::tr("Snap To Grid"));
|
||||
}
|
||||
|
||||
@@ -1846,7 +1843,14 @@ void MainWindow::OpenViewPane(QtViewPane* pane)
|
||||
}
|
||||
else
|
||||
{
|
||||
qWarning() << Q_FUNC_INFO << "Invalid pane" << pane->m_id << pane->m_category << pane->m_name;
|
||||
if (pane)
|
||||
{
|
||||
qWarning() << Q_FUNC_INFO << "Invalid pane" << pane->m_id << pane->m_category << pane->m_name;
|
||||
}
|
||||
else
|
||||
{
|
||||
qWarning() << Q_FUNC_INFO << "Invalid pane";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -131,9 +131,8 @@ void CMatEditPreviewDlg::OnPreviewCustom()
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMatEditPreviewDlg message handlers
|
||||
|
||||
void CMatEditPreviewDlg::OnDataBaseItemEvent(IDataBaseItem* pItem, EDataBaseItemEvent event)
|
||||
void CMatEditPreviewDlg::OnDataBaseItemEvent([[maybe_unused]] IDataBaseItem* pItem, EDataBaseItemEvent event)
|
||||
{
|
||||
CMaterial* pMtl = (CMaterial*)pItem;
|
||||
switch (event)
|
||||
{
|
||||
case EDB_ITEM_EVENT_SELECTED:
|
||||
|
||||
@@ -1199,8 +1199,6 @@ bool CMaterial::IsBreakable2D() const
|
||||
return false;
|
||||
}
|
||||
|
||||
int result = 0;
|
||||
|
||||
const QString& surfaceTypeName = GetSurfaceTypeName();
|
||||
if (ISurfaceTypeManager* pSurfaceManager = GetIEditor()->Get3DEngine()->GetMaterialManager()->GetSurfaceTypeManager())
|
||||
{
|
||||
|
||||
@@ -120,7 +120,7 @@ MaterialBrowserWidget::MaterialBrowserWidget(QWidget* parent)
|
||||
connect(m_ui->treeView, &QWidget::customContextMenuRequested, this, [=](const QPoint& point)
|
||||
{
|
||||
CMaterialBrowserRecord record;
|
||||
bool found = TryGetSelectedRecord(record);
|
||||
TryGetSelectedRecord(record);
|
||||
ShowContextMenu(record, point);
|
||||
});
|
||||
|
||||
@@ -417,8 +417,6 @@ void MaterialBrowserWidget::SelectItem(IDataBaseItem* pItem, [[maybe_unused]] ID
|
||||
return;
|
||||
}
|
||||
|
||||
bool bFound = false;
|
||||
|
||||
_smart_ptr<CMaterial> material = static_cast<CMaterial*>(pItem);
|
||||
SetSelectedItem(material, 0, true);
|
||||
}
|
||||
|
||||
@@ -1934,7 +1934,6 @@ void CMaterialDialog::OnUpdateProperties(IVariable* var)
|
||||
}
|
||||
|
||||
bool bMtlLayersChanged = false;
|
||||
SMaterialLayerResources* pMtlLayerResources = mtl->GetMtlLayerResources();
|
||||
int nCurrLayer = -1;
|
||||
|
||||
// Check for shader changes
|
||||
|
||||
@@ -537,7 +537,7 @@ void CMaterialManager::ReloadDirtyMaterials()
|
||||
|
||||
allMaterials.reserve(mtlCount);
|
||||
|
||||
uint32 mtlCountPrev = mtlCount;
|
||||
[[maybe_unused]] uint32 mtlCountPrev = mtlCount;
|
||||
runtimeMaterialManager->GetLoadedMaterials(&allMaterials, mtlCount);
|
||||
AZ_Assert(mtlCountPrev == mtlCount && mtlCount == allMaterials.size(), "It appears GetLoadedMaterials was not used correctly.");
|
||||
|
||||
|
||||
@@ -1353,9 +1353,9 @@ namespace
|
||||
}
|
||||
else
|
||||
{
|
||||
uint16 nSlot = aznumeric_cast<uint16>(TryConvertingCStringToEEfResTextures(subCategoryName));
|
||||
AZ_Warning("ShadersSystem", false, "PyGetProperty - Error: empty 'subCategoryName' texture slot [%d] for material %s",
|
||||
nSlot, pMaterial->GetName().toStdString().c_str());
|
||||
aznumeric_cast<uint16>(TryConvertingCStringToEEfResTextures(subCategoryName)),
|
||||
pMaterial->GetName().toStdString().c_str());
|
||||
}
|
||||
}
|
||||
// ########## Texture Maps / [Tiling | Rotator | Oscillator] ##########
|
||||
@@ -1485,9 +1485,9 @@ namespace
|
||||
}
|
||||
else
|
||||
{
|
||||
uint16 nSlot = aznumeric_cast<uint16>(TryConvertingCStringToEEfResTextures(subSubCategoryName));
|
||||
AZ_Warning("ShadersSystem", false, "PyGetProperty - Error: empty 'subSubCategoryName' texture slot [%d] for material %s",
|
||||
nSlot, pMaterial->GetName().toStdString().c_str());
|
||||
aznumeric_cast<uint16>(TryConvertingCStringToEEfResTextures(subSubCategoryName)),
|
||||
pMaterial->GetName().toStdString().c_str());
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -273,14 +273,11 @@ void CModelViewport::RestoreDebugOptions()
|
||||
for (auto g : m_settingsPath.split('\\'))
|
||||
settings.beginGroup(g);
|
||||
|
||||
f32 floatValue = .0f;
|
||||
UINT byteNum = sizeof(f32);
|
||||
QString strRead = "";
|
||||
int32 iRead = 0;
|
||||
BOOL bRead = FALSE;
|
||||
f32 fRead = .0f;
|
||||
QByteArray pbtData;
|
||||
UINT bytes = 0;
|
||||
|
||||
CVarBlock* vb = m_vars.GetVarBlock();
|
||||
int32 vbCount = vb->GetNumVariables();
|
||||
@@ -289,7 +286,6 @@ void CModelViewport::RestoreDebugOptions()
|
||||
for (int32 i = 0; i < vbCount; ++i)
|
||||
{
|
||||
IVariable* var = vb->GetVariable(i);
|
||||
IVariable::EType vType = var->GetType();
|
||||
sprintf_s(keyType, "DebugOption_%s_type", var->GetName().toUtf8().data());
|
||||
|
||||
int32 iType = settings.value(keyType, 0).toInt();
|
||||
|
||||
@@ -165,7 +165,6 @@ private:
|
||||
{
|
||||
CObjectManager* pObjectManager = static_cast<CObjectManager*>(GetIEditor()->GetObjectManager());
|
||||
CBaseObject* pObject = pObjectManager->FindObject(m_attachedObjectGUID);
|
||||
CBaseObject* pParentObject = pObjectManager->FindObject(m_parentObjectGUID);
|
||||
|
||||
if (pObject)
|
||||
{
|
||||
@@ -2818,7 +2817,6 @@ void CBaseObject::SetWorldTM(const Matrix34& tm, int flags)
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CBaseObject::UpdateVisibility(bool bVisible)
|
||||
{
|
||||
bool bVisibleWithSpec = bVisible && !IsHiddenBySpec();
|
||||
if (bVisible == CheckFlags(OBJFLAG_INVISIBLE))
|
||||
{
|
||||
if (IObjectManager* objectManager = GetObjectManager())
|
||||
@@ -3180,8 +3178,6 @@ bool CBaseObject::IntersectRayMesh(const Vec3& raySrc, const Vec3& rayDir, SRayH
|
||||
return false;
|
||||
}
|
||||
|
||||
int cntSlots = pRenderNode->GetSlotCount();
|
||||
|
||||
Matrix34A worldTM;
|
||||
IStatObj* pStatObj = pRenderNode->GetEntityStatObj(0, 0, &worldTM);
|
||||
if (!pStatObj)
|
||||
|
||||
@@ -539,7 +539,6 @@ void DisplayContext::DrawHalfDottedCircle(const Vec3& pos, float radius, const V
|
||||
void DisplayContext::DrawDottedCircle(const Vec3& pos, float radius, const Vec3& nUnchangedAxis, int numberOfArrows /*=0*/, float stepDegree /*= 1*/)
|
||||
{
|
||||
float startAngleRadians = 0;
|
||||
float sweepAngleRadians = 2 * gf_PI;
|
||||
|
||||
Vec3 a;
|
||||
Vec3 b;
|
||||
@@ -892,8 +891,8 @@ void DisplayContext::DrawDottedLine(const Vec3& p1, const Vec3& p2, [[maybe_unus
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void DisplayContext::PushMatrix(const Matrix34& tm)
|
||||
{
|
||||
assert(m_currentMatrix < 32);
|
||||
if (m_currentMatrix < 32)
|
||||
assert(m_currentMatrix < 31);
|
||||
if (m_currentMatrix < 31)
|
||||
{
|
||||
m_currentMatrix++;
|
||||
m_matrixStack[m_currentMatrix] = m_matrixStack[m_currentMatrix - 1] * tm;
|
||||
|
||||
@@ -1881,7 +1881,6 @@ CMaterial* CEntityObject::GetRenderMaterial() const
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CEntityObject::SetHelperScale(float scale)
|
||||
{
|
||||
bool bChanged = m_helperScale != scale;
|
||||
m_helperScale = scale;
|
||||
}
|
||||
|
||||
@@ -2034,8 +2033,6 @@ void CEntityObject::ApplyOptics(const QString& opticsFullName, IOpticsElementBas
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CEntityObject::SetOpticsName(const QString& opticsFullName)
|
||||
{
|
||||
bool bUpdateOpticsProperty = true;
|
||||
|
||||
if (opticsFullName.isEmpty())
|
||||
{
|
||||
CDLight* pLight = GetLightProperty();
|
||||
|
||||
@@ -411,9 +411,6 @@ void CObjectManager::DeleteObject(CBaseObject* obj)
|
||||
obj->GetBoundBox(objAAB);
|
||||
GetIEditor()->GetGameEngine()->OnAreaModified(objAAB);
|
||||
|
||||
// Release game resources.
|
||||
CBaseObject* pParent = obj->GetParent();
|
||||
|
||||
obj->Done();
|
||||
|
||||
NotifyObjectListeners(obj, CBaseObject::ON_DELETE);
|
||||
|
||||
@@ -159,8 +159,6 @@ void CStatObjValidator::Validate(IStatObj* statObj, CMaterial* editorMaterial)
|
||||
}
|
||||
}
|
||||
|
||||
const char* errorText = 0;
|
||||
const char* nodeName = 0;
|
||||
if (statObj && editorMaterial)
|
||||
{
|
||||
std::vector<SMeshMaterialIssue> issues;
|
||||
|
||||
@@ -71,8 +71,6 @@ void CTrackGizmo::Display(DisplayContext& dc)
|
||||
return;
|
||||
}
|
||||
|
||||
uint32 hideMask = gSettings.objectHideMask;
|
||||
|
||||
CAnimationContext* ac = GetIEditor()->GetAnimation();
|
||||
|
||||
// Should have animation sequence.
|
||||
@@ -236,7 +234,6 @@ void CTrackGizmo::DrawKeys(DisplayContext& dc, CTrackViewTrack* pTrack, CTrackVi
|
||||
|
||||
float zOffset = TRACK_DRAW_Z_OFFSET;
|
||||
|
||||
float sz = 0.2f;
|
||||
int nkeys = pKeysTrack->GetKeyCount();
|
||||
for (int i = 0; i < nkeys; i++)
|
||||
{
|
||||
|
||||
@@ -465,8 +465,6 @@ void DockWidget::RestoreState(bool forceDefault)
|
||||
|
||||
QRect DockWidget::ProperGeometry() const
|
||||
{
|
||||
Qt::DockWidgetArea area = isFloating() ? Qt::NoDockWidgetArea : m_mainWindow->dockWidgetArea(const_cast<DockWidget*>(this));
|
||||
|
||||
QRect myGeom(pos(), size());
|
||||
|
||||
// we need this state in global coordinates, but if we're parented to one of those group dock windows, there is a problem, it will be local coords.
|
||||
@@ -1366,7 +1364,7 @@ bool QtViewPaneManager::RestoreLayout(QString layoutName)
|
||||
|
||||
for (const QString& paneName : state.viewPanes)
|
||||
{
|
||||
const QtViewPane* pane = OpenPane(paneName, QtViewPane::OpenMode::OnlyOpen);
|
||||
OpenPane(paneName, QtViewPane::OpenMode::OnlyOpen);
|
||||
}
|
||||
|
||||
// must do this after opening all of the panes!
|
||||
|
||||
@@ -1556,7 +1556,6 @@ void CRenderViewport::OnEditorNotifyEvent(EEditorNotifyEvent event)
|
||||
m_previousContext = SetCurrentContext();
|
||||
}
|
||||
SetCurrentCursor(STD_CURSOR_GAME);
|
||||
AzFramework::InputSystemCursorConstraintRequestBus::Handler::BusConnect();
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1564,7 +1563,6 @@ void CRenderViewport::OnEditorNotifyEvent(EEditorNotifyEvent event)
|
||||
case eNotify_OnEndGameMode:
|
||||
if (GetIEditor()->GetViewManager()->GetGameViewport() == this)
|
||||
{
|
||||
AzFramework::InputSystemCursorConstraintRequestBus::Handler::BusDisconnect();
|
||||
SetCurrentCursor(STD_CURSOR_DEFAULT);
|
||||
if (m_renderer->GetCurrentContextHWND() != renderOverlayHWND())
|
||||
{
|
||||
@@ -2422,9 +2420,7 @@ void CRenderViewport::SetWindowTitle(const AZStd::string& title)
|
||||
|
||||
AzFramework::WindowSize CRenderViewport::GetClientAreaSize() const
|
||||
{
|
||||
const QWidget* window = this->window();
|
||||
QSize windowSize = window->size();
|
||||
return AzFramework::WindowSize(windowSize.width(), windowSize.height());
|
||||
return AzFramework::WindowSize(m_rcClient.width(), m_rcClient.height());
|
||||
}
|
||||
|
||||
|
||||
@@ -2462,10 +2458,14 @@ void CRenderViewport::ConnectViewportInteractionRequestBus()
|
||||
AzToolsFramework::ViewportInteraction::ViewportInteractionRequestBus::Handler::BusConnect(GetViewportId());
|
||||
AzToolsFramework::ViewportInteraction::MainEditorViewportInteractionRequestBus::Handler::BusConnect(GetViewportId());
|
||||
m_viewportUi.ConnectViewportUiBus(GetViewportId());
|
||||
|
||||
AzFramework::InputSystemCursorConstraintRequestBus::Handler::BusConnect();
|
||||
}
|
||||
|
||||
void CRenderViewport::DisconnectViewportInteractionRequestBus()
|
||||
{
|
||||
AzFramework::InputSystemCursorConstraintRequestBus::Handler::BusDisconnect();
|
||||
|
||||
m_viewportUi.DisconnectViewportUiBus();
|
||||
AzToolsFramework::ViewportInteraction::MainEditorViewportInteractionRequestBus::Handler::BusDisconnect();
|
||||
AzToolsFramework::ViewportInteraction::ViewportInteractionRequestBus::Handler::BusDisconnect();
|
||||
@@ -4617,6 +4617,22 @@ void CRenderViewport::BuildDragDropContext(AzQtComponents::ViewportDragContext&
|
||||
QtViewport::BuildDragDropContext(context, scaledPoint);
|
||||
}
|
||||
|
||||
void* CRenderViewport::GetSystemCursorConstraintWindow() const
|
||||
{
|
||||
AzFramework::SystemCursorState systemCursorState = AzFramework::SystemCursorState::Unknown;
|
||||
|
||||
AzFramework::InputSystemCursorRequestBus::EventResult(
|
||||
systemCursorState,
|
||||
AzFramework::InputDeviceMouse::Id,
|
||||
&AzFramework::InputSystemCursorRequests::GetSystemCursorState);
|
||||
|
||||
const bool systemCursorConstrained =
|
||||
(systemCursorState == AzFramework::SystemCursorState::ConstrainedAndHidden ||
|
||||
systemCursorState == AzFramework::SystemCursorState::ConstrainedAndVisible);
|
||||
|
||||
return systemCursorConstrained ? renderOverlayHWND() : nullptr;
|
||||
}
|
||||
|
||||
void CRenderViewport::RestoreViewportAfterGameMode()
|
||||
{
|
||||
Matrix34 preGameModeViewTM = m_preGameModeViewTM;
|
||||
|
||||
@@ -597,7 +597,7 @@ protected:
|
||||
bool CheckRespondToInput() const;
|
||||
|
||||
// AzFramework::InputSystemCursorConstraintRequestBus
|
||||
void* GetSystemCursorConstraintWindow() const override { return renderOverlayHWND(); }
|
||||
void* GetSystemCursorConstraintWindow() const override;
|
||||
|
||||
void BuildDragDropContext(AzQtComponents::ViewportDragContext& context, const QPoint& pt) override;
|
||||
|
||||
|
||||
@@ -222,7 +222,6 @@ void CRotateTool::DrawAngleDecorator(DisplayContext& dc)
|
||||
Vec3 cameraViewDir = dc.camera->GetViewMatrix().GetColumn1().GetNormalized(); //Get the viewDir from the camera instead of from the view
|
||||
// FIXME: The angle and sweep calculation here is incorrect.
|
||||
float cameraAngle = atan2f(cameraViewDir.y, -cameraViewDir.x);
|
||||
float angle = m_initialViewAxisAngleRadians - cameraAngle - (g_PI / 2);
|
||||
float angleDelta = (m_angleToCursor - g_PI2 * floor(m_initialViewAxisAngleRadians / g_PI2)) - (m_initialViewAxisAngleRadians - (cameraAngle - (g_PI / 2)));
|
||||
|
||||
RotationDrawHelper::AngleDecorator::Draw(dc, m_object->GetWorldPos(), cameraViewDir, m_initialViewAxisAngleRadians, angleDelta, m_arcRotationStepRadians, m_viewAxisRadius, GetScreenScale(dc.view, dc.camera));
|
||||
|
||||
@@ -250,7 +250,6 @@ bool CVariableIArchive::SerializeResourceSelector(const Serialization::SStruct&
|
||||
bool CVariableIArchive::SerializeStringListStaticValue(const Serialization::SStruct& ser, const char* name, [[maybe_unused]] const char* label)
|
||||
{
|
||||
StringListStaticValue* const pStringListStaticValue = reinterpret_cast< StringListStaticValue* >(ser.pointer());
|
||||
const StringListStatic& stringListStatic = pStringListStaticValue->stringList();
|
||||
|
||||
_smart_ptr< IVariable > pChild = VarUtil::FindChildVariable(m_pVariable, m_childIndexOverride, name);
|
||||
if (pChild)
|
||||
|
||||
@@ -91,7 +91,6 @@ Vec3 CSetVectorDlg::GetVectorFromEditor()
|
||||
Vec3 v;
|
||||
int emode = GetIEditor()->GetEditMode();
|
||||
CBaseObject* obj = GetIEditor()->GetSelectedObject();
|
||||
RefCoordSys coordSys = GetIEditor()->GetReferenceCoordSys();
|
||||
bool bWorldSpace = GetIEditor()->GetReferenceCoordSys() == COORDS_WORLD;
|
||||
|
||||
if (obj)
|
||||
|
||||
@@ -703,6 +703,10 @@ void SEditorSettings::Save()
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void SEditorSettings::Load()
|
||||
{
|
||||
// Load from Settings Registry
|
||||
AzFramework::ApplicationRequests::Bus::BroadcastResult(
|
||||
prefabSystem, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
|
||||
|
||||
const int settingsVersion = s_editorSettings()->value(QStringLiteral("Settings/EditorSettingsVersion"), 0).toInt();
|
||||
|
||||
if (settingsVersion != EditorSettingsVersion)
|
||||
@@ -942,11 +946,6 @@ void SEditorSettings::Load()
|
||||
searchPaths[id].push_back(path);
|
||||
}
|
||||
}
|
||||
|
||||
// Load from Settings Registry
|
||||
AzFramework::ApplicationRequests::Bus::BroadcastResult(
|
||||
prefabSystem, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
|
||||
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -63,7 +63,6 @@ bool CLevelShaderCache::Load(const char* filename)
|
||||
bool CLevelShaderCache::LoadBuffer(const QString& textBuffer, bool bClearOld)
|
||||
{
|
||||
const char* separators = "\r\n,";
|
||||
int curPos = 0;
|
||||
|
||||
int nNumLines = 0;
|
||||
if (bClearOld)
|
||||
|
||||
@@ -53,8 +53,6 @@ int CShaderEnum::EnumShaders()
|
||||
|
||||
m_bEnumerated = true;
|
||||
|
||||
int numShaders = 0;
|
||||
|
||||
m_shaders.clear();
|
||||
m_shaders.reserve(100);
|
||||
//! Enumerate Shaders.
|
||||
|
||||
@@ -442,7 +442,8 @@ bool ShortcutDispatcher::shortcutFilter(QObject* obj, QShortcutEvent* shortcutEv
|
||||
|
||||
QWidget* correctedTopLevel = nullptr;
|
||||
QWidget* p = currentFocusWidget;
|
||||
while (correctedTopLevel = FindParentScopeRoot(p))
|
||||
correctedTopLevel = FindParentScopeRoot(p);
|
||||
while (correctedTopLevel)
|
||||
{
|
||||
if (FindCandidateActionAndFire(correctedTopLevel, shortcutEvent, candidates, previouslyVisited))
|
||||
{
|
||||
@@ -450,6 +451,7 @@ bool ShortcutDispatcher::shortcutFilter(QObject* obj, QShortcutEvent* shortcutEv
|
||||
}
|
||||
|
||||
p = correctedTopLevel;
|
||||
correctedTopLevel = FindParentScopeRoot(p);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -100,17 +100,17 @@ namespace TimeOfDayDetails
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef VERIFY
|
||||
#define VERIFY(EXPRESSION) { auto e = EXPRESSION; assert(e); }
|
||||
#endif
|
||||
|
||||
CHDRPane::CHDRPane(CTimeOfDayDialog* pTODDlg)
|
||||
: QWidget(pTODDlg)
|
||||
, m_pTODDlg(pTODDlg)
|
||||
, m_pVars(new CVarBlock)
|
||||
{
|
||||
assert(m_pTODDlg);
|
||||
VERIFY(Init());
|
||||
#if !defined(NDEBUG)
|
||||
bool ok =
|
||||
#endif
|
||||
Init();
|
||||
assert(ok);
|
||||
}
|
||||
|
||||
bool CHDRPane::Init()
|
||||
@@ -207,7 +207,10 @@ static float EvalFilmCurve(float x, float ss, float ms, float ts)
|
||||
void CHDRPane::UpdateFilmCurve()
|
||||
{
|
||||
float shoulderScale = 0, midScale = 0, toeScale = 0, whitePoint = 0;
|
||||
bool ok = GetFilmCurveParams(shoulderScale, midScale, toeScale, whitePoint);
|
||||
#if !defined(NDEBUG)
|
||||
bool ok =
|
||||
#endif
|
||||
GetFilmCurveParams(shoulderScale, midScale, toeScale, whitePoint);
|
||||
assert(ok);
|
||||
const float minX = -4.0f, minY = 0.0f, maxX = 4.0f;
|
||||
float maxY = 1.0f, stepY = 0.1f;
|
||||
|
||||
@@ -270,7 +270,7 @@ void ToolbarCustomizationDialog::NewToolbar(const QString &initialName)
|
||||
QString name = QInputDialog::getText(this, tr("New Toolbar"), tr("Toolbar name:"), QLineEdit::Normal, initialName);
|
||||
for (const AmazonToolbar &t : m_toolbarManager->GetToolbars()) {
|
||||
if (name == t.GetTranslatedName()) {
|
||||
QMessageBox::StandardButton button = QMessageBox::warning(this, tr("Warning"),
|
||||
QMessageBox::warning(this, tr("Warning"),
|
||||
tr("A toolbar with this name already exists. Please choose a different name."),
|
||||
QMessageBox::Ok);
|
||||
NewToolbar(name);
|
||||
|
||||
@@ -705,25 +705,33 @@ void ToolbarManager::RestoreToolbarDefaults(const QString& toolbarName)
|
||||
const AmazonToolbar* defaultToolbar = FindDefaultToolbar(toolbarName);
|
||||
AmazonToolbar* existingToolbar = FindToolbar(toolbarName);
|
||||
Q_ASSERT(existingToolbar != nullptr);
|
||||
const bool isInstantiated = existingToolbar->IsInstantiated();
|
||||
|
||||
if (isInstantiated)
|
||||
if (existingToolbar != nullptr)
|
||||
{
|
||||
// We have a QToolBar instance, updated it too
|
||||
for (QAction* action : existingToolbar->Toolbar()->actions())
|
||||
const bool isInstantiated = existingToolbar->IsInstantiated();
|
||||
|
||||
if (isInstantiated)
|
||||
{
|
||||
existingToolbar->Toolbar()->removeAction(action);
|
||||
// We have a QToolBar instance, updated it too
|
||||
for (QAction* action : existingToolbar->Toolbar()->actions())
|
||||
{
|
||||
existingToolbar->Toolbar()->removeAction(action);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
existingToolbar->CopyActions(*defaultToolbar);
|
||||
Q_ASSERT(defaultToolbar != nullptr);
|
||||
if (defaultToolbar != nullptr)
|
||||
{
|
||||
existingToolbar->CopyActions(*defaultToolbar);
|
||||
}
|
||||
|
||||
if (isInstantiated)
|
||||
{
|
||||
existingToolbar->SetActionsOnInternalToolbar(m_actionManager);
|
||||
existingToolbar->UpdateAllowedAreas();
|
||||
if (isInstantiated)
|
||||
{
|
||||
existingToolbar->SetActionsOnInternalToolbar(m_actionManager);
|
||||
existingToolbar->UpdateAllowedAreas();
|
||||
}
|
||||
SaveToolbars();
|
||||
}
|
||||
SaveToolbars();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1166,7 +1174,7 @@ bool EditableQToolBar::eventFilter(QObject* obj, QEvent* ev)
|
||||
mimeData->setText(action->text());
|
||||
drag->setMimeData(mimeData);
|
||||
|
||||
Qt::DropAction dropAction = drag->exec();
|
||||
drag->exec();
|
||||
m_dndIndicator->setLastDragPos(QPoint());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -102,8 +102,6 @@ bool CSelectKeyUIControls::OnKeySelectionChange(CTrackViewKeyBundle& selectedKey
|
||||
ResetCameraEntries();
|
||||
|
||||
// Get All cameras.
|
||||
CTrackViewSequence* sequence = GetIEditor()->GetAnimation()->GetSequence();
|
||||
|
||||
mv_camera.SetEnumList(NULL);
|
||||
|
||||
mv_camera->AddEnumItem(QObject::tr("<None>"), QString::number(static_cast<AZ::u64>(AZ::EntityId::InvalidEntityId)));
|
||||
@@ -223,7 +221,6 @@ void CSelectKeyUIControls::OnCameraRemoved(const AZ::EntityId & cameraId)
|
||||
// We can't iterate or remove an item from the enum list, and Camera::CameraRequests::GetCameras
|
||||
// still includes the deleted camera at this point. Reset the list anyway and filter out the
|
||||
// deleted camera.
|
||||
IVarEnumList* oldList = mv_camera->GetEnumList();
|
||||
mv_camera->SetEnumList(NULL);
|
||||
mv_camera->AddEnumItem(QObject::tr("<None>"), QString::number(static_cast<AZ::u64>(AZ::EntityId::InvalidEntityId)));
|
||||
|
||||
|
||||
@@ -239,8 +239,6 @@ CTVEventsDialog::~CTVEventsDialog()
|
||||
|
||||
void CTVEventsDialog::OnBnClickedButtonAddEvent()
|
||||
{
|
||||
CTrackViewSequence* sequence = GetIEditor()->GetAnimation()->GetSequence();
|
||||
|
||||
const QString add = QInputDialog::getText(this, tr("Track Event Name"), QString());
|
||||
if (!add.isEmpty() && static_cast<TVEventsModel*>(m_ui->m_List->model())->addRow(add))
|
||||
{
|
||||
@@ -252,8 +250,6 @@ void CTVEventsDialog::OnBnClickedButtonAddEvent()
|
||||
|
||||
void CTVEventsDialog::OnBnClickedButtonRemoveEvent()
|
||||
{
|
||||
CTrackViewSequence* sequence = GetIEditor()->GetAnimation()->GetSequence();
|
||||
|
||||
QList<QPersistentModelIndex> indexes;
|
||||
for (auto index : m_ui->m_List->selectionModel()->selectedRows())
|
||||
{
|
||||
@@ -304,8 +300,7 @@ void CTVEventsDialog::OnInitDialog()
|
||||
m_ui->m_List->setModel(new TVEventsModel(this));
|
||||
m_ui->m_List->header()->resizeSections(QHeaderView::ResizeToContents);
|
||||
|
||||
CTrackViewSequence* sequence = GetIEditor()->GetAnimation()->GetSequence();
|
||||
assert(sequence);
|
||||
assert(GetIEditor()->GetAnimation()->GetSequence());
|
||||
|
||||
UpdateButtons();
|
||||
}
|
||||
|
||||
@@ -1405,7 +1405,6 @@ void CTrackViewDopeSheetBase::ShowKeyTooltip(CTrackViewKeyHandle& keyHandle, con
|
||||
|
||||
const float time = keyHandle.GetTime();
|
||||
const char* desc = keyHandle.GetDescription();
|
||||
float duration = keyHandle.GetDuration();
|
||||
|
||||
QString tipText;
|
||||
if (GetTickDisplayMode() == eTVTickMode_InSeconds)
|
||||
@@ -1848,8 +1847,6 @@ void CTrackViewDopeSheetBase::SetScrollOffset(int hpos)
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CTrackViewDopeSheetBase::LButtonDownOnTimeAdjustBar([[maybe_unused]] const QPoint& point, CTrackViewKeyHandle& keyHandle, bool bStart)
|
||||
{
|
||||
CTrackViewSequence* sequence = GetIEditor()->GetAnimation()->GetSequence();
|
||||
|
||||
m_keyTimeOffset = 0;
|
||||
m_keyForTimeAdjust = keyHandle;
|
||||
|
||||
@@ -2568,9 +2565,6 @@ void CTrackViewDopeSheetBase::DrawTrack(CTrackViewTrack* pTrack, QPainter* paint
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CTrackViewDopeSheetBase::DrawSelectTrack(const Range& timeRange, QPainter* painter, CTrackViewTrack* pTrack, const QRect& rc)
|
||||
{
|
||||
int x0 = TimeToClient(timeRange.start);
|
||||
float t0 = timeRange.start;
|
||||
|
||||
const QBrush prevBrush = painter->brush();
|
||||
painter->setBrush(m_selectTrackBrush);
|
||||
|
||||
@@ -2682,9 +2676,6 @@ void CTrackViewDopeSheetBase::DrawBoolTrack(const Range& timeRange, QPainter* pa
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CTrackViewDopeSheetBase::DrawSequenceTrack(const Range& timeRange, QPainter* painter, CTrackViewTrack* pTrack, const QRect& rc)
|
||||
{
|
||||
int x0 = TimeToClient(timeRange.start);
|
||||
float t0 = timeRange.start;
|
||||
|
||||
const QBrush prevBrush = painter->brush();
|
||||
painter->setBrush(m_selectTrackBrush);
|
||||
|
||||
@@ -3386,7 +3377,6 @@ void CTrackViewDopeSheetBase::DrawTimeline(QPainter* painter, const QRect& rcUpd
|
||||
const QPen black(textCol);
|
||||
const QPen redpen(lineCol);
|
||||
// Draw time ticks every tick step seconds.
|
||||
const Range& timeRange = m_timeRange;
|
||||
|
||||
painter->setPen(dkgray);
|
||||
|
||||
|
||||
@@ -631,8 +631,6 @@ CTrackViewNodesCtrl::CRecord* CTrackViewNodesCtrl::AddAnimNodeRecord(CRecord* pP
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
CTrackViewNodesCtrl::CRecord* CTrackViewNodesCtrl::AddTrackRecord(CRecord* pParentRecord, CTrackViewTrack* pTrack)
|
||||
{
|
||||
const CTrackViewAnimNode* animNode = pTrack->GetAnimNode();
|
||||
|
||||
CRecord* pNewTrackRecord = new CRecord(pTrack);
|
||||
pNewTrackRecord->setSizeHint(0, QSize(30, 18));
|
||||
pNewTrackRecord->setText(0, pTrack->GetName());
|
||||
@@ -785,7 +783,6 @@ void CTrackViewNodesCtrl::UpdateAnimNodeRecord(CRecord* record, CTrackViewAnimNo
|
||||
if (nodeType == AnimNodeType::Component)
|
||||
{
|
||||
// get the component icon from cached component icons
|
||||
bool searchCompleted = false;
|
||||
|
||||
AZ::Entity* azEntity = nullptr;
|
||||
AZ::ComponentApplicationBus::BroadcastResult(azEntity, &AZ::ComponentApplicationBus::Events::FindEntity,
|
||||
@@ -1526,7 +1523,7 @@ void CTrackViewNodesCtrl::OnNMRclick(QPoint point)
|
||||
if (animNode)
|
||||
{
|
||||
QString matName;
|
||||
int subMtlIndex = GetMatNameAndSubMtlIndexFromName(matName, animNode->GetName());
|
||||
GetMatNameAndSubMtlIndexFromName(matName, animNode->GetName());
|
||||
QString newMatName;
|
||||
newMatName = tr("%1.[%2]").arg(matName).arg(cmd - eMI_SelectSubmaterialBase + 1);
|
||||
CUndo undo("Rename TrackView node");
|
||||
@@ -1671,7 +1668,6 @@ void CTrackViewNodesCtrl::ImportFromFBX()
|
||||
|
||||
for (unsigned int trackID = 0; trackID < numTracks; ++trackID)
|
||||
{
|
||||
CTrackViewTrack* pTrack = tracks.GetTrack(trackID);
|
||||
undoBatch.MarkEntityDirty(sequence->GetSequenceComponentEntityId());
|
||||
}
|
||||
|
||||
@@ -2275,7 +2271,6 @@ int CTrackViewNodesCtrl::ShowPopupMenuMultiSelection(SContextMenu& contextMenu)
|
||||
for (int currentNode = 0; currentNode < records.size(); ++currentNode)
|
||||
{
|
||||
CRecord* pItemInfo = (CRecord*)records[currentNode];
|
||||
ETrackViewNodeType type = pItemInfo->GetNode()->GetNodeType();
|
||||
|
||||
if (pItemInfo->GetNode()->GetNodeType() == eTVNT_AnimNode)
|
||||
{
|
||||
@@ -2622,7 +2617,8 @@ void CTrackViewNodesCtrl::ShowNextResult()
|
||||
|
||||
if (!items.empty())
|
||||
{
|
||||
m_currentMatchIndex = ++m_currentMatchIndex % m_matchCount;
|
||||
++m_currentMatchIndex;
|
||||
m_currentMatchIndex = m_currentMatchIndex % m_matchCount;
|
||||
ui->treeWidget->selectionModel()->clear();
|
||||
items[m_currentMatchIndex]->setSelected(true);
|
||||
}
|
||||
@@ -2812,8 +2808,7 @@ CTrackViewNodesCtrl::CRecord* CTrackViewNodesCtrl::GetNodeRecord(const CTrackVie
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CRecord* record = findIter->second;
|
||||
assert (record->GetNode() == pNode);
|
||||
assert (findIter->second->GetNode() == pNode);
|
||||
return findIter->second;
|
||||
}
|
||||
|
||||
|
||||
@@ -1273,7 +1273,6 @@ void CTrackViewSequence::OffsetSelectedKeys(const float timeOffset)
|
||||
// may become invalid after sorted with a new time.
|
||||
bool notifyListeners = false;
|
||||
|
||||
const CTrackViewTrack* pTrack = nullptr;
|
||||
for (int k = 0; k < (int)selectedKeys.GetKeyCount(); ++k)
|
||||
{
|
||||
CTrackViewKeyHandle skey = selectedKeys.GetKey(k);
|
||||
|
||||
@@ -210,7 +210,6 @@ private:
|
||||
return;
|
||||
}
|
||||
|
||||
CTrackViewSplineCtrl* pCtrl = FindControl(m_pCtrl);
|
||||
for (auto it = m_splineEntries.begin(); it != m_splineEntries.end(); ++it)
|
||||
{
|
||||
CSplineEntry& entry = *it;
|
||||
|
||||
@@ -186,7 +186,6 @@ CTrackViewKeyHandle CTrackViewTrack::GetNextKey(const float time)
|
||||
|
||||
const float startTime = time;
|
||||
float closestTime = std::numeric_limits<float>::max();
|
||||
bool bFoundKey = false;
|
||||
|
||||
const int numKeys = m_pAnimTrack->GetNumKeys();
|
||||
for (int i = 0; i < numKeys; ++i)
|
||||
@@ -619,7 +618,7 @@ void CTrackViewTrack::SelectKeys(const bool bSelected)
|
||||
{
|
||||
// Affect sub tracks
|
||||
unsigned int childCount = GetChildCount();
|
||||
for (unsigned int childIndex = 0; childIndex < childCount; ++childCount)
|
||||
for (unsigned int childIndex = 0; childIndex < childCount; ++childIndex)
|
||||
{
|
||||
CTrackViewTrack* pChildTrack = static_cast<CTrackViewTrack*>(GetChild(childIndex));
|
||||
pChildTrack->SelectKeys(bSelected);
|
||||
|
||||
@@ -594,7 +594,8 @@ Quatern snuggle(Quatern q, HVect* k)
|
||||
mag[2] = (double)q.y * q.z + (double)q.x * q.w;
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
if (neg[i] = (mag[i] < 0.0))
|
||||
neg[i] = (mag[i] < 0.0);
|
||||
if (neg[i])
|
||||
{
|
||||
mag[i] = -mag[i];
|
||||
}
|
||||
@@ -670,7 +671,8 @@ Quatern snuggle(Quatern q, HVect* k)
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
pa[i] = 0.0;
|
||||
if (neg[i] = (qa[i] < 0.0))
|
||||
neg[i] = (qa[i] < 0.0);
|
||||
if (neg[i])
|
||||
{
|
||||
qa[i] = -qa[i];
|
||||
}
|
||||
|
||||
@@ -315,9 +315,11 @@ bool CImageGif::Load(const QString& fileName, CImageEx& outImage)
|
||||
}
|
||||
}
|
||||
|
||||
while ((ch = NEXTBYTE))
|
||||
ch = NEXTBYTE;
|
||||
while (ch)
|
||||
{
|
||||
ptr += ch;
|
||||
ch = NEXTBYTE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -266,9 +266,6 @@ bool CImage_DXTC::Load(const char* filename, CImageEx& outImage, bool* pQualityL
|
||||
|
||||
BYTE* pDecompBytes;
|
||||
|
||||
// Does texture have mipmaps?
|
||||
bool bMipTexture = pImage->mfGet_numMips() > 1;
|
||||
|
||||
ETEX_Format eFormat = pImage->mfGetFormat();
|
||||
int imageFlags = pImage->mfGet_Flags();
|
||||
|
||||
@@ -298,9 +295,6 @@ bool CImage_DXTC::Load(const char* filename, CImageEx& outImage, bool* pQualityL
|
||||
|
||||
int nHorizontalFaces(1);
|
||||
int nVerticalFaces(1);
|
||||
int nNumFaces(1);
|
||||
int nMipMapsSize(0);
|
||||
int nMipMapCount(numMips);
|
||||
int nTargetPitch(imageWidth * 4);
|
||||
int nTargetPageSize(nTargetPitch * imageHeight);
|
||||
|
||||
|
||||
@@ -174,7 +174,10 @@ void CMemoryBlock::Uncompress(CMemoryBlock& toBlock) const
|
||||
toBlock.Allocate(m_uncompressedSize);
|
||||
toBlock.m_uncompressedSize = 0;
|
||||
unsigned long destSize = m_uncompressedSize;
|
||||
int result = uncompress((unsigned char*)toBlock.GetBuffer(), &destSize, (unsigned char*)GetBuffer(), GetSize());
|
||||
#if !defined(NDEBUG)
|
||||
int result =
|
||||
#endif
|
||||
uncompress((unsigned char*)toBlock.GetBuffer(), &destSize, (unsigned char*)GetBuffer(), GetSize());
|
||||
assert(result == Z_OK);
|
||||
assert(destSize == m_uncompressedSize);
|
||||
}
|
||||
|
||||
@@ -98,7 +98,6 @@ namespace Path
|
||||
const char* szSourceDirectory(strSourceDirectory.c_str());
|
||||
const char* pchCurrentPosition(szSourceDirectory);
|
||||
const char* pchLastPosition(szSourceDirectory);
|
||||
const char* pchAuxPosition(szSourceDirectory);
|
||||
|
||||
rcstrDirectoryTree.clear();
|
||||
|
||||
|
||||
@@ -313,7 +313,10 @@ void CXmlHistoryManager::RecordUndo(IXmlUndoEventHandler* pEventHandler, const c
|
||||
assert(pChangedXml);
|
||||
|
||||
XmlNodeRef newData = gEnv->pSystem->CreateXmlNode();
|
||||
bool bRes = pEventHandler->SaveToXml(newData);
|
||||
#if !defined(NDEBUG)
|
||||
bool bRes =
|
||||
#endif
|
||||
pEventHandler->SaveToXml(newData);
|
||||
assert(bRes);
|
||||
|
||||
TXmlHistotyGroupPtrList activeGroups = m_HistoryInfoMap[ m_CurrentVersion ].ActiveGroups;
|
||||
|
||||
@@ -163,7 +163,7 @@ QtViewport::QtViewport(QWidget* parent)
|
||||
: QWidget(parent)
|
||||
, m_renderOverlay(this)
|
||||
{
|
||||
QAction* action = m_cViewMenu.addMenu(tr("&View Options"))->addAction(tr("&Fullscreen"));
|
||||
m_cViewMenu.addMenu(tr("&View Options"))->addAction(tr("&Fullscreen"));
|
||||
//connect(action, &QAction::triggered, );
|
||||
m_selectionTolerance = 0;
|
||||
m_fGridZoom = 1.0f;
|
||||
@@ -1297,7 +1297,6 @@ float QtViewport::GetDistanceToLine(const Vec3& lineP1, const Vec3& lineP2, cons
|
||||
void QtViewport::GetPerpendicularAxis(EAxis* pAxis, bool* pIs2D) const
|
||||
{
|
||||
EViewportType vpType = GetType();
|
||||
bool b2D = false;
|
||||
switch (vpType)
|
||||
{
|
||||
case ET_ViewportXY:
|
||||
|
||||
@@ -58,8 +58,6 @@ using namespace AzQtComponents;
|
||||
|
||||
static int GetSmallestScreenHeight()
|
||||
{
|
||||
QDesktopWidget* desktopWidget = QApplication::desktop();
|
||||
|
||||
int smallestHeight = -1;
|
||||
for (QScreen* screen : QApplication::screens())
|
||||
{
|
||||
|
||||
@@ -397,8 +397,6 @@ set(FILES
|
||||
Controls/SplineCtrl.h
|
||||
Controls/SplineCtrlEx.cpp
|
||||
Controls/SplineCtrlEx.h
|
||||
Controls/SyntaxColorizer.cpp
|
||||
Controls/SyntaxColorizer.h
|
||||
Controls/TextEditorCtrl.cpp
|
||||
Controls/TextEditorCtrl.h
|
||||
Controls/TimelineCtrl.cpp
|
||||
|
||||
Reference in New Issue
Block a user