Per-document target: Extended or Rebirth

A document remembers whether it saves as the editor's document alone (marked
with ExtendedVersion on Info) or as Rebirth's document with the editor's copy
embedded. Detected on open; File > Extended Format toggles it (undoable). The
setting is now the default for new files, and the Isaac compatibility warning
only applies to Rebirth documents.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-10-08 16:14:25 -04:00
1 parent 1381824fb7
commit 6edf5f0e5b
110 files changed
+175 -137

No files matched your search

+6 -5
View File
@@ -155,10 +155,11 @@ namespace anm2ed::document
namespace anm2ed
{
Document::Document(const std::filesystem::path& path, bool isNew, std::string* errorString)
Document::Document(const std::filesystem::path& path, bool isNew, std::string* errorString, bool isExtendedFormat)
{
tabId = document::document_tab_id_next();
model = model::model_make();
model.isExtendedFormat = isExtendedFormat;
if (!isNew) model::model_load(model, path, errorString);
if (isNew ? !save(path, errorString) : !model.isValid)
{
@@ -183,11 +184,11 @@ namespace anm2ed
return *this;
}
bool Document::save(const std::filesystem::path& path, std::string* errorString, Options options)
bool Document::save(const std::filesystem::path& path, std::string* errorString)
{
auto absolutePath = !path.empty() ? path : this->path;
auto absolutePathUtf8 = path::to_utf8(absolutePath);
if (model::model_save(model, absolutePath, errorString, options))
if (model::model_save(model, absolutePath, errorString, {.isExtendedFormat = model.isExtendedFormat}))
{
this->path = absolutePath;
toast_log(Level::INFO, TOAST_SAVE_DOCUMENT, absolutePathUtf8);
@@ -213,11 +214,11 @@ namespace anm2ed
return path.parent_path() / std::filesystem::path(std::u8string(fileName.begin(), fileName.end()));
}
bool Document::autosave(std::string* errorString, Options options)
bool Document::autosave(std::string* errorString)
{
auto autosavePath = autosave_path_get();
auto autosavePathUtf8 = path::to_utf8(autosavePath);
if (model::model_save(model, autosavePath, errorString, options))
if (model::model_save(model, autosavePath, errorString, {.isExtendedFormat = model.isExtendedFormat}))
{
for (auto id : spritesheets_autosave_dirty_get())
{