Merge pull request #24 from integerbang/legacy

Fix dangling pointer references in `saturn_bind_texture`
This commit is contained in:
Llennpie 2023-04-14 22:38:35 -04:00 committed by GitHub
commit 90ad49788e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -182,19 +182,13 @@ const void* saturn_bind_texture(const void* input) {
} }
if (show_vmario_emblem) { if (show_vmario_emblem) {
if (texName == "actors/mario/no_m.rgba16") { if (texName == "actors/mario/no_m.rgba16")
outputTexture = string("actors/mario/mario_logo.rgba16").c_str(); return "actors/mario/mario_logo.rgba16";
const void* output = static_cast<const void*>(outputTexture);
return output;
}
} }
if (gCurrLevelNum == LEVEL_SA && use_color_background) { if (gCurrLevelNum == LEVEL_SA && use_color_background) {
if (texName.find("textures/skybox_tiles/") != string::npos) { if (texName.find("textures/skybox_tiles/") != string::npos)
outputTexture = string("textures/saturn/white.rgba16").c_str(); return "textures/saturn/white.rgba16";
const void* output = static_cast<const void*>(outputTexture);
return output;
}
} }
return input; return input;