mirror of
https://github.com/redstrate/Novus.git
synced 2025-04-20 19:57:44 +00:00
Armoury: Prevent crashes in FMV when face and other misc models fail to load
This commit is contained in:
parent
182fe062e2
commit
6f9cf59f94
1 changed files with 73 additions and 68 deletions
|
@ -318,7 +318,7 @@ void GearView::updatePart()
|
||||||
|
|
||||||
if (mdl_data.size > 0) {
|
if (mdl_data.size > 0) {
|
||||||
auto mdl = physis_mdl_parse(mdl_data);
|
auto mdl = physis_mdl_parse(mdl_data);
|
||||||
|
if (mdl.p_ptr != nullptr) {
|
||||||
std::vector<physis_Material> materials;
|
std::vector<physis_Material> materials;
|
||||||
for (uint32_t i = 0; i < mdl.num_material_names; i++) {
|
for (uint32_t i = 0; i < mdl.num_material_names; i++) {
|
||||||
const char *material_name = mdl.material_names[i];
|
const char *material_name = mdl.material_names[i];
|
||||||
|
@ -354,6 +354,7 @@ void GearView::updatePart()
|
||||||
loadedGears.push_back(gearAddition);
|
loadedGears.push_back(gearAddition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (auto &queuedRemoval : queuedGearRemovals) {
|
for (auto &queuedRemoval : queuedGearRemovals) {
|
||||||
auto it = std::find_if(loadedGears.cbegin(), loadedGears.cend(), [queuedRemoval](const LoadedGear &other) {
|
auto it = std::find_if(loadedGears.cbegin(), loadedGears.cend(), [queuedRemoval](const LoadedGear &other) {
|
||||||
|
@ -381,7 +382,7 @@ void GearView::updatePart()
|
||||||
|
|
||||||
if (mdl_data.size > 0) {
|
if (mdl_data.size > 0) {
|
||||||
auto mdl = physis_mdl_parse(mdl_data);
|
auto mdl = physis_mdl_parse(mdl_data);
|
||||||
|
if (mdl.p_ptr != nullptr) {
|
||||||
std::vector<physis_Material> materials;
|
std::vector<physis_Material> materials;
|
||||||
for (uint32_t i = 0; i < mdl.num_material_names; i++) {
|
for (uint32_t i = 0; i < mdl.num_material_names; i++) {
|
||||||
const char *material_name = mdl.material_names[i];
|
const char *material_name = mdl.material_names[i];
|
||||||
|
@ -397,6 +398,7 @@ void GearView::updatePart()
|
||||||
mdlPart->addModel(mdl, true, glm::vec3(), sanitizeMdlPath(mdlPath), materials, currentLod);
|
mdlPart->addModel(mdl, true, glm::vec3(), sanitizeMdlPath(mdlPath), materials, currentLod);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (hair) {
|
if (hair) {
|
||||||
const auto mdlPath = QLatin1String(physis_build_character_path(CharacterCategory::Hair, *hair, currentRace, currentSubrace, currentGender));
|
const auto mdlPath = QLatin1String(physis_build_character_path(CharacterCategory::Hair, *hair, currentRace, currentSubrace, currentGender));
|
||||||
|
@ -404,7 +406,7 @@ void GearView::updatePart()
|
||||||
|
|
||||||
if (mdl_data.size > 0) {
|
if (mdl_data.size > 0) {
|
||||||
auto mdl = physis_mdl_parse(mdl_data);
|
auto mdl = physis_mdl_parse(mdl_data);
|
||||||
|
if (mdl.p_ptr != nullptr) {
|
||||||
std::vector<physis_Material> materials;
|
std::vector<physis_Material> materials;
|
||||||
for (uint32_t i = 0; i < mdl.num_material_names; i++) {
|
for (uint32_t i = 0; i < mdl.num_material_names; i++) {
|
||||||
const char *material_name = mdl.material_names[i];
|
const char *material_name = mdl.material_names[i];
|
||||||
|
@ -420,6 +422,7 @@ void GearView::updatePart()
|
||||||
mdlPart->addModel(mdl, true, glm::vec3(), sanitizeMdlPath(mdlPath), materials, currentLod);
|
mdlPart->addModel(mdl, true, glm::vec3(), sanitizeMdlPath(mdlPath), materials, currentLod);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (ear) {
|
if (ear) {
|
||||||
const auto mdlPath = QLatin1String(physis_build_character_path(CharacterCategory::Ear, *ear, currentRace, currentSubrace, currentGender));
|
const auto mdlPath = QLatin1String(physis_build_character_path(CharacterCategory::Ear, *ear, currentRace, currentSubrace, currentGender));
|
||||||
|
@ -427,7 +430,7 @@ void GearView::updatePart()
|
||||||
|
|
||||||
if (mdl_data.size > 0) {
|
if (mdl_data.size > 0) {
|
||||||
auto mdl = physis_mdl_parse(mdl_data);
|
auto mdl = physis_mdl_parse(mdl_data);
|
||||||
|
if (mdl.p_ptr != nullptr) {
|
||||||
std::vector<physis_Material> materials;
|
std::vector<physis_Material> materials;
|
||||||
for (uint32_t i = 0; i < mdl.num_material_names; i++) {
|
for (uint32_t i = 0; i < mdl.num_material_names; i++) {
|
||||||
const char *material_name = mdl.material_names[i];
|
const char *material_name = mdl.material_names[i];
|
||||||
|
@ -443,6 +446,7 @@ void GearView::updatePart()
|
||||||
mdlPart->addModel(mdl, true, glm::vec3(), sanitizeMdlPath(mdlPath), materials, currentLod);
|
mdlPart->addModel(mdl, true, glm::vec3(), sanitizeMdlPath(mdlPath), materials, currentLod);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (tail) {
|
if (tail) {
|
||||||
const auto mdlPath = QLatin1String(physis_build_character_path(CharacterCategory::Tail, *tail, currentRace, currentSubrace, currentGender));
|
const auto mdlPath = QLatin1String(physis_build_character_path(CharacterCategory::Tail, *tail, currentRace, currentSubrace, currentGender));
|
||||||
|
@ -450,7 +454,7 @@ void GearView::updatePart()
|
||||||
|
|
||||||
if (mdl_data.size > 0) {
|
if (mdl_data.size > 0) {
|
||||||
auto mdl = physis_mdl_parse(mdl_data);
|
auto mdl = physis_mdl_parse(mdl_data);
|
||||||
|
if (mdl.p_ptr != nullptr) {
|
||||||
const char *material_name = mdl.material_names[0];
|
const char *material_name = mdl.material_names[0];
|
||||||
const std::string skinmtrl_path =
|
const std::string skinmtrl_path =
|
||||||
physis_build_tail_material_path(physis_get_race_code(currentRace, currentSubrace, currentGender), *tail, material_name);
|
physis_build_tail_material_path(physis_get_race_code(currentRace, currentSubrace, currentGender), *tail, material_name);
|
||||||
|
@ -461,6 +465,7 @@ void GearView::updatePart()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
raceDirty = false;
|
raceDirty = false;
|
||||||
gearDirty = false;
|
gearDirty = false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue