1 /***********************************************************
2 * Artsoft Retro-Game Library *
3 *----------------------------------------------------------*
4 * (c) 1995-2006 Artsoft Entertainment *
6 * Detmolder Strasse 189 *
9 * e-mail: info@artsoft.org *
10 *----------------------------------------------------------*
12 ***********************************************************/
17 static ListNode *engine_snapshot_list = NULL;
19 void SaveEngineSnapshotBuffer(void *buffer, int size)
21 struct EngineSnapshotNodeInfo *bi =
22 checked_calloc(sizeof(struct EngineSnapshotNodeInfo));
24 bi->buffer_orig = buffer;
25 bi->buffer_copy = checked_malloc(size);
28 memcpy(bi->buffer_copy, buffer, size);
30 addNodeToList(&engine_snapshot_list, NULL, bi);
33 static void LoadEngineSnapshotBuffer(struct EngineSnapshotNodeInfo *bi)
35 memcpy(bi->buffer_orig, bi->buffer_copy, bi->size);
38 void LoadEngineSnapshotBuffers()
40 ListNode *node = engine_snapshot_list;
44 LoadEngineSnapshotBuffer((struct EngineSnapshotNodeInfo *)node->content);
50 void FreeEngineSnapshotBuffers()
52 while (engine_snapshot_list != NULL)
53 deleteNodeFromList(&engine_snapshot_list, engine_snapshot_list->key,