diff options
| author | Tony Wasserka <NeoBrainX@gmail.com> | 2014-05-18 19:59:36 +0200 |
|---|---|---|
| committer | bunnei <ericbunnie@gmail.com> | 2014-06-12 06:10:52 -0400 |
| commit | b0051b2203d8319e57603ee6cbfaa5cd798de060 (patch) | |
| tree | 8d331f1958fbf0dda7215e597faff818a7bda247 /src/citra_qt/debugger/graphics_cmdlists.hxx | |
| parent | 6893732348c3689b094c2e9749f8eb9e877028b8 (diff) | |
Refine command list debugging functionality and its qt interface.
Diffstat (limited to 'src/citra_qt/debugger/graphics_cmdlists.hxx')
| -rw-r--r-- | src/citra_qt/debugger/graphics_cmdlists.hxx | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/src/citra_qt/debugger/graphics_cmdlists.hxx b/src/citra_qt/debugger/graphics_cmdlists.hxx index bac23c643..b4e6e3c8a 100644 --- a/src/citra_qt/debugger/graphics_cmdlists.hxx +++ b/src/citra_qt/debugger/graphics_cmdlists.hxx @@ -4,18 +4,22 @@ #pragma once -#include <QAbstractListModel> +#include <QAbstractItemModel> #include <QDockWidget> #include "video_core/gpu_debugger.h" -class GPUCommandListModel : public QAbstractListModel, public GraphicsDebugger::DebuggerObserver +// TODO: Rename class, since it's not actually a list model anymore... +class GPUCommandListModel : public QAbstractItemModel, public GraphicsDebugger::DebuggerObserver { Q_OBJECT public: GPUCommandListModel(QObject* parent); + QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const; + QModelIndex parent(const QModelIndex& child) const; + int columnCount(const QModelIndex& parent = QModelIndex()) const; int rowCount(const QModelIndex& parent = QModelIndex()) const override; QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; @@ -29,8 +33,24 @@ signals: void CommandListCalled(); private: - int row_count; - std::vector<std::pair<u32,GraphicsDebugger::PicaCommandList>> command_list; + struct TreeItem : public QObject + { + enum Type { + ROOT, + COMMAND_LIST, + COMMAND + }; + + TreeItem(Type type, int index, TreeItem* item_parent, QObject* parent) : QObject(parent), type(type), index(index), parent(item_parent) {} + + Type type; + int index; + std::vector<TreeItem*> children; + TreeItem* parent; + }; + + std::vector<std::pair<u32,GraphicsDebugger::PicaCommandList>> command_lists; + TreeItem* root_item; }; class GPUCommandListWidget : public QDockWidget |
