1
Fork 0
mirror of https://github.com/redstrate/Novus.git synced 2025-04-26 13:47:46 +00:00

Fix translation error in shpk part, prevent crashes when decomp fails

This commit is contained in:
Joshua Goins 2024-04-20 15:45:19 -04:00
parent 02ce1c2f51
commit db50a7ff36

View file

@ -32,6 +32,7 @@ void SHPKPart::load(physis_Buffer buffer)
auto shaderTextEdit = new QTextEdit();
shaderTextEdit->setReadOnly(true);
try {
dxvk::DxbcReader reader(reinterpret_cast<const char *>(shader.bytecode), shader.len);
dxvk::DxbcModule module(reader);
@ -51,14 +52,17 @@ void SHPKPart::load(physis_Buffer buffer)
shaderTextEdit->setText(QLatin1String(glsl.compile().c_str()));
pageTabWidget->addTab(shaderTextEdit, name);
} catch (std::exception exception) {
// TODO: display the error
}
};
for (int i = 0; i < shader.num_vertex_shaders; i++) {
addShader(shader.vertex_shaders[i], i18nc("@title:tab", "Vertex Shader %1").arg(i));
addShader(shader.vertex_shaders[i], i18nc("@title:tab", "Vertex Shader %1", i));
}
for (int i = 0; i < shader.num_pixel_shaders; i++) {
addShader(shader.pixel_shaders[i], i18nc("@title:tab", "Pixel Shader %1").arg(i));
addShader(shader.pixel_shaders[i], i18nc("@title:tab", "Pixel Shader %1", i));
}
}