mirror of
https://github.com/celisej567/mcpe.git
synced 2026-09-17 20:10:23 +03:00
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:
@@ -109,7 +109,7 @@ public:
|
||||
bool m_bGrabbedMouse = true;
|
||||
HitResult m_hitResult;
|
||||
int m_progressPercent = 0;
|
||||
std::string field_D58;
|
||||
std::string m_externalStorageDir;
|
||||
Timer m_timer;
|
||||
bool m_bPreparingLevel = false;
|
||||
LevelStorageSource* m_pLevelStorageSource = nullptr; // TODO
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user