Fix crash with missing DynOS folders

This commit is contained in:
Llennpie 2022-09-21 14:13:27 -04:00
parent e939c02d7d
commit 99b02e81e6
2 changed files with 13 additions and 4 deletions

View file

@ -305,6 +305,9 @@ void saturn_load_cc_directory() {
colorCodeDir = "dynos/colorcodes/";
#endif
if (!fs::exists(colorCodeDir))
return;
for (const auto & entry : fs::directory_iterator(colorCodeDir)) {
fs::path path = entry.path();

View file

@ -58,6 +58,10 @@ void saturn_load_eye_folder(std::string path) {
eye_array.clear();
fs::create_directory("res/gfx");
// if eye folder is missing
if (!fs::exists("dynos/eyes/"))
return;
// reset dir if we last used models or returned to root
if (path == "../") path = "";
if (model_eyes_enabled || path == "") {
@ -149,11 +153,13 @@ const void* saturn_bind_texture(const void* input) {
}
}
if (eye_array.size() > 0) {
if (texName == "actors/mario/mario_eyes_left_unused.rgba16" || texName.find("saturn_eye") != string::npos) {
outputTexture = current_eye.c_str();
const void* output = static_cast<const void*>(outputTexture);
return output;
}
}
return input;
}