mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-15 08:49:20 +01:00
VideoCommon: fix graphics target not properly setting 'draw_started' texture names for efb/xfb
This commit is contained in:
parent
7b2b559743
commit
0b5f7d2c5f
@ -124,30 +124,30 @@ std::optional<std::string> ExtractTextureFilenameForConfig(const picojson::objec
|
|||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
std::string texture_info = texture_filename_iter->second.get<std::string>();
|
std::string texture_info = texture_filename_iter->second.get<std::string>();
|
||||||
if (texture_info.find(EFB_DUMP_PREFIX) != std::string::npos)
|
|
||||||
{
|
const auto handle_fb_texture =
|
||||||
const auto letter_c_pos = texture_info.find_first_of('n');
|
[&texture_info](std::string_view type) -> std::optional<std::string> {
|
||||||
if (letter_c_pos == std::string::npos)
|
const auto letter_n_pos = texture_info.find("_n");
|
||||||
|
if (letter_n_pos == std::string::npos)
|
||||||
{
|
{
|
||||||
ERROR_LOG_FMT(VIDEO, "Failed to load mod configuration file, value in 'texture_filename' "
|
ERROR_LOG_FMT(VIDEO,
|
||||||
"is an efb without a count");
|
"Failed to load mod configuration file, value in 'texture_filename' "
|
||||||
|
"is {} without a count",
|
||||||
|
type);
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
texture_info =
|
|
||||||
texture_info.substr(letter_c_pos - 1, texture_info.find_first_of("_", letter_c_pos));
|
const auto post_underscore = texture_info.find_first_of('_', letter_n_pos + 2);
|
||||||
}
|
if (post_underscore == std::string::npos)
|
||||||
else if (texture_info.find(XFB_DUMP_PREFIX) != std::string::npos)
|
return texture_info.erase(letter_n_pos, texture_info.size() - letter_n_pos);
|
||||||
{
|
else
|
||||||
const auto letter_c_pos = texture_info.find_first_of('n');
|
return texture_info.erase(letter_n_pos, post_underscore - letter_n_pos);
|
||||||
if (letter_c_pos == std::string::npos)
|
};
|
||||||
{
|
|
||||||
ERROR_LOG_FMT(VIDEO, "Failed to load mod configuration file, value in 'texture_filename' "
|
if (texture_info.starts_with(EFB_DUMP_PREFIX))
|
||||||
"is an xfb without a count");
|
return handle_fb_texture("an efb");
|
||||||
return std::nullopt;
|
else if (texture_info.starts_with(XFB_DUMP_PREFIX))
|
||||||
}
|
return handle_fb_texture("a xfb");
|
||||||
texture_info =
|
|
||||||
texture_info.substr(letter_c_pos - 1, texture_info.find_first_of("_", letter_c_pos));
|
|
||||||
}
|
|
||||||
return texture_info;
|
return texture_info;
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
Loading…
x
Reference in New Issue
Block a user