Fixed build errors and runtime errors in new gpu debugger menus.

This commit is contained in:
inspuration 2014-06-09 15:52:51 -04:00
parent 85e8edbdd9
commit fc191a3490
2 changed files with 11 additions and 4 deletions

View file

@ -17,6 +17,7 @@ GPUCommandListModel::GPUCommandListModel(QObject* parent) : QAbstractItemModel(p
QModelIndex GPUCommandListModel::index(int row, int column, const QModelIndex& parent) const QModelIndex GPUCommandListModel::index(int row, int column, const QModelIndex& parent) const
{ {
TreeItem* item; TreeItem* item;
TreeItem* internal;
if (!parent.isValid()) { if (!parent.isValid()) {
item = root_item; item = root_item;
@ -24,7 +25,13 @@ QModelIndex GPUCommandListModel::index(int row, int column, const QModelIndex& p
item = (TreeItem*)parent.internalPointer(); item = (TreeItem*)parent.internalPointer();
} }
return createIndex(row, column, item->children[row]); if (item->children.size() <= row) {
internal = item;
}
else { internal = item->children[row]; }
return createIndex(row, column, internal);
} }
QModelIndex GPUCommandListModel::parent(const QModelIndex& child) const QModelIndex GPUCommandListModel::parent(const QModelIndex& child) const

View file

@ -20,9 +20,9 @@ public:
// A vector of commands represented by their raw byte sequence // A vector of commands represented by their raw byte sequence
struct PicaCommand : public std::vector<u32> struct PicaCommand : public std::vector<u32>
{ {
Pica::CommandHeader& GetHeader() Pica::CommandHeader& GetHeader() const
{ {
u32& val = at(1); const u32& val = at(1);
return *(Pica::CommandHeader*)&val; return *(Pica::CommandHeader*)&val;
} }
}; };
@ -64,7 +64,7 @@ public:
} }
protected: protected:
GraphicsDebugger* GetDebugger() GraphicsDebugger* GetDebugger() const
{ {
return observed; return observed;
} }