mirror of
https://github.com/celisej567/mcpe.git
synced 2026-09-11 20:11:18 +03:00
* Fix options and screenshot saving.
This commit is contained in:
@@ -55,8 +55,31 @@ void AppPlatform_android::buyGame()
|
||||
{
|
||||
}
|
||||
|
||||
bool AppPlatform_android::hasFileSystemAccess()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void AppPlatform_android::setExternalStoragePath(const std::string& path)
|
||||
{
|
||||
m_storageDir = path;
|
||||
}
|
||||
|
||||
void AppPlatform_android::saveScreenshot(const std::string& fileName, int width, int height)
|
||||
{
|
||||
std::string saveName = m_storageDir + "/" + fileName;
|
||||
|
||||
LOG_I("Saving in %s", saveName.c_str());
|
||||
|
||||
int npixels = width * height;
|
||||
uint32_t* pixels = new uint32_t[npixels];
|
||||
glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
|
||||
|
||||
stbi_flip_vertically_on_write(true);
|
||||
|
||||
stbi_write_png(saveName.c_str(), width, height, 4, pixels, width * 4);
|
||||
|
||||
delete[] pixels;
|
||||
}
|
||||
|
||||
int AppPlatform_android::getScreenWidth() const
|
||||
|
||||
Reference in New Issue
Block a user