State saving progress. Most core state seems to be saved/loaded correctly, not so for video yet unfortunately.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@386 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2008-08-30 16:05:32 +00:00
parent 95eb8f9ef3
commit 4608333a56
11 changed files with 159 additions and 42 deletions

View File

@ -18,6 +18,15 @@
#ifndef _POINTERWRAP_H
#define _POINTERWRAP_H
// Extremely simple serialization framework.
// (mis)-features:
// + Super fast
// + Very simple
// + Same code is used for serialization and deserializaition (in most cases)
// - Zero backwards/forwards compatibility
// - Serialization code for anything complex has to be manually written.
#include <stdio.h>
#include <map>
@ -25,6 +34,13 @@
#include "Common.h"
template <class T>
struct LinkedListItem : public T
{
LinkedListItem<T> *next;
};
class PointerWrap
{
public:
@ -61,10 +77,14 @@ public:
// Store maps to file. Very useful.
template<class T>
void Do(std::map<unsigned int, T> &x) {
// TODO
PanicAlert("Do(map<>) does not yet work.");
}
// Store vectors.
template<class T>
void Do(std::vector<T> &x) {
// TODO
PanicAlert("Do(vector<>) does not yet work.");
}
@ -76,6 +96,12 @@ public:
template<class T>
void Do(T &x) {
DoVoid((void *)&x, sizeof(x));
}
template<class T>
void DoLinkedList(LinkedListItem<T> **list_start) {
// TODO
PanicAlert("Do(vector<>) does not yet work.");
}
};