Skip to content

Commit 75f99fb

Browse files
committed
* The correct snapshot is now used when the history has enough items to require
multiple snapshots.
1 parent a710ad6 commit 75f99fb

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

TheForceEngine/TFE_Editor/history.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ namespace TFE_Editor
178178

179179
CommandHeader* header = hBuffer_createHeader();
180180
header->cmdId = CMD_SNAPSHOT;
181-
header->cmdName = 0;
181+
header->cmdName = id; // this holds the snapshot ID instead of a name for snapshots (which have their own name).
182182
header->parentId = parentId;
183183
header->depth = 0;
184184
header->hidden = 0;
@@ -207,11 +207,7 @@ namespace TFE_Editor
207207
// Callback setup by the client.
208208
s_snapshotBuffer.clear();
209209
s_snapshotCreate(&s_snapshotBuffer);
210-
211-
// TODO: Compress
212-
213-
// Create the snapshot itself.
214-
history_createSnapshotInternal((u32)s_snapshotBuffer.size(), s_snapshotBuffer.data(), "");
210+
history_createSnapshotInternal((u32)s_snapshotBuffer.size(), s_snapshotBuffer.data(), s_cmdName[name].c_str());
215211
// Return false to let the caller know a snapshot was created instead of the command.
216212
return false;
217213
}
@@ -319,7 +315,7 @@ namespace TFE_Editor
319315

320316
if (cmdHeader->cmdId == CMD_SNAPSHOT)
321317
{
322-
const s32 id = cmdList[i];
318+
const s32 id = cmdHeader->cmdName;
323319
Snapshot* snapshot = &s_snapShots[id];
324320
if (snapshot->uncompressedSize > snapshot->compressedSize)
325321
{

0 commit comments

Comments
 (0)