mirror of
https://github.com/jpd002/Play-.git
synced 2025-04-28 21:57:57 +03:00
code style fixes
This commit is contained in:
parent
a48ddc62f6
commit
c1ae39bc6f
18 changed files with 63 additions and 87 deletions
|
@ -30,7 +30,6 @@ CDebugView::CDebugView(QMdiArea* parent, CVirtualMachine& virtualMachine, CMIPS*
|
|||
m_memoryViewWnd->setWidget(memoryViewWnd);
|
||||
m_memoryViewWnd->setWindowTitle("Memory View");
|
||||
|
||||
|
||||
auto callStackWnd = new CCallStackWnd(parent, m_ctx, m_biosDebugInfoProvider);
|
||||
m_callStackWnd = new QMdiSubWindow(parent);
|
||||
m_callStackWnd->setWidget(callStackWnd);
|
||||
|
|
|
@ -26,7 +26,6 @@ private:
|
|||
QWindow* m_renderWindow = nullptr;
|
||||
QOpenGLContext* m_context = nullptr;
|
||||
|
||||
|
||||
Framework::OpenGl::CBuffer m_vertexBufferFramedebugger;
|
||||
Framework::OpenGl::ProgramPtr m_checkerboardProgram;
|
||||
Framework::OpenGl::ProgramPtr m_pixelBufferViewProgram;
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
CGifPacketView::CGifPacketView(QWidget* parent)
|
||||
: QTextEdit(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CGifPacketView::SetPacket(const uint8* vuMem, uint32 packetAddress, uint32 packetSize)
|
||||
|
|
|
@ -28,8 +28,7 @@ CGsContextView::CGsContextView(QWidget* parent, QComboBox* contextBuffer, QPushB
|
|||
setLayout(layout);
|
||||
layout->addWidget(m_bufferView.get());
|
||||
|
||||
connect(fitButton, &QPushButton::clicked, [&]()
|
||||
{
|
||||
connect(fitButton, &QPushButton::clicked, [&]() {
|
||||
m_bufferView->FitBitmap();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@ public:
|
|||
void UpdateState(CGSHandler*, CGsPacketMetadata*, DRAWINGKICK_INFO*);
|
||||
void SetSelection(int);
|
||||
|
||||
|
||||
private:
|
||||
typedef std::array<uint32, 256> ColorArray;
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#include "GsPacketData.h"
|
||||
|
||||
GsPacketData::GsPacketData(const QVariant& data, int cmdIndex, GsPacketData* parent)
|
||||
: m_data(data)
|
||||
, m_parent(parent)
|
||||
, m_cmdIndex(cmdIndex)
|
||||
: m_data(data)
|
||||
, m_parent(parent)
|
||||
, m_cmdIndex(cmdIndex)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ GsPacketData* GsPacketData::parent()
|
|||
|
||||
int GsPacketData::row() const
|
||||
{
|
||||
if (m_parent)
|
||||
if(m_parent)
|
||||
return m_parent->m_children.indexOf(const_cast<GsPacketData*>(this));
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -19,10 +19,10 @@ public:
|
|||
GsPacketData* parent();
|
||||
|
||||
int GetCmdIndex() const;
|
||||
|
||||
private:
|
||||
QVector<GsPacketData*> m_children;
|
||||
QVariant m_data;
|
||||
GsPacketData* m_parent;
|
||||
int m_cmdIndex = 0;
|
||||
};
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include <QStringList>
|
||||
|
||||
PacketTreeModel::PacketTreeModel(QWidget *parent)
|
||||
PacketTreeModel::PacketTreeModel(QWidget* parent)
|
||||
: QAbstractItemModel(parent)
|
||||
, rootItem(new GsPacketData("Packets", 0))
|
||||
{
|
||||
|
@ -16,27 +16,27 @@ PacketTreeModel::~PacketTreeModel()
|
|||
delete rootItem;
|
||||
}
|
||||
|
||||
int PacketTreeModel::columnCount(const QModelIndex &parent) const
|
||||
int PacketTreeModel::columnCount(const QModelIndex& parent) const
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
QVariant PacketTreeModel::data(const QModelIndex &index, int role) const
|
||||
QVariant PacketTreeModel::data(const QModelIndex& index, int role) const
|
||||
{
|
||||
if (!index.isValid())
|
||||
if(!index.isValid())
|
||||
return QVariant();
|
||||
|
||||
if (role != Qt::DisplayRole)
|
||||
if(role != Qt::DisplayRole)
|
||||
return QVariant();
|
||||
|
||||
GsPacketData *item = static_cast<GsPacketData*>(index.internalPointer());
|
||||
GsPacketData* item = static_cast<GsPacketData*>(index.internalPointer());
|
||||
|
||||
return item->data(index.column());
|
||||
}
|
||||
|
||||
Qt::ItemFlags PacketTreeModel::flags(const QModelIndex &index) const
|
||||
Qt::ItemFlags PacketTreeModel::flags(const QModelIndex& index) const
|
||||
{
|
||||
if (!index.isValid())
|
||||
if(!index.isValid())
|
||||
return Qt::NoItemFlags;
|
||||
|
||||
return QAbstractItemModel::flags(index);
|
||||
|
@ -44,51 +44,51 @@ Qt::ItemFlags PacketTreeModel::flags(const QModelIndex &index) const
|
|||
|
||||
QVariant PacketTreeModel::headerData(int section, Qt::Orientation orientation, int role) const
|
||||
{
|
||||
if (orientation == Qt::Horizontal && role == Qt::DisplayRole)
|
||||
if(orientation == Qt::Horizontal && role == Qt::DisplayRole)
|
||||
return rootItem->data(section);
|
||||
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
QModelIndex PacketTreeModel::index(int row, int column, const QModelIndex &parent) const
|
||||
QModelIndex PacketTreeModel::index(int row, int column, const QModelIndex& parent) const
|
||||
{
|
||||
if (!hasIndex(row, column, parent))
|
||||
if(!hasIndex(row, column, parent))
|
||||
return QModelIndex();
|
||||
|
||||
GsPacketData *parentItem;
|
||||
GsPacketData* parentItem;
|
||||
|
||||
if (!parent.isValid())
|
||||
if(!parent.isValid())
|
||||
parentItem = rootItem;
|
||||
else
|
||||
parentItem = static_cast<GsPacketData*>(parent.internalPointer());
|
||||
|
||||
GsPacketData *childItem = parentItem->child(row);
|
||||
if (childItem)
|
||||
GsPacketData* childItem = parentItem->child(row);
|
||||
if(childItem)
|
||||
return createIndex(row, column, childItem);
|
||||
return QModelIndex();
|
||||
}
|
||||
|
||||
QModelIndex PacketTreeModel::parent(const QModelIndex &index) const
|
||||
QModelIndex PacketTreeModel::parent(const QModelIndex& index) const
|
||||
{
|
||||
if (!index.isValid())
|
||||
if(!index.isValid())
|
||||
return QModelIndex();
|
||||
|
||||
GsPacketData *childItem = static_cast<GsPacketData*>(index.internalPointer());
|
||||
GsPacketData *parentItem = childItem->parent();
|
||||
GsPacketData* childItem = static_cast<GsPacketData*>(index.internalPointer());
|
||||
GsPacketData* parentItem = childItem->parent();
|
||||
|
||||
if (parentItem == rootItem)
|
||||
if(parentItem == rootItem)
|
||||
return QModelIndex();
|
||||
|
||||
return createIndex(parentItem->row(), 0, parentItem);
|
||||
}
|
||||
|
||||
int PacketTreeModel::rowCount(const QModelIndex &parent) const
|
||||
int PacketTreeModel::rowCount(const QModelIndex& parent) const
|
||||
{
|
||||
GsPacketData *parentItem;
|
||||
if (parent.column() > 0)
|
||||
GsPacketData* parentItem;
|
||||
if(parent.column() > 0)
|
||||
return 0;
|
||||
|
||||
if (!parent.isValid())
|
||||
if(!parent.isValid())
|
||||
parentItem = rootItem;
|
||||
else
|
||||
parentItem = static_cast<GsPacketData*>(parent.internalPointer());
|
||||
|
@ -134,7 +134,5 @@ void PacketTreeModel::setupModelData(CFrameDump& m_frameDump)
|
|||
++cmdIndex;
|
||||
}
|
||||
++packetIndex;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -26,8 +26,7 @@ public:
|
|||
int columnCount(const QModelIndex& = QModelIndex()) const override;
|
||||
|
||||
void setupModelData(CFrameDump&);
|
||||
|
||||
private:
|
||||
|
||||
GsPacketData *rootItem;
|
||||
GsPacketData* rootItem;
|
||||
};
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include "StdStreamUtils.h"
|
||||
#include "string_format.h"
|
||||
|
||||
CPixelBufferView::CPixelBufferView(QWidget *parent, QComboBox* contextBuffer)
|
||||
CPixelBufferView::CPixelBufferView(QWidget* parent, QComboBox* contextBuffer)
|
||||
: QWidget(parent)
|
||||
, m_contextBuffer(contextBuffer)
|
||||
, m_zoomFactor(1)
|
||||
|
@ -42,22 +42,17 @@ CPixelBufferView::CPixelBufferView(QWidget *parent, QComboBox* contextBuffer)
|
|||
|
||||
connect(m_openglpanel, &QWindow::widthChanged, this, &CPixelBufferView::Refresh);
|
||||
|
||||
m_mouseWheelConnection = static_cast<OpenGLWindow*>(m_openglpanel)->onMouseWheelEvent.Connect([&](QWheelEvent* event)
|
||||
{
|
||||
m_mouseWheelConnection = static_cast<OpenGLWindow*>(m_openglpanel)->onMouseWheelEvent.Connect([&](QWheelEvent* event) {
|
||||
OnMouseWheel(event);
|
||||
});
|
||||
|
||||
m_mouseMoveConnection = static_cast<OpenGLWindow*>(m_openglpanel)->onMouseMoveEvent.Connect([&](QMouseEvent* event)
|
||||
{
|
||||
m_mouseMoveConnection = static_cast<OpenGLWindow*>(m_openglpanel)->onMouseMoveEvent.Connect([&](QMouseEvent* event) {
|
||||
OnMouseMoveEvent(event);
|
||||
});
|
||||
|
||||
|
||||
m_mousePressConnection = static_cast<OpenGLWindow*>(m_openglpanel)->onMousePressEvent.Connect([&](QMouseEvent* event)
|
||||
{
|
||||
m_mousePressConnection = static_cast<OpenGLWindow*>(m_openglpanel)->onMousePressEvent.Connect([&](QMouseEvent* event) {
|
||||
OnMousePressEvent(event);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
void CPixelBufferView::showEvent(QShowEvent* event)
|
||||
|
@ -68,7 +63,7 @@ void CPixelBufferView::showEvent(QShowEvent* event)
|
|||
Refresh();
|
||||
}
|
||||
|
||||
void CPixelBufferView::paintEvent(QPaintEvent *event)
|
||||
void CPixelBufferView::paintEvent(QPaintEvent* event)
|
||||
{
|
||||
QWidget::paintEvent(event);
|
||||
if(!m_gs)
|
||||
|
@ -104,7 +99,6 @@ void CPixelBufferView::SetPixelBuffers(PixelBufferArray pixelBuffers)
|
|||
m_contextBuffer->setCurrentIndex(selectedIndex);
|
||||
}
|
||||
m_contextBuffer->blockSignals(false);
|
||||
|
||||
}
|
||||
CreateSelectedPixelBufferTexture();
|
||||
Refresh();
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include "GSH_OpenGLQt_Framedebugger.h"
|
||||
#include "../../openglwindow.h"
|
||||
|
||||
|
||||
class CPixelBufferView : public QWidget
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include "GsPacketListModel.h"
|
||||
#include "GsStateUtils.h"
|
||||
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <QFileDialog>
|
||||
#include <QOffscreenSurface>
|
||||
|
@ -328,28 +327,28 @@ void QtFramedebugger::UpdateCurrentTab()
|
|||
switch(ui->tabWidget->currentIndex())
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_gsContextView0->UpdateState(m_gs.get(), &m_currentMetadata, &m_currentDrawingKick);
|
||||
std::string result = CGsStateUtils::GetContextState(m_gs.get(), 0);
|
||||
ui->contextState0->setText(result.c_str());
|
||||
}
|
||||
break;
|
||||
{
|
||||
m_gsContextView0->UpdateState(m_gs.get(), &m_currentMetadata, &m_currentDrawingKick);
|
||||
std::string result = CGsStateUtils::GetContextState(m_gs.get(), 0);
|
||||
ui->contextState0->setText(result.c_str());
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
m_gsContextView1->UpdateState(m_gs.get(), &m_currentMetadata, &m_currentDrawingKick);
|
||||
std::string result = CGsStateUtils::GetContextState(m_gs.get(), 1);
|
||||
ui->contextState1->setText(result.c_str());
|
||||
}
|
||||
break;
|
||||
{
|
||||
m_gsContextView1->UpdateState(m_gs.get(), &m_currentMetadata, &m_currentDrawingKick);
|
||||
std::string result = CGsStateUtils::GetContextState(m_gs.get(), 1);
|
||||
ui->contextState1->setText(result.c_str());
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
std::string result = CGsStateUtils::GetInputState(m_gs.get());
|
||||
ui->inputStateTextEdit->setText(result.c_str());
|
||||
}
|
||||
break;
|
||||
{
|
||||
std::string result = CGsStateUtils::GetInputState(m_gs.get());
|
||||
ui->inputStateTextEdit->setText(result.c_str());
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
m_vu1ProgramView->UpdateState(m_gs.get(), &m_currentMetadata, &m_currentDrawingKick);
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,8 +8,9 @@
|
|||
#include "Vu1Vm.h"
|
||||
#include "Vu1ProgramView.h"
|
||||
|
||||
namespace Ui {
|
||||
class QtFramedebugger;
|
||||
namespace Ui
|
||||
{
|
||||
class QtFramedebugger;
|
||||
}
|
||||
|
||||
class QtFramedebugger : public QMainWindow
|
||||
|
@ -17,13 +18,12 @@ class QtFramedebugger : public QMainWindow
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit QtFramedebugger(QWidget *parent = nullptr);
|
||||
explicit QtFramedebugger(QWidget* parent = nullptr);
|
||||
~QtFramedebugger();
|
||||
|
||||
protected:
|
||||
void showEvent(QShowEvent*) Q_DECL_OVERRIDE;
|
||||
|
||||
|
||||
private slots:
|
||||
void on_action640x448_Interlaced_triggered(bool);
|
||||
void on_action640x448_Non_Interlaced_triggered(bool);
|
||||
|
@ -67,10 +67,8 @@ private:
|
|||
CGsContextView::FB_DISPLAY_MODE m_fbDisplayMode = CGsContextView::FB_DISPLAY_MODE_RAW;
|
||||
CFrameDump m_frameDump;
|
||||
CVu1Vm m_vu1vm;
|
||||
|
||||
|
||||
std::unique_ptr<CGsContextView> m_gsContextView0;
|
||||
std::unique_ptr<CGsContextView> m_gsContextView1;
|
||||
std::unique_ptr<CVu1ProgramView> m_vu1ProgramView;
|
||||
|
||||
|
||||
};
|
||||
|
|
|
@ -17,7 +17,6 @@ CVu1ProgramView::CVu1ProgramView(QWidget* parent, CVu1Vm& virtualMachine)
|
|||
auto v = new QVBoxLayout(this);
|
||||
auto h = new QHBoxLayout();
|
||||
|
||||
|
||||
m_disAsm = std::make_unique<CDisAsmWnd>(this, m_virtualMachine, m_virtualMachine.GetVu1Context(), "Vector Unit 1", CQtDisAsmTableModel::DISASM_VU, PS2::VUMEM1SIZE);
|
||||
h->addWidget(m_disAsm.get());
|
||||
|
||||
|
@ -26,16 +25,13 @@ CVu1ProgramView::CVu1ProgramView(QWidget* parent, CVu1Vm& virtualMachine)
|
|||
v->addLayout(h);
|
||||
|
||||
m_memoryView = std::make_unique<CMemoryViewTable>(this);
|
||||
auto getByte = [ctx = m_virtualMachine.GetVu1Context()](uint32 address)
|
||||
{
|
||||
auto getByte = [ctx = m_virtualMachine.GetVu1Context()](uint32 address) {
|
||||
return ctx->m_pMemoryMap->GetByte(address);
|
||||
};
|
||||
|
||||
m_memoryView->Setup(&m_virtualMachine, m_virtualMachine.GetVu1Context(), true);
|
||||
m_memoryView->SetData(getByte, PS2::VUMEM1SIZE);
|
||||
|
||||
|
||||
|
||||
auto tab = new QTabWidget(this);
|
||||
v->addWidget(tab);
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include "DebugExpressionEvaluator.h"
|
||||
|
||||
CMemoryViewTable::CMemoryViewTable(QWidget* parent)
|
||||
: QTableView(parent)
|
||||
: QTableView(parent)
|
||||
{
|
||||
m_model = new CQtMemoryViewModel(this);
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ OpenGLWindow::OpenGLWindow(QWindow* parent)
|
|||
|
||||
QSurfaceFormat OpenGLWindow::GetSurfaceFormat()
|
||||
{
|
||||
QSurfaceFormat format;
|
||||
QSurfaceFormat format;
|
||||
#if defined(GLES_COMPATIBILITY)
|
||||
format.setVersion(3, 0);
|
||||
#else
|
||||
|
|
|
@ -10,5 +10,4 @@ public:
|
|||
~OpenGLWindow() = default;
|
||||
|
||||
static QSurfaceFormat GetSurfaceFormat();
|
||||
|
||||
};
|
||||
|
|
|
@ -88,7 +88,6 @@ void OutputWindow::wheelEvent(QWheelEvent* ev)
|
|||
onMouseWheelEvent(ev);
|
||||
}
|
||||
|
||||
|
||||
void OutputWindow::mouseMoveEvent(QMouseEvent* ev)
|
||||
{
|
||||
onMouseMoveEvent(ev);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue