Jazz2::Editor::SavedComparison class

Shows where the level being edited differs from its file saved on disk.

While it's shown, the saved level is kept read, and the differences — tiles of the layer being edited, and events — are found again only where the level changed since, the whole level is gone through only when its layers or tile sets changed. The saved file is read again once it was saved, also by another program.

Constructors, destructors, conversion operators

SavedComparison(IEditorContext& context) explicit
Creates the comparison of the level of an editor, it isn't shown yet.
~SavedComparison()
SavedComparison(const SavedComparison&) deleted

Public functions

auto operator=(const SavedComparison&) -> SavedComparison& deleted
auto IsShown() const -> bool
Returns true while the differences are shown.
void Toggle(bool strokeInProgress)
Shows the differences, or stops showing them.
void Hide()
Stops showing the differences, as when another level is edited.
void NoteDocumentChanges(const DocumentChanges& changes)
Tells about changes of the level, the differences are found again where they are.
void ReloadIfSavedChanged()
Reads the saved level again if its file changed since it was read.
void Draw(Painter& painter, const Rectf& viewRect, bool strokeInProgress)
Draws the differences over the view, with strokeInProgress as in Toggle().

Function documentation

void Jazz2::Editor::SavedComparison::Toggle(bool strokeInProgress)

Shows the differences, or stops showing them.

With strokeInProgress, a stroke of a tool goes on, the whole level is compared only once it's done.