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:
parent
02ce1c2f51
commit
db50a7ff36
1 changed files with 18 additions and 14 deletions
|
@ -32,6 +32,7 @@ void SHPKPart::load(physis_Buffer buffer)
|
||||||
auto shaderTextEdit = new QTextEdit();
|
auto shaderTextEdit = new QTextEdit();
|
||||||
shaderTextEdit->setReadOnly(true);
|
shaderTextEdit->setReadOnly(true);
|
||||||
|
|
||||||
|
try {
|
||||||
dxvk::DxbcReader reader(reinterpret_cast<const char *>(shader.bytecode), shader.len);
|
dxvk::DxbcReader reader(reinterpret_cast<const char *>(shader.bytecode), shader.len);
|
||||||
|
|
||||||
dxvk::DxbcModule module(reader);
|
dxvk::DxbcModule module(reader);
|
||||||
|
@ -51,14 +52,17 @@ void SHPKPart::load(physis_Buffer buffer)
|
||||||
shaderTextEdit->setText(QLatin1String(glsl.compile().c_str()));
|
shaderTextEdit->setText(QLatin1String(glsl.compile().c_str()));
|
||||||
|
|
||||||
pageTabWidget->addTab(shaderTextEdit, name);
|
pageTabWidget->addTab(shaderTextEdit, name);
|
||||||
|
} catch (std::exception exception) {
|
||||||
|
// TODO: display the error
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
for (int i = 0; i < shader.num_vertex_shaders; i++) {
|
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++) {
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue