1 // ============================================================================
2 // Artsoft Retro-Game Library
3 // ----------------------------------------------------------------------------
4 // (c) 1995-2014 by Artsoft Entertainment
7 // http://www.artsoft.org/
8 // ----------------------------------------------------------------------------
10 // ============================================================================
15 static ListNode *engine_snapshot_list = NULL;
17 void SaveEngineSnapshotBuffer(void *buffer, int size)
19 struct EngineSnapshotNodeInfo *bi =
20 checked_calloc(sizeof(struct EngineSnapshotNodeInfo));
22 bi->buffer_orig = buffer;
23 bi->buffer_copy = checked_malloc(size);
26 memcpy(bi->buffer_copy, buffer, size);
28 addNodeToList(&engine_snapshot_list, NULL, bi);
31 static void LoadEngineSnapshotBuffer(struct EngineSnapshotNodeInfo *bi)
33 memcpy(bi->buffer_orig, bi->buffer_copy, bi->size);
36 void LoadEngineSnapshotBuffers()
38 ListNode *node = engine_snapshot_list;
42 LoadEngineSnapshotBuffer((struct EngineSnapshotNodeInfo *)node->content);
48 void FreeEngineSnapshotBuffers()
50 while (engine_snapshot_list != NULL)
51 deleteNodeFromList(&engine_snapshot_list, engine_snapshot_list->key,