summaryrefslogtreecommitdiff
path: root/undo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'undo.cpp')
-rw-r--r--undo.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/undo.cpp b/undo.cpp
index e288784..82a37ea 100644
--- a/undo.cpp
+++ b/undo.cpp
@@ -103,6 +103,13 @@ void Action_Change_Commit(memory *Memory, void *DataAddress, void *OriginalData,
*(action_change_type *)Data = ActionChange;
}
+// Helper functions for common types of data changes.
+void Action_Change_Commit_SwapBool(memory *Memory, bool32 *Bool)
+{
+ bool32 OppositeBool = *Bool ^ 1;
+ Action_Change_Commit(Memory, Bool, Bool, &OppositeBool, action_change_i32);
+}
+
// This is only called when we're certain the action is going to be taken.
void Action_Entry_Commit(memory *Memory, action_entry_type Type, char *Name)
{