From f8ed197318fa040023a0e570f0a6d93375d0faa2 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 13 Feb 2017 16:10:45 +0000 Subject: [PATCH] Add static resources collection with pre-constructed QPixmaps & QIcons * Apart from making the code cleaner when accessing them, creating these from strings can be slow if you do it often enough (e.g. once per resources for action/action_hover in pipeline state view). --- qrenderdoc/Code/Resources.cpp | 61 ++++++++ qrenderdoc/Code/Resources.h | 141 ++++++++++++++++++ qrenderdoc/Code/qrenderdoc.cpp | 3 + qrenderdoc/Resources/{delete.png => del.png} | Bin qrenderdoc/Resources/{128.png => logo128.png} | Bin qrenderdoc/Resources/resources.qrc | 4 +- qrenderdoc/Windows/Dialogs/AboutDialog.ui | 2 +- qrenderdoc/Windows/Dialogs/LiveCapture.cpp | 11 +- .../Windows/Dialogs/OrderedListEditor.cpp | 3 +- qrenderdoc/Windows/Dialogs/RemoteManager.cpp | 7 +- .../Windows/Dialogs/SuggestRemoteDialog.cpp | 3 +- .../Windows/Dialogs/VirtualFileDialog.cpp | 10 +- qrenderdoc/Windows/MainWindow.cpp | 34 ++--- .../D3D11PipelineStateViewer.cpp | 56 +++---- .../D3D12PipelineStateViewer.cpp | 56 +++---- .../PipelineState/GLPipelineStateViewer.cpp | 53 +++---- .../VulkanPipelineStateViewer.cpp | 59 +++----- qrenderdoc/Windows/TextureViewer.ui | 2 +- qrenderdoc/qrenderdoc.pro | 2 + qrenderdoc/qrenderdoc_local.vcxproj | 2 + qrenderdoc/qrenderdoc_local.vcxproj.filters | 6 + 21 files changed, 331 insertions(+), 184 deletions(-) create mode 100644 qrenderdoc/Code/Resources.cpp create mode 100644 qrenderdoc/Code/Resources.h rename qrenderdoc/Resources/{delete.png => del.png} (100%) rename qrenderdoc/Resources/{128.png => logo128.png} (100%) diff --git a/qrenderdoc/Code/Resources.cpp b/qrenderdoc/Code/Resources.cpp new file mode 100644 index 000000000..d0ed2673a --- /dev/null +++ b/qrenderdoc/Code/Resources.cpp @@ -0,0 +1,61 @@ +/****************************************************************************** + * The MIT License (MIT) + * + * Copyright (c) 2017 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ + +#include "Resources.h" +#include +#include + +Resources::ResourceSet *Resources::resources = NULL; + +void Resources::Initialise() +{ + QList filenames; + + resources = new Resources::ResourceSet(); + +#undef RESOURCE_DEF +#define RESOURCE_DEF(name, filename) \ + filenames.push_back(":/" filename); \ + resources->name##_data.pixmap = QPixmap(QString::fromUtf8(":/" filename)); \ + resources->name##_data.icon = QIcon(resources->name##_data.pixmap); + + RESOURCE_LIST(); + + QDirIterator it(":"); + while(it.hasNext()) + { + QString filename = it.next(); + if(filenames.contains(filename)) + continue; + if(!filename.contains(".png")) + continue; + + qCritical() << "Resource not configured for" << filename; + } +} + +Resources::~Resources() +{ + delete resources; +} diff --git a/qrenderdoc/Code/Resources.h b/qrenderdoc/Code/Resources.h new file mode 100644 index 000000000..e8092853c --- /dev/null +++ b/qrenderdoc/Code/Resources.h @@ -0,0 +1,141 @@ +/****************************************************************************** + * The MIT License (MIT) + * + * Copyright (c) 2017 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ + +#pragma once + +#include +#include + +#define RESOURCE_LIST() \ + RESOURCE_DEF(logo128, "logo128.png") \ + RESOURCE_DEF(accept, "accept.png") \ + RESOURCE_DEF(add, "add.png") \ + RESOURCE_DEF(arrow_in, "arrow_in.png") \ + RESOURCE_DEF(arrow_join, "arrow_join.png") \ + RESOURCE_DEF(arrow_undo, "arrow_undo.png") \ + RESOURCE_DEF(asterisk_orange, "asterisk_orange.png") \ + RESOURCE_DEF(back, "back.png") \ + RESOURCE_DEF(chart_curve, "chart_curve.png") \ + RESOURCE_DEF(cog, "cog.png") \ + RESOURCE_DEF(cog_go, "cog_go.png") \ + RESOURCE_DEF(color_wheel, "color_wheel.png") \ + RESOURCE_DEF(connect, "connect.png") \ + RESOURCE_DEF(cross, "cross.png") \ + RESOURCE_DEF(crosshatch, "crosshatch.png") \ + RESOURCE_DEF(del, "del.png") \ + RESOURCE_DEF(disconnect, "disconnect.png") \ + RESOURCE_DEF(down_arrow, "down_arrow.png") \ + RESOURCE_DEF(find, "find.png") \ + RESOURCE_DEF(fit_window, "fit_window.png") \ + RESOURCE_DEF(flag_green, "flag_green.png") \ + RESOURCE_DEF(flip_y, "flip_y.png") \ + RESOURCE_DEF(folder_page, "folder_page.png") \ + RESOURCE_DEF(forward, "forward.png") \ + RESOURCE_DEF(hourglass, "hourglass.png") \ + RESOURCE_DEF(house, "house.png") \ + RESOURCE_DEF(information, "information.png") \ + RESOURCE_DEF(new_window, "new_window.png") \ + RESOURCE_DEF(page_white_code, "page_white_code.png") \ + RESOURCE_DEF(page_white_database, "page_white_database.png") \ + RESOURCE_DEF(page_white_delete, "page_white_delete.png") \ + RESOURCE_DEF(page_white_edit, "page_white_edit.png") \ + RESOURCE_DEF(page_white_link, "page_white_link.png") \ + RESOURCE_DEF(plugin_add, "plugin_add.png") \ + RESOURCE_DEF(red_x_16, "red_x_16.png") \ + RESOURCE_DEF(runback, "runback.png") \ + RESOURCE_DEF(runcursor, "runcursor.png") \ + RESOURCE_DEF(runfwd, "runfwd.png") \ + RESOURCE_DEF(runnaninf, "runnaninf.png") \ + RESOURCE_DEF(runsample, "runsample.png") \ + RESOURCE_DEF(save, "save.png") \ + RESOURCE_DEF(stepnext, "stepnext.png") \ + RESOURCE_DEF(stepprev, "stepprev.png") \ + RESOURCE_DEF(tick, "tick.png") \ + RESOURCE_DEF(time, "time.png") \ + RESOURCE_DEF(timeline_marker, "timeline_marker.png") \ + RESOURCE_DEF(up_arrow, "up_arrow.png") \ + RESOURCE_DEF(upfolder, "upfolder.png") \ + RESOURCE_DEF(wand, "wand.png") \ + RESOURCE_DEF(wireframe_mesh, "wireframe_mesh.png") \ + RESOURCE_DEF(wrench, "wrench.png") \ + RESOURCE_DEF(zoom, "zoom.png") \ + RESOURCE_DEF(topo_linelist, "topologies/topo_linelist.png") \ + RESOURCE_DEF(topo_linelist_adj, "topologies/topo_linelist_adj.png") \ + RESOURCE_DEF(topo_linestrip, "topologies/topo_linestrip.png") \ + RESOURCE_DEF(topo_linestrip_adj, "topologies/topo_linestrip_adj.png") \ + RESOURCE_DEF(topo_patch, "topologies/topo_patch.png") \ + RESOURCE_DEF(topo_pointlist, "topologies/topo_pointlist.png") \ + RESOURCE_DEF(topo_trilist, "topologies/topo_trilist.png") \ + RESOURCE_DEF(topo_trilist_adj, "topologies/topo_trilist_adj.png") \ + RESOURCE_DEF(topo_tristrip, "topologies/topo_tristrip.png") \ + RESOURCE_DEF(topo_tristrip_adj, "topologies/topo_tristrip_adj.png") \ + RESOURCE_DEF(action, "action.png") \ + RESOURCE_DEF(action_hover, "action_hover.png") + +struct Resource +{ + QIcon icon; + QPixmap pixmap; +}; + +class Resources +{ +public: + static void Initialise(); + ~Resources(); + +#undef RESOURCE_DEF +#define RESOURCE_DEF(name, filename) \ + static const Resource &name() { return resources->name##_data; } + RESOURCE_LIST() + +private: +#undef RESOURCE_DEF +#define RESOURCE_DEF(name, filename) Resource name##_data; + + struct ResourceSet + { + RESOURCE_LIST(); + }; + + static ResourceSet *resources; +}; + +// helper forwarding structs + +struct Pixmaps +{ +#undef RESOURCE_DEF +#define RESOURCE_DEF(name, filename) \ + static const QPixmap &name() { return Resources::name().pixmap; } + RESOURCE_LIST() +}; + +struct Icons +{ +#undef RESOURCE_DEF +#define RESOURCE_DEF(name, filename) \ + static const QIcon &name() { return Resources::name().icon; } + RESOURCE_LIST() +}; \ No newline at end of file diff --git a/qrenderdoc/Code/qrenderdoc.cpp b/qrenderdoc/Code/qrenderdoc.cpp index c40a058cb..8f902a4d0 100644 --- a/qrenderdoc/Code/qrenderdoc.cpp +++ b/qrenderdoc/Code/qrenderdoc.cpp @@ -30,6 +30,7 @@ #include #include "Code/CaptureContext.h" #include "Code/QRDUtils.h" +#include "Code/Resources.h" #include "Windows/MainWindow.h" void sharedLogOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg) @@ -141,6 +142,8 @@ int main(int argc, char *argv[]) config.SetupFormatting(); + Resources::Initialise(); + GUIInvoke::init(); CaptureContext ctx(filename, remoteHost, remoteIdent, temp, config); diff --git a/qrenderdoc/Resources/delete.png b/qrenderdoc/Resources/del.png similarity index 100% rename from qrenderdoc/Resources/delete.png rename to qrenderdoc/Resources/del.png diff --git a/qrenderdoc/Resources/128.png b/qrenderdoc/Resources/logo128.png similarity index 100% rename from qrenderdoc/Resources/128.png rename to qrenderdoc/Resources/logo128.png diff --git a/qrenderdoc/Resources/resources.qrc b/qrenderdoc/Resources/resources.qrc index 38082ed7c..7789019f3 100644 --- a/qrenderdoc/Resources/resources.qrc +++ b/qrenderdoc/Resources/resources.qrc @@ -1,6 +1,6 @@ - 128.png + logo128.png accept.png add.png arrow_in.png @@ -15,7 +15,7 @@ connect.png cross.png crosshatch.png - delete.png + del.png disconnect.png down_arrow.png find.png diff --git a/qrenderdoc/Windows/Dialogs/AboutDialog.ui b/qrenderdoc/Windows/Dialogs/AboutDialog.ui index 0da9be07e..52d0f28a5 100644 --- a/qrenderdoc/Windows/Dialogs/AboutDialog.ui +++ b/qrenderdoc/Windows/Dialogs/AboutDialog.ui @@ -23,7 +23,7 @@ - :/128.png + :/logo128.png diff --git a/qrenderdoc/Windows/Dialogs/LiveCapture.cpp b/qrenderdoc/Windows/Dialogs/LiveCapture.cpp index 51e5ba7a8..2739d992b 100644 --- a/qrenderdoc/Windows/Dialogs/LiveCapture.cpp +++ b/qrenderdoc/Windows/Dialogs/LiveCapture.cpp @@ -31,6 +31,7 @@ #include #include #include "3rdparty/toolwindowmanager/ToolWindowManager.h" +#include "Code/Resources.h" #include "Code/qprocessinfo.h" #include "Widgets/Extended/RDLabel.h" #include "Windows/MainWindow.h" @@ -74,7 +75,7 @@ LiveCapture::LiveCapture(CaptureContext &ctx, const QString &hostname, uint32_t setTitle(tr("Connecting..")); ui->connectionStatus->setText(tr("Connecting..")); - ui->connectionIcon->setPixmap(QPixmap(QString::fromUtf8(":/hourglass.png"))); + ui->connectionIcon->setPixmap(Pixmaps::hourglass()); { QToolBar *bottomTools = new QToolBar(this); @@ -922,7 +923,7 @@ void LiveCapture::connectionThreadEntry() GUIInvoke::call([this]() { setTitle("Connection failed"); ui->connectionStatus->setText(tr("Connection failed")); - ui->connectionIcon->setPixmap(QPixmap(QString::fromUtf8(":/delete.png"))); + ui->connectionIcon->setPixmap(Pixmaps::del()); connectionClosed(); }); @@ -949,7 +950,7 @@ void LiveCapture::connectionThreadEntry() tr("Connection established to %1 [PID %2] (%3)").arg(target).arg(pid).arg(api)); setTitle(QString("%1 [PID %2]").arg(target).arg(pid)); } - ui->connectionIcon->setPixmap(QPixmap(QString::fromUtf8(":/connect.png"))); + ui->connectionIcon->setPixmap(Pixmaps::connect()); }); while(m_Connection && m_Connection->Connected()) @@ -1011,7 +1012,7 @@ void LiveCapture::connectionThreadEntry() tr("Connection established to %1 [PID %2] (%3)").arg(target).arg(pid).arg(api)); setTitle(QString("%1 [PID %2]").arg(target).arg(pid)); } - ui->connectionIcon->setPixmap(QPixmap(QString::fromUtf8(":/connect.png"))); + ui->connectionIcon->setPixmap(Pixmaps::connect()); }); } @@ -1058,7 +1059,7 @@ void LiveCapture::connectionThreadEntry() GUIInvoke::call([this]() { ui->connectionStatus->setText(tr("Connection closed")); - ui->connectionIcon->setPixmap(QPixmap(QString::fromUtf8(":/disconnect.png"))); + ui->connectionIcon->setPixmap(Pixmaps::disconnect()); ui->numFrames->setEnabled(false); ui->captureDelay->setEnabled(false); diff --git a/qrenderdoc/Windows/Dialogs/OrderedListEditor.cpp b/qrenderdoc/Windows/Dialogs/OrderedListEditor.cpp index 60c38e63c..0026f9e2a 100644 --- a/qrenderdoc/Windows/Dialogs/OrderedListEditor.cpp +++ b/qrenderdoc/Windows/Dialogs/OrderedListEditor.cpp @@ -26,6 +26,7 @@ #include #include #include "Code/QRDUtils.h" +#include "Code/Resources.h" #include "ui_OrderedListEditor.h" OrderedListEditor::OrderedListEditor(const QString &windowName, const QString &itemName, @@ -69,7 +70,7 @@ QToolButton *OrderedListEditor::makeBrowseButton() { QToolButton *ret = new QToolButton(this); - ret->setIcon(QIcon(QPixmap(QString::fromUtf8(":/folder_page.png")))); + ret->setIcon(Icons::folder_page()); ret->setAutoRaise(true); QObject::connect(ret, &QToolButton::clicked, this, &OrderedListEditor::browse_clicked); diff --git a/qrenderdoc/Windows/Dialogs/RemoteManager.cpp b/qrenderdoc/Windows/Dialogs/RemoteManager.cpp index 47377a307..2b230a6b1 100644 --- a/qrenderdoc/Windows/Dialogs/RemoteManager.cpp +++ b/qrenderdoc/Windows/Dialogs/RemoteManager.cpp @@ -26,6 +26,7 @@ #include #include "3rdparty/flowlayout/FlowLayout.h" #include "Code/RemoteHost.h" +#include "Code/Resources.h" #include "Windows/Dialogs/LiveCapture.h" #include "Windows/MainWindow.h" #include "ui_RemoteManager.h" @@ -165,7 +166,7 @@ void RemoteManager::addHost(RemoteHost *host) QTreeWidgetItem *node = makeTreeNode({host->Hostname, "..."}); setItalic(node, true); - node->setIcon(0, QIcon(QPixmap(QString::fromUtf8(":/hourglass.png")))); + node->setIcon(0, Icons::hourglass()); setRemoteHost(node, host); ui->hosts->addTopLevelItem(node); @@ -540,7 +541,7 @@ void RemoteManager::on_refreshAll_clicked() deleteChildren(n); setItalic(n, true); - n->setIcon(0, QIcon(QPixmap(QString::fromUtf8(":/hourglass.png")))); + n->setIcon(0, Icons::hourglass()); refreshHost(n); } @@ -560,7 +561,7 @@ void RemoteManager::on_refreshOne_clicked() { deleteChildren(n); setItalic(n, true); - n->setIcon(0, QIcon(QPixmap(QString::fromUtf8(":/hourglass.png")))); + n->setIcon(0, Icons::hourglass()); refreshHost(n); } diff --git a/qrenderdoc/Windows/Dialogs/SuggestRemoteDialog.cpp b/qrenderdoc/Windows/Dialogs/SuggestRemoteDialog.cpp index 0ab2af8d5..baa47998e 100644 --- a/qrenderdoc/Windows/Dialogs/SuggestRemoteDialog.cpp +++ b/qrenderdoc/Windows/Dialogs/SuggestRemoteDialog.cpp @@ -24,6 +24,7 @@ #include "SuggestRemoteDialog.h" #include +#include "Code/Resources.h" #include "ui_SuggestRemoteDialog.h" SuggestRemoteDialog::SuggestRemoteDialog(const QString &driver, const QString &machineIdent, @@ -69,7 +70,7 @@ void SuggestRemoteDialog::remotesAdded() tr("the capture locally?")); ui->remote->setEnabled(true); - ui->remote->setIcon(QIcon(QPixmap(QString::fromUtf8(":/down_arrow.png")))); + ui->remote->setIcon(Icons::down_arrow()); ui->remote->setText("Remote"); } diff --git a/qrenderdoc/Windows/Dialogs/VirtualFileDialog.cpp b/qrenderdoc/Windows/Dialogs/VirtualFileDialog.cpp index 78493978d..d74eda10c 100644 --- a/qrenderdoc/Windows/Dialogs/VirtualFileDialog.cpp +++ b/qrenderdoc/Windows/Dialogs/VirtualFileDialog.cpp @@ -31,6 +31,7 @@ #include #include "Code/CaptureContext.h" #include "Code/RenderManager.h" +#include "Code/Resources.h" #include "ui_VirtualFileDialog.h" class RemoteFileModel : public QAbstractItemModel @@ -50,9 +51,9 @@ public: RemoteFileModel(RenderManager &r, QObject *parent = NULL) : Renderer(r), QAbstractItemModel(parent) { - makeIconStates(fileIcon, QString::fromUtf8(":/page_white_database.png")); - makeIconStates(exeIcon, QString::fromUtf8(":/page_white_code.png")); - makeIconStates(dirIcon, QString::fromUtf8(":/folder_page.png")); + makeIconStates(fileIcon, Pixmaps::page_white_database()); + makeIconStates(exeIcon, Pixmaps::page_white_code()); + makeIconStates(dirIcon, Pixmaps::folder_page()); Renderer.GetHomeFolder(true, [this](const char *path, const rdctype::array &files) { QString homeDir = QString::fromUtf8(path); @@ -365,9 +366,8 @@ private: QIcon exeIcon[2]; QIcon fileIcon[2]; - void makeIconStates(QIcon *icon, const QString &iconSource) + void makeIconStates(QIcon *icon, const QPixmap &normalPixmap) { - QPixmap normalPixmap(iconSource); QPixmap disabledPixmap(normalPixmap.size()); disabledPixmap.fill(Qt::transparent); QPainter p(&disabledPixmap); diff --git a/qrenderdoc/Windows/MainWindow.cpp b/qrenderdoc/Windows/MainWindow.cpp index a8a48721c..849d80f85 100644 --- a/qrenderdoc/Windows/MainWindow.cpp +++ b/qrenderdoc/Windows/MainWindow.cpp @@ -31,6 +31,7 @@ #include #include "Code/CaptureContext.h" #include "Code/QRDUtils.h" +#include "Code/Resources.h" #include "PipelineState/PipelineStateViewer.h" #include "Resources/resource.h" #include "Widgets/Extended/RDLabel.h" @@ -109,7 +110,7 @@ MainWindow::MainWindow(CaptureContext &ctx) : QMainWindow(NULL), ui(new Ui::Main contextChooser = new QToolButton(this); contextChooser->setText(tr("Replay Context: %1").arg("Local")); - contextChooser->setIcon(QIcon(QPixmap(QString::fromUtf8(":/house.png")))); + contextChooser->setIcon(Icons::house()); contextChooser->setAutoRaise(true); contextChooser->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); contextChooser->setPopupMode(QToolButton::InstantPopup); @@ -838,10 +839,9 @@ void MainWindow::setLogHasErrors(bool errors) QString filename = QFileInfo(m_Ctx.LogFilename()).fileName(); if(errors) { - QPixmap icon(QString::fromUtf8(":/delete.png")); - QPixmap empty(icon.width(), icon.height()); + QPixmap empty(Pixmaps::del().width(), Pixmaps::del().height()); empty.fill(Qt::transparent); - statusIcon->setPixmap(m_messageAlternate ? empty : icon); + statusIcon->setPixmap(m_messageAlternate ? empty : Pixmaps::del()); QString text; text = tr("%1 loaded. Log has %2 errors, warnings or performance notes. " @@ -854,7 +854,7 @@ void MainWindow::setLogHasErrors(bool errors) } else { - statusIcon->setPixmap(QPixmap(QString::fromUtf8(":/tick.png"))); + statusIcon->setPixmap(Pixmaps::tick()); statusText->setText(tr("%1 loaded. No problems detected.").arg(filename)); } } @@ -910,7 +910,7 @@ void MainWindow::messageCheck() } if(m_Ctx.Renderer().remote() && !m_Ctx.Renderer().remote()->ServerRunning) - contextChooser->setIcon(QIcon(QPixmap(QString::fromUtf8(":/cross.png")))); + contextChooser->setIcon(Icons::cross()); if(!msgs.empty()) { @@ -935,7 +935,7 @@ void MainWindow::messageCheck() GUIInvoke::call([this]() { if(m_Ctx.Renderer().remote() && !m_Ctx.Renderer().remote()->ServerRunning) { - contextChooser->setIcon(QIcon(QPixmap(QString::fromUtf8(":/cross.png")))); + contextChooser->setIcon(Icons::cross()); contextChooser->setText(tr("Replay Context: %1").arg("Local")); statusText->setText( tr("Remote server disconnected. To attempt to reconnect please select it again.")); @@ -950,9 +950,6 @@ void MainWindow::FillRemotesMenu(QMenu *menu, bool includeLocalhost) { menu->clear(); - QIcon tick(QPixmap(QString::fromUtf8(":/tick.png"))); - QIcon cross(QPixmap(QString::fromUtf8(":/cross.png"))); - for(int i = 0; i < m_Ctx.Config.RemoteHosts.count(); i++) { RemoteHost *host = m_Ctx.Config.RemoteHosts[i]; @@ -963,7 +960,7 @@ void MainWindow::FillRemotesMenu(QMenu *menu, bool includeLocalhost) QAction *action = new QAction(menu); - action->setIcon(host->ServerRunning && !host->VersionMismatch ? tick : cross); + action->setIcon(host->ServerRunning && !host->VersionMismatch ? Icons::tick() : Icons::cross()); if(host->Connected) action->setText(tr("%1 (Connected)").arg(host->Hostname)); else if(host->ServerRunning && host->VersionMismatch) @@ -989,7 +986,7 @@ void MainWindow::FillRemotesMenu(QMenu *menu, bool includeLocalhost) QAction *localContext = new QAction(menu); localContext->setText("Local"); - localContext->setIcon(QIcon(QPixmap(QString::fromUtf8(":/house.png")))); + localContext->setIcon(Icons::house()); QObject::connect(localContext, &QAction::triggered, this, &MainWindow::switchContext); localContext->setData(-1); @@ -1049,7 +1046,7 @@ void MainWindow::switchContext() if(!host) { - contextChooser->setIcon(QIcon(QPixmap(QString::fromUtf8(":/house.png")))); + contextChooser->setIcon(Icons::house()); contextChooser->setText(tr("Replay Context: %1").arg("Local")); ui->action_Inject_into_Process->setEnabled(true); @@ -1061,9 +1058,7 @@ void MainWindow::switchContext() else { contextChooser->setText(tr("Replay Context: %1").arg(host->Hostname)); - contextChooser->setIcon(host->ServerRunning - ? QIcon(QPixmap(QString::fromUtf8(":/connect.png"))) - : QIcon(QPixmap(QString::fromUtf8(":/disconnect.png")))); + contextChooser->setIcon(host->ServerRunning ? Icons::connect() : Icons::disconnect()); // disable until checking is done contextChooser->setEnabled(false); @@ -1096,13 +1091,12 @@ void MainWindow::switchContext() } GUIInvoke::call([this, host, status]() { - contextChooser->setIcon(host->ServerRunning && !host->Busy - ? QIcon(QPixmap(QString::fromUtf8(":/connect.png"))) - : QIcon(QPixmap(QString::fromUtf8(":/disconnect.png")))); + contextChooser->setIcon(host->ServerRunning && !host->Busy ? Icons::connect() + : Icons::disconnect()); if(status != eReplayCreate_Success) { - contextChooser->setIcon(QIcon(QPixmap(QString::fromUtf8(":/cross.png")))); + contextChooser->setIcon(Icons::cross()); contextChooser->setText(tr("Replay Context: %1").arg("Local")); statusText->setText(tr("Connection failed: %1").arg(ToQStr(status))); } diff --git a/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp index a3421083e..e6ab59eeb 100644 --- a/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp @@ -26,6 +26,7 @@ #include #include #include "3rdparty/toolwindowmanager/ToolWindowManager.h" +#include "Code/Resources.h" #include "Windows/BufferViewer.h" #include "Windows/ConstantBufferPreviewer.h" #include "Windows/MainWindow.h" @@ -505,8 +506,8 @@ void D3D11PipelineStateViewer::setViewDetails(QTreeWidgetItem *node, const ViewT void D3D11PipelineStateViewer::addResourceRow(const ViewTag &view, const ShaderResource *shaderInput, RDTreeWidget *resources) { - QIcon action(QPixmap(QString::fromUtf8(":/action.png"))); - QIcon action_hover(QPixmap(QString::fromUtf8(":/action_hover.png"))); + const QIcon &action = Icons::action(); + const QIcon &action_hover = Icons::action_hover(); const D3D11PipelineState::ShaderStage::ResourceView &r = view.res; @@ -724,8 +725,8 @@ void D3D11PipelineStateViewer::clearState() ui->csUAVs->clear(); - QPixmap tick(QString::fromUtf8(":/tick.png")); - QPixmap cross(QString::fromUtf8(":/cross.png")); + const QPixmap &tick = Pixmaps::tick(); + const QPixmap &cross = Pixmaps::cross(); ui->fillMode->setText(tr("Solid", "Fill Mode")); ui->cullMode->setText(tr("Front", "Cull Mode")); @@ -773,9 +774,6 @@ void D3D11PipelineStateViewer::setShaderState(const D3D11PipelineState::ShaderSt { ShaderReflection *shaderDetails = stage.ShaderDetails; - QIcon action(QPixmap(QString::fromUtf8(":/action.png"))); - QIcon action_hover(QPixmap(QString::fromUtf8(":/action_hover.png"))); - if(stage.Shader == ResourceId()) shader->setText(tr("Unbound Shader")); else @@ -1028,11 +1026,11 @@ void D3D11PipelineStateViewer::setState() const D3D11PipelineState &state = m_Ctx.CurD3D11PipelineState; const FetchDrawcall *draw = m_Ctx.CurDrawcall(); - QPixmap tick(QString::fromUtf8(":/tick.png")); - QPixmap cross(QString::fromUtf8(":/cross.png")); + const QPixmap &tick = Pixmaps::tick(); + const QPixmap &cross = Pixmaps::cross(); - QIcon action(QPixmap(QString::fromUtf8(":/action.png"))); - QIcon action_hover(QPixmap(QString::fromUtf8(":/action_hover.png"))); + const QIcon &action = Icons::action(); + const QIcon &action_hover = Icons::action_hover(); //////////////////////////////////////////////// // Vertex Input @@ -1211,40 +1209,24 @@ void D3D11PipelineStateViewer::setState() switch(topo) { - case eTopology_PointList: - ui->topologyDiagram->setPixmap(QPixmap(QString::fromUtf8(":/topologies/topo_pointlist.png"))); - break; - case eTopology_LineList: - ui->topologyDiagram->setPixmap(QPixmap(QString::fromUtf8(":/topologies/topo_linelist.png"))); - break; - case eTopology_LineStrip: - ui->topologyDiagram->setPixmap(QPixmap(QString::fromUtf8(":/topologies/topo_linestrip.png"))); - break; - case eTopology_TriangleList: - ui->topologyDiagram->setPixmap(QPixmap(QString::fromUtf8(":/topologies/topo_trilist.png"))); - break; - case eTopology_TriangleStrip: - ui->topologyDiagram->setPixmap(QPixmap(QString::fromUtf8(":/topologies/topo_tristrip.png"))); - break; + case eTopology_PointList: ui->topologyDiagram->setPixmap(Pixmaps::topo_pointlist()); break; + case eTopology_LineList: ui->topologyDiagram->setPixmap(Pixmaps::topo_linelist()); break; + case eTopology_LineStrip: ui->topologyDiagram->setPixmap(Pixmaps::topo_linestrip()); break; + case eTopology_TriangleList: ui->topologyDiagram->setPixmap(Pixmaps::topo_trilist()); break; + case eTopology_TriangleStrip: ui->topologyDiagram->setPixmap(Pixmaps::topo_tristrip()); break; case eTopology_LineList_Adj: - ui->topologyDiagram->setPixmap( - QPixmap(QString::fromUtf8(":/topologies/topo_linelist_adj.png"))); + ui->topologyDiagram->setPixmap(Pixmaps::topo_linelist_adj()); break; case eTopology_LineStrip_Adj: - ui->topologyDiagram->setPixmap( - QPixmap(QString::fromUtf8(":/topologies/topo_linestrip_adj.png"))); + ui->topologyDiagram->setPixmap(Pixmaps::topo_linestrip_adj()); break; case eTopology_TriangleList_Adj: - ui->topologyDiagram->setPixmap( - QPixmap(QString::fromUtf8(":/topologies/topo_trilist_adj.png"))); + ui->topologyDiagram->setPixmap(Pixmaps::topo_trilist_adj()); break; case eTopology_TriangleStrip_Adj: - ui->topologyDiagram->setPixmap( - QPixmap(QString::fromUtf8(":/topologies/topo_tristrip_adj.png"))); - break; - default: - ui->topologyDiagram->setPixmap(QPixmap(QString::fromUtf8(":/topologies/topo_patch.png"))); + ui->topologyDiagram->setPixmap(Pixmaps::topo_tristrip_adj()); break; + default: ui->topologyDiagram->setPixmap(Pixmaps::topo_patch()); break; } bool ibufferUsed = draw && (draw->flags & eDraw_UseIBuffer); diff --git a/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp index d4510f137..e850649f1 100644 --- a/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp @@ -26,6 +26,7 @@ #include #include #include "3rdparty/toolwindowmanager/ToolWindowManager.h" +#include "Code/Resources.h" #include "Windows/BufferViewer.h" #include "Windows/ConstantBufferPreviewer.h" #include "Windows/MainWindow.h" @@ -566,8 +567,8 @@ void D3D12PipelineStateViewer::addResourceRow(const ViewTag &view, const D3D12PipelineState::ShaderStage *stage, RDTreeWidget *resources) { - QIcon action(QPixmap(QString::fromUtf8(":/action.png"))); - QIcon action_hover(QPixmap(QString::fromUtf8(":/action_hover.png"))); + const QIcon &action = Icons::action(); + const QIcon &action_hover = Icons::action_hover(); const D3D12PipelineState::ResourceView &r = view.res; bool uav = view.type == ViewTag::UAV; @@ -817,8 +818,8 @@ void D3D12PipelineStateViewer::clearState() clearShaderState(ui->psShader, ui->psResources, ui->psSamplers, ui->psCBuffers, ui->psUAVs); clearShaderState(ui->csShader, ui->csResources, ui->csSamplers, ui->csCBuffers, ui->csUAVs); - QPixmap tick(QString::fromUtf8(":/tick.png")); - QPixmap cross(QString::fromUtf8(":/cross.png")); + const QPixmap &tick = Pixmaps::tick(); + const QPixmap &cross = Pixmaps::cross(); ui->fillMode->setText(tr("Solid", "Fill Mode")); ui->cullMode->setText(tr("Front", "Cull Mode")); @@ -866,9 +867,6 @@ void D3D12PipelineStateViewer::setShaderState(const D3D12PipelineState::ShaderSt ShaderReflection *shaderDetails = stage.ShaderDetails; const D3D12PipelineState &state = m_Ctx.CurD3D12PipelineState; - QIcon action(QPixmap(QString::fromUtf8(":/action.png"))); - QIcon action_hover(QPixmap(QString::fromUtf8(":/action_hover.png"))); - if(stage.Shader == ResourceId()) shader->setText(tr("Unbound Shader")); else if(state.customName) @@ -1164,11 +1162,11 @@ void D3D12PipelineStateViewer::setState() const D3D12PipelineState &state = m_Ctx.CurD3D12PipelineState; const FetchDrawcall *draw = m_Ctx.CurDrawcall(); - QPixmap tick(QString::fromUtf8(":/tick.png")); - QPixmap cross(QString::fromUtf8(":/cross.png")); + const QPixmap &tick = Pixmaps::tick(); + const QPixmap &cross = Pixmaps::cross(); - QIcon action(QPixmap(QString::fromUtf8(":/action.png"))); - QIcon action_hover(QPixmap(QString::fromUtf8(":/action_hover.png"))); + const QIcon &action = Icons::action(); + const QIcon &action_hover = Icons::action_hover(); //////////////////////////////////////////////// // Vertex Input @@ -1252,40 +1250,24 @@ void D3D12PipelineStateViewer::setState() switch(topo) { - case eTopology_PointList: - ui->topologyDiagram->setPixmap(QPixmap(QString::fromUtf8(":/topologies/topo_pointlist.png"))); - break; - case eTopology_LineList: - ui->topologyDiagram->setPixmap(QPixmap(QString::fromUtf8(":/topologies/topo_linelist.png"))); - break; - case eTopology_LineStrip: - ui->topologyDiagram->setPixmap(QPixmap(QString::fromUtf8(":/topologies/topo_linestrip.png"))); - break; - case eTopology_TriangleList: - ui->topologyDiagram->setPixmap(QPixmap(QString::fromUtf8(":/topologies/topo_trilist.png"))); - break; - case eTopology_TriangleStrip: - ui->topologyDiagram->setPixmap(QPixmap(QString::fromUtf8(":/topologies/topo_tristrip.png"))); - break; + case eTopology_PointList: ui->topologyDiagram->setPixmap(Pixmaps::topo_pointlist()); break; + case eTopology_LineList: ui->topologyDiagram->setPixmap(Pixmaps::topo_linelist()); break; + case eTopology_LineStrip: ui->topologyDiagram->setPixmap(Pixmaps::topo_linestrip()); break; + case eTopology_TriangleList: ui->topologyDiagram->setPixmap(Pixmaps::topo_trilist()); break; + case eTopology_TriangleStrip: ui->topologyDiagram->setPixmap(Pixmaps::topo_tristrip()); break; case eTopology_LineList_Adj: - ui->topologyDiagram->setPixmap( - QPixmap(QString::fromUtf8(":/topologies/topo_linelist_adj.png"))); + ui->topologyDiagram->setPixmap(Pixmaps::topo_linelist_adj()); break; case eTopology_LineStrip_Adj: - ui->topologyDiagram->setPixmap( - QPixmap(QString::fromUtf8(":/topologies/topo_linestrip_adj.png"))); + ui->topologyDiagram->setPixmap(Pixmaps::topo_linestrip_adj()); break; case eTopology_TriangleList_Adj: - ui->topologyDiagram->setPixmap( - QPixmap(QString::fromUtf8(":/topologies/topo_trilist_adj.png"))); + ui->topologyDiagram->setPixmap(Pixmaps::topo_trilist_adj()); break; case eTopology_TriangleStrip_Adj: - ui->topologyDiagram->setPixmap( - QPixmap(QString::fromUtf8(":/topologies/topo_tristrip_adj.png"))); - break; - default: - ui->topologyDiagram->setPixmap(QPixmap(QString::fromUtf8(":/topologies/topo_patch.png"))); + ui->topologyDiagram->setPixmap(Pixmaps::topo_tristrip_adj()); break; + default: ui->topologyDiagram->setPixmap(Pixmaps::topo_patch()); break; } bool ibufferUsed = draw && (draw->flags & eDraw_UseIBuffer); diff --git a/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp index 3c0eb9b14..a01b6aca3 100644 --- a/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp @@ -26,6 +26,7 @@ #include #include #include "3rdparty/toolwindowmanager/ToolWindowManager.h" +#include "Code/Resources.h" #include "Windows/BufferViewer.h" #include "Windows/ConstantBufferPreviewer.h" #include "Windows/MainWindow.h" @@ -461,8 +462,8 @@ void GLPipelineStateViewer::clearState() clearShaderState(ui->csShader, ui->csTextures, ui->csSamplers, ui->csUBOs, ui->csSubroutines, ui->csReadWrite); - QPixmap tick(QString::fromUtf8(":/tick.png")); - QPixmap cross(QString::fromUtf8(":/cross.png")); + const QPixmap &tick = Pixmaps::tick(); + const QPixmap &cross = Pixmaps::cross(); ui->fillMode->setText(tr("Solid", "Fill Mode")); ui->cullMode->setText(tr("Front", "Cull Mode")); @@ -522,8 +523,8 @@ void GLPipelineStateViewer::setShaderState(const GLPipelineState::ShaderStage &s const ShaderBindpointMapping &mapping = stage.BindpointMapping; const GLPipelineState &state = m_Ctx.CurGLPipelineState; - QIcon action(QPixmap(QString::fromUtf8(":/action.png"))); - QIcon action_hover(QPixmap(QString::fromUtf8(":/action_hover.png"))); + const QIcon &action = Icons::action(); + const QIcon &action_hover = Icons::action_hover(); if(stage.Shader == ResourceId()) { @@ -1033,11 +1034,11 @@ void GLPipelineStateViewer::setState() bool showDisabled = ui->showDisabled->isChecked(); bool showEmpty = ui->showEmpty->isChecked(); - QPixmap tick(QString::fromUtf8(":/tick.png")); - QPixmap cross(QString::fromUtf8(":/cross.png")); + const QPixmap &tick = Pixmaps::tick(); + const QPixmap &cross = Pixmaps::cross(); - QIcon action(QPixmap(QString::fromUtf8(":/action.png"))); - QIcon action_hover(QPixmap(QString::fromUtf8(":/action_hover.png"))); + const QIcon &action = Icons::action(); + const QIcon &action_hover = Icons::action_hover(); bool usedBindings[128] = {}; @@ -1133,40 +1134,24 @@ void GLPipelineStateViewer::setState() switch(topo) { - case eTopology_PointList: - ui->topologyDiagram->setPixmap(QPixmap(QString::fromUtf8(":/topologies/topo_pointlist.png"))); - break; - case eTopology_LineList: - ui->topologyDiagram->setPixmap(QPixmap(QString::fromUtf8(":/topologies/topo_linelist.png"))); - break; - case eTopology_LineStrip: - ui->topologyDiagram->setPixmap(QPixmap(QString::fromUtf8(":/topologies/topo_linestrip.png"))); - break; - case eTopology_TriangleList: - ui->topologyDiagram->setPixmap(QPixmap(QString::fromUtf8(":/topologies/topo_trilist.png"))); - break; - case eTopology_TriangleStrip: - ui->topologyDiagram->setPixmap(QPixmap(QString::fromUtf8(":/topologies/topo_tristrip.png"))); - break; + case eTopology_PointList: ui->topologyDiagram->setPixmap(Pixmaps::topo_pointlist()); break; + case eTopology_LineList: ui->topologyDiagram->setPixmap(Pixmaps::topo_linelist()); break; + case eTopology_LineStrip: ui->topologyDiagram->setPixmap(Pixmaps::topo_linestrip()); break; + case eTopology_TriangleList: ui->topologyDiagram->setPixmap(Pixmaps::topo_trilist()); break; + case eTopology_TriangleStrip: ui->topologyDiagram->setPixmap(Pixmaps::topo_tristrip()); break; case eTopology_LineList_Adj: - ui->topologyDiagram->setPixmap( - QPixmap(QString::fromUtf8(":/topologies/topo_linelist_adj.png"))); + ui->topologyDiagram->setPixmap(Pixmaps::topo_linelist_adj()); break; case eTopology_LineStrip_Adj: - ui->topologyDiagram->setPixmap( - QPixmap(QString::fromUtf8(":/topologies/topo_linestrip_adj.png"))); + ui->topologyDiagram->setPixmap(Pixmaps::topo_linestrip_adj()); break; case eTopology_TriangleList_Adj: - ui->topologyDiagram->setPixmap( - QPixmap(QString::fromUtf8(":/topologies/topo_trilist_adj.png"))); + ui->topologyDiagram->setPixmap(Pixmaps::topo_trilist_adj()); break; case eTopology_TriangleStrip_Adj: - ui->topologyDiagram->setPixmap( - QPixmap(QString::fromUtf8(":/topologies/topo_tristrip_adj.png"))); - break; - default: - ui->topologyDiagram->setPixmap(QPixmap(QString::fromUtf8(":/topologies/topo_patch.png"))); + ui->topologyDiagram->setPixmap(Pixmaps::topo_tristrip_adj()); break; + default: ui->topologyDiagram->setPixmap(Pixmaps::topo_patch()); break; } vs = ui->viBuffers->verticalScrollBar()->value(); diff --git a/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp index fc4bbd9e6..df73d6374 100644 --- a/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp @@ -26,6 +26,7 @@ #include #include #include "3rdparty/toolwindowmanager/ToolWindowManager.h" +#include "Code/Resources.h" #include "Windows/BufferViewer.h" #include "Windows/ConstantBufferPreviewer.h" #include "Windows/MainWindow.h" @@ -520,7 +521,7 @@ void VulkanPipelineStateViewer::clearState() clearShaderState(ui->fsShader, ui->fsResources, ui->fsUBOs); clearShaderState(ui->csShader, ui->csResources, ui->csUBOs); - QPixmap tick(QString::fromUtf8(":/tick.png")); + const QPixmap &tick = Pixmaps::tick(); ui->fillMode->setText(tr("Solid", "Fill Mode")); ui->cullMode->setText(tr("Front", "Cull Mode")); @@ -654,8 +655,8 @@ void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails, const ShaderResource *shaderRes = NULL; const BindpointMap *bindMap = NULL; - QIcon action(QPixmap(QString::fromUtf8(":/action.png"))); - QIcon action_hover(QPixmap(QString::fromUtf8(":/action_hover.png"))); + const QIcon &action = Icons::action(); + const QIcon &action_hover = Icons::action_hover(); bool isrw = false; uint bindPoint = 0; @@ -1034,8 +1035,8 @@ void VulkanPipelineStateViewer::addConstantBlockRow(ShaderReflection *shaderDeta const ConstantBlock *cblock = NULL; const BindpointMap *bindMap = NULL; - QIcon action(QPixmap(QString::fromUtf8(":/action.png"))); - QIcon action_hover(QPixmap(QString::fromUtf8(":/action_hover.png"))); + const QIcon &action = Icons::action(); + const QIcon &action_hover = Icons::action_hover(); uint32_t slot = ~0U; if(shaderDetails != NULL) @@ -1212,8 +1213,8 @@ void VulkanPipelineStateViewer::setShaderState(const VulkanPipelineState::Shader { ShaderReflection *shaderDetails = stage.ShaderDetails; - QIcon action(QPixmap(QString::fromUtf8(":/action.png"))); - QIcon action_hover(QPixmap(QString::fromUtf8(":/action_hover.png"))); + const QIcon &action = Icons::action(); + const QIcon &action_hover = Icons::action_hover(); if(stage.Shader == ResourceId()) shader->setText(tr("Unbound Shader")); @@ -1420,11 +1421,11 @@ void VulkanPipelineStateViewer::setState() bool showDisabled = ui->showDisabled->isChecked(); bool showEmpty = ui->showEmpty->isChecked(); - QPixmap tick(QString::fromUtf8(":/tick.png")); - QPixmap cross(QString::fromUtf8(":/cross.png")); + const QPixmap &tick = Pixmaps::tick(); + const QPixmap &cross = Pixmaps::cross(); - QIcon action(QPixmap(QString::fromUtf8(":/action.png"))); - QIcon action_hover(QPixmap(QString::fromUtf8(":/action_hover.png"))); + const QIcon &action = Icons::action(); + const QIcon &action_hover = Icons::action_hover(); bool usedBindings[128] = {}; @@ -1499,40 +1500,24 @@ void VulkanPipelineStateViewer::setState() switch(topo) { - case eTopology_PointList: - ui->topologyDiagram->setPixmap(QPixmap(QString::fromUtf8(":/topologies/topo_pointlist.png"))); - break; - case eTopology_LineList: - ui->topologyDiagram->setPixmap(QPixmap(QString::fromUtf8(":/topologies/topo_linelist.png"))); - break; - case eTopology_LineStrip: - ui->topologyDiagram->setPixmap(QPixmap(QString::fromUtf8(":/topologies/topo_linestrip.png"))); - break; - case eTopology_TriangleList: - ui->topologyDiagram->setPixmap(QPixmap(QString::fromUtf8(":/topologies/topo_trilist.png"))); - break; - case eTopology_TriangleStrip: - ui->topologyDiagram->setPixmap(QPixmap(QString::fromUtf8(":/topologies/topo_tristrip.png"))); - break; + case eTopology_PointList: ui->topologyDiagram->setPixmap(Pixmaps::topo_pointlist()); break; + case eTopology_LineList: ui->topologyDiagram->setPixmap(Pixmaps::topo_linelist()); break; + case eTopology_LineStrip: ui->topologyDiagram->setPixmap(Pixmaps::topo_linestrip()); break; + case eTopology_TriangleList: ui->topologyDiagram->setPixmap(Pixmaps::topo_trilist()); break; + case eTopology_TriangleStrip: ui->topologyDiagram->setPixmap(Pixmaps::topo_tristrip()); break; case eTopology_LineList_Adj: - ui->topologyDiagram->setPixmap( - QPixmap(QString::fromUtf8(":/topologies/topo_linelist_adj.png"))); + ui->topologyDiagram->setPixmap(Pixmaps::topo_linelist_adj()); break; case eTopology_LineStrip_Adj: - ui->topologyDiagram->setPixmap( - QPixmap(QString::fromUtf8(":/topologies/topo_linestrip_adj.png"))); + ui->topologyDiagram->setPixmap(Pixmaps::topo_linestrip_adj()); break; case eTopology_TriangleList_Adj: - ui->topologyDiagram->setPixmap( - QPixmap(QString::fromUtf8(":/topologies/topo_trilist_adj.png"))); + ui->topologyDiagram->setPixmap(Pixmaps::topo_trilist_adj()); break; case eTopology_TriangleStrip_Adj: - ui->topologyDiagram->setPixmap( - QPixmap(QString::fromUtf8(":/topologies/topo_tristrip_adj.png"))); - break; - default: - ui->topologyDiagram->setPixmap(QPixmap(QString::fromUtf8(":/topologies/topo_patch.png"))); + ui->topologyDiagram->setPixmap(Pixmaps::topo_tristrip_adj()); break; + default: ui->topologyDiagram->setPixmap(Pixmaps::topo_patch()); break; } vs = ui->viBuffers->verticalScrollBar()->value(); diff --git a/qrenderdoc/Windows/TextureViewer.ui b/qrenderdoc/Windows/TextureViewer.ui index 6b327dec6..7e3fde18c 100644 --- a/qrenderdoc/Windows/TextureViewer.ui +++ b/qrenderdoc/Windows/TextureViewer.ui @@ -829,7 +829,7 @@ - :/delete.png:/delete.png + :/del.png:/del.png true diff --git a/qrenderdoc/qrenderdoc.pro b/qrenderdoc/qrenderdoc.pro index eed12e4fc..4c5b7acb3 100644 --- a/qrenderdoc/qrenderdoc.pro +++ b/qrenderdoc/qrenderdoc.pro @@ -107,6 +107,7 @@ SOURCES += Code/qrenderdoc.cpp \ Code/QRDUtils.cpp \ Code/FormatElement.cpp \ Code/RemoteHost.cpp \ + Code/Resources.cpp \ Windows/Dialogs/AboutDialog.cpp \ Windows/MainWindow.cpp \ Windows/EventBrowser.cpp \ @@ -154,6 +155,7 @@ HEADERS += Code/CaptureContext.h \ Code/ScintillaSyntax.h \ Code/RemoteHost.h \ Code/QRDUtils.h \ + Code/Resources.h \ Windows/Dialogs/AboutDialog.h \ Windows/MainWindow.h \ Windows/EventBrowser.h \ diff --git a/qrenderdoc/qrenderdoc_local.vcxproj b/qrenderdoc/qrenderdoc_local.vcxproj index e977517be..886a46e06 100644 --- a/qrenderdoc/qrenderdoc_local.vcxproj +++ b/qrenderdoc/qrenderdoc_local.vcxproj @@ -642,6 +642,7 @@ + @@ -857,6 +858,7 @@ generated\moc_%(Filename).cpp + diff --git a/qrenderdoc/qrenderdoc_local.vcxproj.filters b/qrenderdoc/qrenderdoc_local.vcxproj.filters index a571b9697..c65354aab 100644 --- a/qrenderdoc/qrenderdoc_local.vcxproj.filters +++ b/qrenderdoc/qrenderdoc_local.vcxproj.filters @@ -522,6 +522,9 @@ Widgets\Extended + + Code + @@ -797,6 +800,9 @@ Generated Files + + Code +