Create screenshots folder if it doesn't exist

When taking a screenshot the windows implementation will now check for a folder to save to and create it if it does not exist

g_pApp->field_D58 is now g_pApp->m_externalStorageDir
This commit is contained in:
Vruk
2023-07-31 05:50:26 -07:00
parent 3ccf62e613
commit cf6d27f123
4 changed files with 38 additions and 5 deletions

View File

@@ -1031,9 +1031,9 @@ void LevelRenderer::takePicture(TripodCamera* pCamera, Entity* pOwner)
static char str[256];
// @HUH: This has the potential to overwrite a file
#ifdef ORIGINAL_CODE
sprintf(str, "%s/games/com.mojang/img_%.4d.jpg", m_pMinecraft->field_D58.c_str(), getTimeMs());
sprintf(str, "%s/games/com.mojang/img_%.4d.jpg", m_pMinecraft->m_externalStorageDir.c_str(), getTimeMs());
#else
sprintf(str, "%s/games/com.mojang/img_%.4d.png", m_pMinecraft->field_D58.c_str(), getTimeMs());
sprintf(str, "img_%.4d.png", getTimeMs());
#endif
m_pMinecraft->platform()->saveScreenshot(std::string(str), Minecraft::width, Minecraft::height);