Revert "instrument editor undo: don't check delta if no user input has come in that could potentially have dirtied the editor"

This reverts commit ad53b33d7c.
This commit is contained in:
tildearrow 2024-08-19 02:49:14 -05:00
parent 4f3d61c0f1
commit 251be67b69
5 changed files with 19 additions and 51 deletions

View file

@ -376,8 +376,6 @@ bool MemPatch::calcDiff(const void* pre, const void* post, size_t inputSize) {
const unsigned char* preBytes=(const unsigned char*)pre;
const unsigned char* postBytes=(const unsigned char*)post;
// @NOTE: consider/profile using a memcmp==0 check to early-out, if it's potentially faster
// for the common case, which is no change
for (size_t ii=0; ii<inputSize; ++ii) {
if (preBytes[ii] != postBytes[ii]) {
lastDiff=ii;
@ -441,7 +439,7 @@ bool DivInstrumentUndoStep::makeUndoPatch(size_t processTime_, const DivInstrume
return nameValid || podPatch.isValid();
}
bool DivInstrument::recordUndoStepIfChanged(size_t processTime, const DivInstrument* old) {
void DivInstrument::recordUndoStepIfChanged(size_t processTime, const DivInstrument* old) {
DivInstrumentUndoStep step;
// generate a patch to go back to old
@ -466,10 +464,7 @@ bool DivInstrument::recordUndoStepIfChanged(size_t processTime, const DivInstrum
undoHist.push_back(stepPtr);
// logI("DivInstrument::undoHist push (%u off, %u size)", stepPtr->podPatch.offset, stepPtr->podPatch.size);
return true;
}
return false;
}
int DivInstrument::undo() {

View file

@ -934,7 +934,7 @@ struct DivInstrument : DivInstrumentPOD {
*/
FixedQueue<DivInstrumentUndoStep*, 128> undoHist;
FixedQueue<DivInstrumentUndoStep*, 128> redoHist;
bool recordUndoStepIfChanged(size_t processTime, const DivInstrument* old);
void recordUndoStepIfChanged(size_t processTime, const DivInstrument* old);
int undo();
int redo();