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:
1 parent
1381824fb7
commit
6edf5f0e5b
110 files changed
+175
-137
No files matched your search
@@ -27,3 +27,19 @@ TEST_CASE("saved text is what tinyxml2 prints for the same document")
|
||||
document.Print(&printer);
|
||||
CHECK(text == printer.CStr());
|
||||
}
|
||||
|
||||
TEST_CASE("a document's format is kept by what it saves")
|
||||
{
|
||||
auto model = model_load(file_load(CORPUS_DIR / "01_minimal.anm2"));
|
||||
CHECK_FALSE(model.isExtendedFormat);
|
||||
CHECK_FALSE(model_load(model::model_to_string(model)).isExtendedFormat);
|
||||
|
||||
auto rebirthHash = model::model_hash(model);
|
||||
model.isExtendedFormat = true;
|
||||
CHECK(model::model_hash(model) != rebirthHash);
|
||||
auto text = model::model_to_string(model, {.isExtendedFormat = true});
|
||||
CHECK(text.find("SourceDocument") == std::string::npos);
|
||||
auto reloaded = model_load(text);
|
||||
CHECK(reloaded.isExtendedFormat);
|
||||
CHECK(model::model_hash(reloaded) == model::model_hash(model));
|
||||
}
|
||||
Reference in new issue
Block a user