summaryrefslogtreecommitdiff
path: root/undo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'undo.cpp')
-rw-r--r--undo.cpp48
1 files changed, 1 insertions, 47 deletions
diff --git a/undo.cpp b/undo.cpp
index a86e214..e568675 100644
--- a/undo.cpp
+++ b/undo.cpp
@@ -1,49 +1,3 @@
-void Arbitrary_WriteInto(uint8 *Address_Read, uint8 *Address_Write, uint64 Size)
-{
- uint64 i = 0;
- while (i < Size) {
- *(Address_Write + i) = *(Address_Read + i);
- i++;
- }
-}
-
-void Arbitrary_Zero(uint8 *Address_Write, uint64 Size)
-{
- uint64 i = 0;
- while (i < Size) {
- *(Address_Write + i) = 0;
- i++;
- }
-}
-
-void Arbitrary_SwapData(memory *Memory, uint8 *Address_0, uint8 *Address_1, uint64 Size)
-{
- uint8 *Buffer_Scratch = (uint8 *)Memory_PushScratch(Memory, Size);
- Arbitrary_WriteInto(Address_0, Buffer_Scratch, Size);
- Arbitrary_WriteInto(Address_1, Address_0, Size);
- Arbitrary_WriteInto(Buffer_Scratch, Address_1, Size);
- Memory_PopScratch(Memory, Size);
-}
-
-
-static void
-Arbitrary_ShiftData(uint8 *Address_Start, uint8 *Address_End, uint64 ShiftAmount, int32 Direction)
-{
- if (Direction > 0) {
- uint8 *AddressPlayhead = Address_End;
- while ((ptrsize)AddressPlayhead >= (ptrsize)Address_Start) {
- *(AddressPlayhead + ShiftAmount) = *AddressPlayhead;
- AddressPlayhead--;
- }
- } else {
- uint8 *AddressPlayhead = Address_Start;
- while ((ptrsize)AddressPlayhead < (ptrsize)Address_End) {
- *(AddressPlayhead - ShiftAmount) = *AddressPlayhead;
- AddressPlayhead++;
- }
- }
-}
-
struct history_info {
uint16 ActionCount_Total;
uint16 ActionCount_EndOfPlayhead;
@@ -249,7 +203,7 @@ static void History_Action_Add(memory *Memory, history_action ActionData, void *
{
void *Address_HistoryTree = Memory_AddressAtOffset(Memory, P_UndoBuffer, Info.ActionOffset_Total);
void *Address_Data = Memory_AddressAtOffset(Memory, Action->TableName, Action->ByteOffset);
- Arbitrary_WriteInto((uint8 *)Address_Data, (uint8 *)Address_HistoryTree, Action->Size);
+ Memory_Copy((uint8 *)Address_HistoryTree, (uint8 *)Address_Data, Action->Size);
} else if (Action->Type == action_type_shift)
{
void *Address_Start = Memory_AddressAtOffset(Memory, Action->TableName, Action->ByteOffset);