feat: Added automatic backups

This commit is contained in:
WerWolv
2023-12-11 11:42:33 +01:00
parent e6796d1458
commit 7a4358a5ec
10 changed files with 182 additions and 23 deletions

View File

@@ -375,6 +375,9 @@ namespace hex::fs {
case ImHexPath::Config:
result = appendPath(getConfigPaths(), "config");
break;
case ImHexPath::Backups:
result = appendPath(getDataPaths(), "backups");
break;
case ImHexPath::Encodings:
result = appendPath(getDataPaths(), "encodings");
break;

View File

@@ -40,6 +40,9 @@ namespace ImGuiExt {
}
Texture::Texture(const ImU8 *buffer, int size, Filter filter, int width, int height) {
if (size == 0)
return;
unsigned char *imageData = stbi_load_from_memory(buffer, size, &this->m_width, &this->m_height, nullptr, 4);
if (imageData == nullptr) {
if (width * height * 4 > size)