| 2921 | } |
| 2922 | |
| 2923 | void TextureViewer::OnCaptureLoaded() |
| 2924 | { |
| 2925 | Reset(); |
| 2926 | |
| 2927 | WindowingData renderData = ui->render->GetWidgetWindowingData(); |
| 2928 | WindowingData contextData = ui->pixelContext->GetWidgetWindowingData(); |
| 2929 | |
| 2930 | ui->saveTex->setEnabled(true); |
| 2931 | ui->locationGoto->setEnabled(true); |
| 2932 | ui->viewTexBuffer->setEnabled(true); |
| 2933 | |
| 2934 | ui->pixelHistory->setEnabled(false); |
| 2935 | ui->pixelHistory->setToolTip(QString()); |
| 2936 | |
| 2937 | ui->debugPixelContext->setEnabled(false); |
| 2938 | ui->pixelHistory->setToolTip(QString()); |
| 2939 | |
| 2940 | m_TexDisplay.backgroundColor = |
| 2941 | backCol.isValid() ? FloatVector(backCol.redF(), backCol.greenF(), backCol.blueF(), 1.0f) |
| 2942 | : FloatVector(); |
| 2943 | |
| 2944 | m_Ctx.Replay().BlockInvoke([renderData, contextData, this](IReplayController *r) { |
| 2945 | m_Output = r->CreateOutput(renderData, ReplayOutputType::Texture); |
| 2946 | |
| 2947 | m_Output->SetPixelContext(contextData); |
| 2948 | |
| 2949 | ui->render->SetOutput(m_Output); |
| 2950 | ui->pixelContext->SetOutput(m_Output); |
| 2951 | |
| 2952 | RT_UpdateAndDisplay(r); |
| 2953 | |
| 2954 | GUIInvoke::call(this, [this]() { OnEventChanged(m_Ctx.CurEvent()); }); |
| 2955 | }); |
| 2956 | |
| 2957 | m_Watcher = new QFileSystemWatcher({ConfigFilePath(QString())}, this); |
| 2958 | |
| 2959 | QObject::connect(m_Watcher, &QFileSystemWatcher::fileChanged, this, |
| 2960 | &TextureViewer::customShaderModified); |
| 2961 | QObject::connect(m_Watcher, &QFileSystemWatcher::directoryChanged, this, |
| 2962 | &TextureViewer::customShaderModified); |
| 2963 | |
| 2964 | m_NeedCustomReload = true; |
| 2965 | } |
| 2966 | |
| 2967 | void TextureViewer::Reset() |
| 2968 | { |
nothing calls this directly
no test coverage detected